Esempio n. 1
0
 def get_helpers(self):
     helpers = super(MultilingualDatasetForm, self).get_helpers()
     
     helpers.update({
         'is_multilingual_dataset': True,
         'target_language': self.target_language,
         'language_name': 
             lambda code: ext_languages.by_code(code).name,
         'markup_for_translatable_text': 
             ext_template_helpers.markup_for_translatable_text,
     })
     
     return helpers
Esempio n. 2
0
    def get_helpers(self):
        helpers = super(MultilingualDatasetForm, self).get_helpers()

        helpers.update({
            'is_multilingual_dataset':
            True,
            'target_language':
            self.target_language,
            'language_name':
            lambda code: ext_languages.by_code(code).name,
            'markup_for_translatable_text':
            ext_template_helpers.markup_for_translatable_text,
        })

        return helpers
Esempio n. 3
0
 def _deduce_language(self):
     # Convert from ISO 639-2 to an ISO 639-1 language code
     if self.languagecode:
         return languages.by_code(self.languagecode).alpha2
     return None
 def _deduce_language(self):
     # Convert from ISO 639-2 to an ISO 639-1 language code
     if self.languagecode:
         return languages.by_code(self.languagecode).alpha2
     return None