diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 0a0a9df991..2fd3f7cc4a 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -183,6 +183,7 @@ Contributors * Hammy Goonan * Thejaswi Puthraya * BenoƮt Vogel +* Manuel E. Gutierrez Translators =========== diff --git a/docs/advanced_topics/i18n/index.rst b/docs/advanced_topics/i18n/index.rst index 2a7c7e507e..60a67f891c 100644 --- a/docs/advanced_topics/i18n/index.rst +++ b/docs/advanced_topics/i18n/index.rst @@ -166,14 +166,10 @@ Copy this into your project and make sure it's imported in any ``models.py`` fil self.fr_field = fr_field def __get__(self, instance, owner): - en = getattr(instance, self.en_field) - fr = getattr(instance, self.fr_field) - if translation.get_language() == 'fr': - return fr + return getattr(instance, self.fr_field) else: - return en - + return getattr(instance, self.en_field) Then, for each translated field, create an instance of ``TranslatedField`` with a nice name (as this is the name your templates will reference).