# Path: weechat/common/path.py
# def project_path_join(*args):
#     """Join multiple paths after settings.BASE_DIR."""
#     return __path_join(settings.BASE_DIR, *args)


from io import open
from weechat.common.path import project_path_join
    if strings:
        content += [
            '',
            'from django.utils.translation import gettext_noop',
            '',
            '',
            f'def __i18n_{app}_{name}():',
            f'    """Translations for {app}/{name}."""',
        ]
        done = set()
        for string in sorted(strings):
            if isinstance(string, tuple):
                # if type is tuple of 2 strings: use the second as note for
                # translators
                (message, translators) = (string[0], string[1])
            else:
                # single string (no note for translators)
                (message, translators) = (string, None)
            # add string if not already done
            if message not in done:
                if translators:
                    content.append(f'    # Translators: {translators}')
                message = (message
                           .replace('\\', '\\\\')
                           .replace('"', '\\"')
                           .replace('\r\n', '\\n'))
                content.append(f'    gettext_noop("{message}")')
                done.add(message)
    content.append('')
    # write file

# Path: weechat/common/path.py
# def project_path_join(*args):
#     """Join multiple paths after settings.BASE_DIR."""
#     return __path_join(settings.BASE_DIR, *args)


# Path: weechat/common/i18n.py
from io import open
from weechat.common.path import project_path_join

    if strings:
        content += [
            '',
            'from django.utils.translation import gettext_noop',
            '',
            '',
            f'def __i18n_{app}_{name}():',
            f'    """Translations for {app}/{name}."""',
        ]
        done = set()
        for string in sorted(strings):
            if isinstance(string, tuple):
                # if type is tuple of 2 strings: use the second as note for
                # translators
                (message, translators) = (string[0], string[1])
            else:
                # single string (no note for translators)
                (message, translators) = (string, None)
            # add string if not already done
            if message not in done:
                if translators:
                    content.append(f'    # Translators: {translators}')
                message = (message
                           .replace('\\', '\\\\')
                           .replace('"', '\\"')
                           .replace('\r\n', '\\n'))
                content.append(f'    gettext_noop("{message}")')
                done.add(message)
    content.append('')
    # write file

    filename = project_path_join(app, f'_i18n_{name}.py')