(self)
ensure same source lang for source app, target app and on transifex project
ensure same source lang for source app, target app and on transifex project
ensure same source lang for source app target app and on transifex project
def _ensure_same_source_lang(self):
        """
        ensure same source lang for source app, target app and on transifex project
        """
        if not self.source_app_default_lang or (self.source_app_default_lang != self.target_app_default_lang):
            raise InvalidProjectMigration(
                _("Target app default language and the source app default language don't match"))

        project_source_lang = self.migrator.get_project_source_lang
        source_app_lang_code = SOURCE_LANGUAGE_MAPPING.get(self.source_app_default_lang,
                                                           self.source_app_default_lang)
        if source_app_lang_code != project_source_lang:
            raise InvalidProjectMigration(
                _("Transifex project source lang and the source app default language don't match"))

        target_app_lang_code = SOURCE_LANGUAGE_MAPPING.get(self.target_app_default_lang,
                                                           self.target_app_default_lang)

        if target_app_lang_code != project_source_lang:
            raise InvalidProjectMigration(
                _("Transifex project source lang and the target app default language don't match"))
def _ensure_same_source_lang ( self ) : if not self . source_app_default_lang or ( self . source_app_default_lang != self . target_app_default_lang ) : raise InvalidProjectMigration ( _ ( "Target app default language and the source app default language don't match" ) ) project_source_lang = self . migrator . get_project_source_lang source_app_lang_code = SOURCE_LANGUAGE_MAPPING . get ( self . source_app_default_lang , self . source_app_default_lang ) if source_app_lang_code != project_source_lang : raise InvalidProjectMigration ( _ ( "Transifex project source lang and the source app default language don't match" ) ) target_app_lang_code = SOURCE_LANGUAGE_MAPPING . get ( self . target_app_default_lang , self . target_app_default_lang ) if target_app_lang_code != project_source_lang : raise InvalidProjectMigration ( _ ( "Transifex project source lang and the target app default language don't match" ) )