| 1 | == Use Cases == |
| 2 | |
| 3 | === Multilingual application with no relations === |
| 4 | Some multilangual applications don't have relations between different language versions of objects (eg. blog, each entry in one language). Here it is only interesting which language the content has, which can be solved by programmer easyly. So here no infrastructural changes are needed, but after changes this version shouldn't become slower. |
| 5 | |
| 6 | Specialities: |
| 7 | * each object is available only in one language |
| 8 | * no need to share logic between representations in different languages |
| 9 | * there is no representation of the object in an other language |
| 10 | |
| 11 | Model implementation: |
| 12 | * object per language |
| 13 | |
| 14 | === Multilingual application with weak relations === |
| 15 | Some multilingual applications have weak relationships, so an object just needs to know which language it has and have a reference to objects with the other languages. (eg. wiki, see entry in other language link) |
| 16 | |
| 17 | Specialities: |
| 18 | * each object is available in at least one language |
| 19 | * there is not necessary a representation in an other language |
| 20 | * if there is no representation in a language, it is not a automatic fallback |
| 21 | * if there is a representation in an other language, a relation should be possible |
| 22 | |
| 23 | Model implementation: |
| 24 | * object per language |
| 25 | * link to group object, or grouping by groupid |
| 26 | |
| 27 | === Multilingual application with strong relations === |
| 28 | Some multilingual applications share the logic in the object but have different localizations. (eg. customizable workflows, browsergame) |
| 29 | |
| 30 | Specialities: |
| 31 | * each object is available exactly once |
| 32 | * each object has at least one but can have more than one representations in different languages |
| 33 | * there is not necessary a representation in all selectable languages |
| 34 | * if there is no representation in default language, there should be an automatic fallback |
| 35 | * it should be possible to display the object in multiple languages on same page |
| 36 | |
| 37 | Model implementation: |
| 38 | * one object serves all languages (no logic duplication) |
| 39 | |
| 40 | == Approach overview == |
| 41 | A brif overview of existing approaches with implementing projects. |
| 42 | |
| 43 | * propertycolumn is holding all translations (in a map) |
| 44 | * [http://code.google.com/p/transdb/ transdb] |
| 45 | |
| 46 | * collumn per language for every translated proerty |
| 47 | * [http://code.google.com/p/django-modeltranslation/ django-modeltranslation] |
| 48 | * [http://code.google.com/p/django-transmeta/ django-transmeta] |
| 49 | |
| 50 | * big table holding all translations |
| 51 | * [http://code.google.com/p/django-utils/wiki/TranslationService django-utils] |
| 52 | |
| 53 | * table per property holding all languages of this property |
| 54 | |
| 55 | * table for not internationalized properties and an extratable for the localized version |
| 56 | * [http://code.google.com/p/django-multilingual/ django-multilingual] |
| 57 | * language is saved as integer, which doesn't work for multiple site projects where language ids in setting can differ |
| 58 | * [http://code.google.com/p/django-multilingual-model/ django-multilingual-model] |
| 59 | * [http://github.com/foxbunny/django-i18n-model/ django-i18n-model] |
| 60 | |
| 61 | * object per language, the association between objects is provided by a goup-id (an update of the not internationalized fields would overwrite this fields in all other language objects) |
| 62 | * [http://blog.rafaljonca.org/2009/03/third-style-of-django-multilingual-data.html a code example] |
| 63 | * normal model with one language, additional table with all i18n fields in other languages |
| 64 | * [http://code.google.com/p/django-pluggable-model-i18n/ django-pluggable-model-i18n] (status: experimental) |
| 65 | |
| 66 | |
| 67 | == Aspects and design Questions == |
| 68 | * setting default locale in Managers? |
| 69 | * setting default locale in related objects? |
| 70 | * is {{{ __unicode__(self):}}} locals aware? |
| 71 | * locale in URL |
| 72 | * what if somebody needs to use internationalized objects with something complexyty adding like django-reversion, is it still possible, which limitations result form the solution? |
| 73 | * getting current language easy, having easy access to other languages |
| 74 | * ltr and rtl languages mixin issues if there are multiple languages used in a page as result of fallback |
| 75 | * Models are often Subclassed, do the subclasses lose flexibility? |
| 76 | * Mark modelfields as internationalized through attribute or through meta class (first approach is bad for subclassing) |
| 77 | * fallback, you allways want/need a fallback (flexible fallback strategy? who decides how the fallback is working) |
| 78 | == Inirect Issues, related problems == |
| 79 | * Language in the URI, namespaces aware of language, reverse should be language-aware |
| 80 | * UI Multiforms for translations |
| 81 | * oly languages officially supported by Django work or can be selected in settings.py (not sure if this is describing it exactly but there is a limitation) |
| 82 | * indexable CharField could be very usefull for selection of different translations |
| 83 | * language selection |
| 84 | * in URL as .../<locale>/... |
| 85 | * in subdomain |
| 86 | * as GET request (is sometimes requestet by customers) |
| 87 | * as POST (is bad for searchengines) |
| 88 | * language databasetable similar to contenttypes databasetable |
| 89 | |
| 90 | |
| 91 | == Other resources == |
| 92 | * Tickets: #12193, #6460 and #6952, not direct related: #9924 and #5446 |
| 93 | * Discussions: |
| 94 | * [http://groups.google.com/group/django-developers/browse_thread/thread/c6fdd3abea0c7f0e Thread on django-developers] |
| 95 | * [http://groups.google.com/group/django-users/browse_frm/thread/53ec03543e9a65a1 Thread on django-users ] |
| 96 | * [http://groups.google.com/group/django-users/browse_frm/thread/d6e7eab4cc81c7b8 An other thread on django-users ] |
| 97 | * Blogposts: |
| 98 | * [http://and-other-things.blogspot.com/2009/04/list-of-django-multilingual-model.html] |
| 99 | * [http://vaig.be/2008/07/django-i18n-status.html Marc Garcia django-i18n-status] |
| 100 | |
| 101 | == bucket == |
| 102 | |
| 103 | === others === |
| 104 | * translation over .po files, django-admin edit interface for .po files |
| 105 | * [http://code.google.com/p/django-rosetta/ django-rosetta] |
| 106 | * localeurl |
| 107 | * [http://code.google.com/p/django-localeurl/ django-localeurl] [http://bitbucket.org/carljm/django-localeurl/ django-localeurl at bitbucket] |
| 108 | * [http://github.com/nshah/django-translatable-model/ django-translatable-model] |
| 109 | * dead project [http://code.google.com/p/i18ndynamic/ i18ndynamic] |