(self, domain, app_id, version, key_lang, source_lang, lang_prefix,
                 exclude_if_default=False, use_version_postfix=True)
Generates translations for source/default lang files and also for translated files
        :param domain: domain name
        :param app_id: app UUID
        :param version: version of the app to use, usually the built version. If none, the
        current app state is used.
        :param key_lang: the lang used to create msgid in PO files. Usually en.
        :param source_lang: the lang to create the msgstr in PO files. Should be same as
        key lang for source files and the target lang for translated files
        :param lang_prefix: usually default_
        :param exclude_if_default: set this to skip adding msgstr in case its same as the
        default language. For details: https://github.com/dimagi/commcare-hq/pull/20706
        :param use_version_postfix: use version number at the end of resource slugs
Generates translations for source/default lang files and also for translated files
        :param domain: domain name
        :param app_id: app UUID
        :param version: version of the app to use, usually the built version. If none, the
        current app state is used.
        :param key_lang: the lang used to create msgid in PO files. Usually en.
        :param source_lang: the lang to create the msgstr in PO files. Should be same as
        key lang for source files and the target lang for translated files
        :param lang_prefix: usually default_
        :param exclude_if_default: set this to skip adding msgstr in case its same as the
        default language. For details: https://github.com/dimagi/commcare-hq/pull/20706
        :param use_version_postfix: use version number at the end of resource slugs
Generates translations for source / default lang files and also for translated files : param domain : domain name : param app_id : app UUID : param version : version of the app to use usually the built version . If none the current app state is used . : param key_lang : the lang used to create msgid in PO files . Usually en . : param source_lang : the lang to create the msgstr in PO files . Should be same as key lang for source files and the target lang for translated files : param lang_prefix : usually default_ : param exclude_if_default : set this to skip adding msgstr in case its same as the default language . For details : https : // github . com / dimagi / commcare - hq / pull / 20706 : param use_version_postfix : use version number at the end of resource slugs
def __init__(self, domain, app_id, version, key_lang, source_lang, lang_prefix,
                 exclude_if_default=False, use_version_postfix=True):
        """
        Generates translations for source/default lang files and also for translated files
        :param domain: domain name
        :param app_id: app UUID
        :param version: version of the app to use, usually the built version. If none, the
        current app state is used.
        :param key_lang: the lang used to create msgid in PO files. Usually en.
        :param source_lang: the lang to create the msgstr in PO files. Should be same as
        key lang for source files and the target lang for translated files
        :param lang_prefix: usually default_
        :param exclude_if_default: set this to skip adding msgstr in case its same as the
        default language. For details: https://github.com/dimagi/commcare-hq/pull/20706
        :param use_version_postfix: use version number at the end of resource slugs
        """
        if key_lang == source_lang and exclude_if_default:
            raise Exception("Looks like you are setting up the file for default language "
                            "and doing that with exclude_if_default is not expected since "
                            "that would result in empty msgstr and no display for other lang")
        self.domain = domain
        self.app_id = app_id
        self.app = get_current_app(domain, app_id)
        self.key_lang = key_lang
        self.source_lang = source_lang
        self.lang_prefix = lang_prefix
        self.exclude_if_default = exclude_if_default
        self.version = self.app.version if version is None else version
        self.use_version_postfix = use_version_postfix
        self.checker = EligibleForTransifexChecker(self.app)

        self.headers = dict()  # headers for each sheet name
        self.sheet_name_to_module_or_form_type_and_id = dict()
        self.slug_to_name = defaultdict(dict)
        self.slug_to_name[MODULES_AND_FORMS_SHEET_NAME] = {'en': MODULES_AND_FORMS_SHEET_NAME}
        self.translations = self._build_translations()
def __init__ ( self , domain , app_id , version , key_lang , source_lang , lang_prefix , exclude_if_default = False , use_version_postfix = True ) : if key_lang == source_lang and exclude_if_default : raise Exception ( "Looks like you are setting up the file for default language " "and doing that with exclude_if_default is not expected since " "that would result in empty msgstr and no display for other lang" ) self . domain = domain self . app_id = app_id self . app = get_current_app ( domain , app_id ) self . key_lang = key_lang self . source_lang = source_lang self . lang_prefix = lang_prefix self . exclude_if_default = exclude_if_default self . version = self . app . version if version is None else version self . use_version_postfix = use_version_postfix self . checker = EligibleForTransifexChecker ( self . app ) self . headers = dict ( ) # headers for each sheet name self . sheet_name_to_module_or_form_type_and_id = dict ( ) self . slug_to_name = defaultdict ( dict ) self . slug_to_name [ MODULES_AND_FORMS_SHEET_NAME ] = { 'en' : MODULES_AND_FORMS_SHEET_NAME } self . translations = self . _build_translations ( )