Translatable chunks.
[wolnelektury.git] / wolnelektury / translation.py
index cda9ebb..95b9dd7 100644 (file)
@@ -4,10 +4,23 @@
 #
 
 from modeltranslation.translator import translator, TranslationOptions
+from catalogue.models import Collection, Tag
 from infopages.models import InfoPage
+from chunks.models import Chunk
 
 class InfoPageTranslationOptions(TranslationOptions):
     fields = ('title', 'left_column', 'right_column')
 
-translator.register(InfoPage, InfoPageTranslationOptions)
+class TagTranslationOptions(TranslationOptions):
+    fields = ('name', 'description', 'wiki_link')
+
+class CollectionTranslationOptions(TranslationOptions):
+    fields = ('title', 'description')
 
+class ChunkTranslationOptions(TranslationOptions):
+    fields = ('content',)
+
+translator.register(InfoPage, InfoPageTranslationOptions)
+translator.register(Tag, TagTranslationOptions)
+translator.register(Collection, CollectionTranslationOptions)
+translator.register(Chunk, ChunkTranslationOptions)