diff --git a/README.rst b/README.rst index 455333b..afd3000 100644 --- a/README.rst +++ b/README.rst @@ -13,9 +13,12 @@ running the following command inside the extracted directory. Running ======= -Running commands from the edx-platform directory will default to loading the -configuration at ``./conf/locale/config.yaml``. You can specify a different -configuration file with the ``--config`` argument. +For Django projects, commands should be run from the root directory, and +the default configuration will be found at ``./conf/locale/config.yaml``. +For Django apps, commands should be run from the app's directory, and +the default configuration will be found at ``./locale/config.yaml``. + +You can specify a different configuration file with the ``--config`` argument. General Commands diff --git a/i18n/__init__.py b/i18n/__init__.py index 5dcf4e7..65b2a17 100644 --- a/i18n/__init__.py +++ b/i18n/__init__.py @@ -4,7 +4,7 @@ import argparse import sys -__version__ = '0.3.5' +__version__ = '0.3.6' class Runner: @@ -13,6 +13,7 @@ class Runner: """ def __init__(self): self.args = sys.argv[1:] + self.configuration = None self.parser = argparse.ArgumentParser() self.parser.add_argument( '--config', @@ -45,8 +46,6 @@ def __call__(self, **kwargs): args = self.parser.parse_known_args(self.args)[0] for key, val in kwargs.items(): setattr(args, key, val) - if args.config: - config.CONFIGURATION = config.Configuration(args.config) - else: - config.CONFIGURATION = config.Configuration(config.LOCALE_DIR.joinpath('config.yaml').normpath()) + root_dir = kwargs.get('root_dir') + self.configuration = config.Configuration(filename=args.config, root_dir=root_dir) return self.run(args) diff --git a/i18n/branch_cleanup.py b/i18n/branch_cleanup.py index 97ffd52..400bae6 100644 --- a/i18n/branch_cleanup.py +++ b/i18n/branch_cleanup.py @@ -6,22 +6,7 @@ """ from __future__ import print_function -from i18n import config, Runner - - -def clean_conf_folder(locale): - """Remove the configuration directory for `locale`""" - dirname = config.CONFIGURATION.get_messages_dir(locale) - dirname.removedirs_p() - - -def clean_configuration_directory(): - """ - Remove the configuration directories for all locales - in CONFIGURATION.translated_locales - """ - for locale in config.CONFIGURATION.translated_locales: - clean_conf_folder(locale) +from i18n import Runner class BranchCleanup(Runner): @@ -29,7 +14,20 @@ class BranchCleanup(Runner): Class to clean up the branch """ def run(self, args): - clean_configuration_directory() + self.clean_configuration_directory() + + def clean_configuration_directory(self): + """ + Remove the configuration directories for all locales + in CONFIGURATION.translated_locales + """ + for locale in self.configuration.translated_locales: + self.clean_conf_folder(locale) + + def clean_conf_folder(self, locale): + """Remove the configuration directory for `locale`""" + dirname = self.configuration.get_messages_dir(locale) + dirname.removedirs_p() main = BranchCleanup() # pylint: disable=invalid-name diff --git a/i18n/config.py b/i18n/config.py index 2dd2a88..6e3ae98 100644 --- a/i18n/config.py +++ b/i18n/config.py @@ -10,9 +10,8 @@ # Typically this should be the 'edx-platform' directory. BASE_DIR = Path('.').abspath() # pylint: disable=invalid-name -# LOCALE_DIR contains the locale files. -# Typically this should be 'edx-platform/conf/locale' -LOCALE_DIR = BASE_DIR.joinpath('conf', 'locale') +# The base filename for the configuration file. +BASE_CONFIG_FILENAME = 'config.yaml' class Configuration(object): @@ -30,16 +29,33 @@ class Configuration(object): 'TRANSIFEX_URL': 'https://www.transifex.com/open-edx/edx-platform/', } - def __init__(self, filename=None): - self._filename = filename - self._config = self.read_config(filename) + def __init__(self, filename=None, root_dir=None): + self.root_dir = Path(root_dir) if root_dir else Path('.') + self._filename = (Path(filename) if filename else Configuration.default_config_filename(root_dir=root_dir)) + self._config = self.read_config(self._filename) + + @property + def locale_dir(self): + """ + Returns the locale directory for this configuration. + """ + return self._filename.parent + + @staticmethod + def default_config_filename(root_dir=None): + """ + Returns the default name of the configuration file. + """ + root_dir = Path(root_dir) if root_dir else Path('.').abspath() + locale_dir = root_dir / 'locale' + if not os.path.exists(locale_dir): + locale_dir = root_dir / 'conf' / 'locale' + return locale_dir / BASE_CONFIG_FILENAME def read_config(self, filename): """ Returns data found in config file (as dict), or raises exception if file not found """ - if filename is None: - return {} if not os.path.exists(filename): raise Exception("Configuration file cannot be found: %s" % filename) with open(filename) as stream: @@ -55,7 +71,7 @@ def get_messages_dir(self, locale): Returns the name of the directory holding the po files for locale. Example: edx-platform/conf/locale/fr/LC_MESSAGES """ - return LOCALE_DIR.joinpath(locale, 'LC_MESSAGES') + return self.locale_dir.joinpath(locale, 'LC_MESSAGES') @property def source_messages_dir(self): @@ -104,4 +120,4 @@ def ltr_langs(self): """ return sorted(set(self.translated_locales) - set(self.rtl_langs)) -CONFIGURATION = Configuration() +CONFIGURATION = None diff --git a/i18n/dummy.py b/i18n/dummy.py index 22b1643..3c07fba 100755 --- a/i18n/dummy.py +++ b/i18n/dummy.py @@ -30,7 +30,7 @@ import polib from path import Path -from i18n import config, Runner +from i18n import Runner from i18n.converter import Converter from i18n.generate import clean_pofile @@ -234,11 +234,11 @@ def run(self, args): """ Generate dummy strings for all source po files. """ - - source_messages_dir = config.CONFIGURATION.source_messages_dir - for locale, converter in zip(config.CONFIGURATION.dummy_locales, [Dummy(), Dummy2(), ArabicDummy()]): + configuration = self.configuration + source_messages_dir = configuration.source_messages_dir + for locale, converter in zip(configuration.dummy_locales, [Dummy(), Dummy2(), ArabicDummy()]): print('Processing source language files into dummy strings, locale "{}"'.format(locale)) - for source_file in config.CONFIGURATION.source_messages_dir.walkfiles('*.po'): + for source_file in configuration.source_messages_dir.walkfiles('*.po'): if args.verbose: print(' ', source_file.relpath()) make_dummy(source_messages_dir.joinpath(source_file), locale, converter) diff --git a/i18n/extract.py b/i18n/extract.py index 9276049..9852b9c 100755 --- a/i18n/extract.py +++ b/i18n/extract.py @@ -25,7 +25,7 @@ from path import Path -from i18n import config, Runner +from i18n import Runner from i18n.execute import execute from i18n.segment import segment_pofiles @@ -35,15 +35,16 @@ DEVNULL = open(os.devnull, 'wb') -def base(path1, *paths): - """Return a relative path from config.BASE_DIR to path1 / paths[0] / ... """ - return config.BASE_DIR.relpathto(path1.joinpath(*paths)) # pylint: disable=no-value-for-parameter - - class Extract(Runner): """ Class used to extract source files """ + + def base(self, path1, *paths): + """Return a relative path from config.BASE_DIR to path1 / paths[0] / ... """ + root_dir = self.configuration.root_dir + return root_dir.relpathto(path1.joinpath(*paths)) # pylint: disable=no-value-for-parameter + def add_args(self): """ Adds arguments @@ -62,9 +63,10 @@ def run(self, args): Main entry point of script """ logging.basicConfig(stream=sys.stdout, level=logging.INFO) - config.LOCALE_DIR.parent.makedirs_p() + configuration = self.configuration + configuration.locale_dir.parent.makedirs_p() # pylint: disable=attribute-defined-outside-init - self.source_msgs_dir = config.CONFIGURATION.source_messages_dir + self.source_msgs_dir = configuration.source_messages_dir # The extraction process clobbers django.po and djangojs.po. # Save them so that it won't do that. @@ -94,38 +96,38 @@ def run(self, args): '. --output={output}' ) - babel_mako_cfg = base(config.LOCALE_DIR, 'babel_mako.cfg') + babel_mako_cfg = self.base(configuration.locale_dir, 'babel_mako.cfg') if babel_mako_cfg.exists(): babel_mako_cmd = babel_cmd_template.format( verbosity=babel_verbosity, config=babel_mako_cfg, - output=base(config.CONFIGURATION.source_messages_dir, 'mako.po'), + output=self.base(configuration.CONFIGURATION.source_messages_dir, 'mako.po'), ) - execute(babel_mako_cmd, working_directory=config.BASE_DIR, stderr=stderr) + execute(babel_mako_cmd, working_directory=configuration.root_dir, stderr=stderr) - babel_underscore_cfg = base(config.LOCALE_DIR, 'babel_underscore.cfg') + babel_underscore_cfg = self.base(configuration.locale_dir, 'babel_underscore.cfg') if babel_underscore_cfg.exists(): babel_underscore_cmd = babel_cmd_template.format( verbosity=babel_verbosity, config=babel_underscore_cfg, - output=base(config.CONFIGURATION.source_messages_dir, 'underscore.po'), + output=self.base(configuration.source_messages_dir, 'underscore.po'), ) - execute(babel_underscore_cmd, working_directory=config.BASE_DIR, stderr=stderr) + execute(babel_underscore_cmd, working_directory=configuration.root_dir, stderr=stderr) makemessages = "django-admin.py makemessages -l en -v{}".format(args.verbose) - ignores = " ".join('--ignore="{}/*"'.format(d) for d in config.CONFIGURATION.ignore_dirs) + ignores = " ".join('--ignore="{}/*"'.format(d) for d in configuration.ignore_dirs) if ignores: makemessages += " " + ignores # Extract strings from django source files (*.py, *.html, *.txt). make_django_cmd = makemessages + ' -d django' - execute(make_django_cmd, working_directory=config.BASE_DIR, stderr=stderr) + execute(make_django_cmd, working_directory=configuration.root_dir, stderr=stderr) # Extract strings from Javascript source files (*.js). make_djangojs_cmd = makemessages + ' -d djangojs' - execute(make_djangojs_cmd, working_directory=config.BASE_DIR, stderr=stderr) + execute(make_djangojs_cmd, working_directory=configuration.root_dir, stderr=stderr) # makemessages creates 'django.po'. This filename is hardcoded. # Rename it to django-partial.po to enable merging into django.po later. @@ -138,7 +140,7 @@ def run(self, args): files_to_clean = set() # Extract strings from third-party applications. - for app_name in config.CONFIGURATION.third_party: + for app_name in configuration.third_party: # Import the app to find out where it is. Then use pybabel to extract # from that directory. app_module = importlib.import_module(app_name) @@ -149,14 +151,14 @@ def run(self, args): babel_cmd = 'pybabel {verbosity} extract -F {config} -c "Translators:" {app} -o {output}' babel_cmd = babel_cmd.format( verbosity=babel_verbosity, - config=config.LOCALE_DIR / 'babel_third_party.cfg', + config=configuration.locale_dir / 'babel_third_party.cfg', app=app_name, output=output_file, ) execute(babel_cmd, working_directory=app_dir, stderr=stderr) # Segment the generated files. - segmented_files = segment_pofiles("en") + segmented_files = segment_pofiles(configuration, "en") files_to_clean.update(segmented_files) # Finish each file. diff --git a/i18n/generate.py b/i18n/generate.py index ff37082..bad6307 100755 --- a/i18n/generate.py +++ b/i18n/generate.py @@ -20,7 +20,7 @@ from polib import pofile -from i18n import config, Runner +from i18n import Runner from i18n.execute import execute LOG = logging.getLogger(__name__) @@ -28,7 +28,7 @@ DUPLICATE_ENTRY_PATTERN = re.compile('#-#-#-#-#.*#-#-#-#-#') -def merge(locale, target='django.po', sources=('django-partial.po',), fail_if_missing=True): +def merge(configuration, locale, target='django.po', sources=('django-partial.po',), fail_if_missing=True): """ For the given locale, merge the `sources` files to become the `target` file. Note that the target file might also be one of the sources. @@ -41,7 +41,7 @@ def merge(locale, target='django.po', sources=('django-partial.po',), fail_if_mi """ LOG.info('Merging %s locale %s', target, locale) - locale_directory = config.CONFIGURATION.get_messages_dir(locale) + locale_directory = configuration.get_messages_dir(locale) try: validate_files(locale_directory, sources) except Exception: # pylint: disable=broad-except @@ -71,12 +71,12 @@ def merge(locale, target='django.po', sources=('django-partial.po',), fail_if_mi LOG.warning(" %s duplicates in %s, details in .dup file", len(duplicate_entries), target_filename) -def merge_files(locale, fail_if_missing=True): +def merge_files(configuration, locale, fail_if_missing=True): """ Merge all the files in `locale`, as specified in config.yaml. """ - for target, sources in config.CONFIGURATION.generate_merge.items(): - merge(locale, target, sources, fail_if_missing) + for target, sources in configuration.generate_merge.items(): + merge(configuration, locale, target, sources, fail_if_missing) def clean_pofile(path): @@ -163,28 +163,30 @@ def run(self, args): """ logging.basicConfig(stream=sys.stdout, level=logging.INFO) + configuration = self.configuration + root_dir = args.root_dir if args.ltr: - langs = config.CONFIGURATION.ltr_langs + langs = configuration.ltr_langs elif args.rtl: - langs = config.CONFIGURATION.rtl_langs + langs = configuration.rtl_langs else: - langs = config.CONFIGURATION.translated_locales + langs = configuration.translated_locales for locale in langs: - merge_files(locale, fail_if_missing=args.strict) + merge_files(configuration, locale, fail_if_missing=args.strict) # Dummy text is not required. Don't raise exception if files are missing. - for locale in config.CONFIGURATION.dummy_locales: - merge_files(locale, fail_if_missing=False) + for locale in configuration.dummy_locales: + merge_files(configuration, locale, fail_if_missing=False) # Merge the source locale, so we have the canonical .po files. - if config.CONFIGURATION.source_locale not in langs: - merge_files(config.CONFIGURATION.source_locale, fail_if_missing=args.strict) + if configuration.source_locale not in langs: + merge_files(configuration, configuration.source_locale, fail_if_missing=args.strict) compile_cmd = 'django-admin.py compilemessages -v{}'.format(args.verbose) if args.verbose: stderr = None else: stderr = DEVNULL - execute(compile_cmd, working_directory=config.BASE_DIR, stderr=stderr) + execute(compile_cmd, working_directory=root_dir, stderr=stderr) main = Generate() # pylint: disable=invalid-name diff --git a/i18n/segment.py b/i18n/segment.py index 135bf3b..5a1baf2 100755 --- a/i18n/segment.py +++ b/i18n/segment.py @@ -12,20 +12,20 @@ import polib -from i18n import config, Runner +from i18n import Runner LOG = logging.getLogger(__name__) -def segment_pofiles(locale): +def segment_pofiles(configuration, locale): """Segment all the pofiles for `locale`. Returns a set of filenames, all the segment files written. """ files_written = set() - for filename, segments in config.CONFIGURATION.segment.items(): - filename = config.CONFIGURATION.get_messages_dir(locale) / filename + for filename, segments in configuration.segment.items(): + filename = configuration.get_messages_dir(locale) / filename files_written.update(segment_pofile(filename, segments)) return files_written @@ -162,7 +162,7 @@ def run(self, args): # pylint: disable=unused-argument # phase calling the functions above. locales = args.locale or [] for locale in locales: - segment_pofiles(locale) + segment_pofiles(self.configuration, locale) main = Segment() # pylint: disable=invalid-name diff --git a/i18n/transifex.py b/i18n/transifex.py index fda9998..621ad6b 100755 --- a/i18n/transifex.py +++ b/i18n/transifex.py @@ -7,7 +7,7 @@ import polib from six.moves import input # pylint: disable=redefined-builtin -from i18n import config, Runner +from i18n import Runner from i18n.execute import execute from i18n.extract import EDX_MARKER @@ -44,7 +44,7 @@ def push_all(): print("\n") -def pull(*resources): +def pull(configuration, *resources): """ Pull translations from all languages listed in conf/locale/config.yaml where there is at least 10% reviewed translations. @@ -55,17 +55,17 @@ def pull(*resources): """ print("Pulling conf/locale/config.yaml:locales from Transifex...") - for lang in config.CONFIGURATION.translated_locales: + for lang in configuration.translated_locales: cmd = 'tx pull -f --mode=reviewed -l {lang}'.format(lang=lang) if resources: for resource in resources: execute(cmd + ' -r {resource}'.format(resource=resource)) else: execute(cmd) - clean_translated_locales() + clean_translated_locales(configuration) -def pull_all(): +def pull_all(configuration): """ Pulls all translations - reviewed or not - for all languages. @@ -73,54 +73,56 @@ def pull_all(): """ print("Pulling all translations for all languages, reviewed or not, from transifex...") execute('tx pull --all') - clean_translated_locales() + clean_translated_locales(configuration) -def pull_all_ltr(): +def pull_all_ltr(configuration): """ Pulls all translations - reviewed or not - for LTR languages """ print("Pulling all translated LTR languages from transifex...") - for lang in config.CONFIGURATION.ltr_langs: + for lang in configuration.ltr_langs: print('rm -rf conf/locale/' + lang) execute('rm -rf conf/locale/' + lang) execute('tx pull -l ' + lang) - clean_translated_locales(langs=config.CONFIGURATION.ltr_langs) + clean_translated_locales(configuration, langs=configuration.ltr_langs) -def pull_all_rtl(): +def pull_all_rtl(configuration): """ Pulls all translations - reviewed or not - for RTL languages """ print("Pulling all translated RTL languages from transifex...") - for lang in config.CONFIGURATION.rtl_langs: + for lang in configuration.rtl_langs: print('rm -rf conf/locale/' + lang) execute('rm -rf conf/locale/' + lang) execute('tx pull -l ' + lang) - clean_translated_locales(langs=config.CONFIGURATION.rtl_langs) + clean_translated_locales(configuration, langs=configuration.rtl_langs) -def clean_translated_locales(langs=config.CONFIGURATION.translated_locales): +def clean_translated_locales(configuration, langs=None): """ Strips out the warning from all translated po files about being an English source file. """ + if not langs: + langs = configuration.translated_locales for locale in langs: - clean_locale(locale) + clean_locale(configuration, locale) -def clean_locale(locale): +def clean_locale(configuration, locale): """ Strips out the warning from all of a locale's translated po files about being an English source file. Iterates over machine-generated files. """ - dirname = config.CONFIGURATION.get_messages_dir(locale) + dirname = configuration.get_messages_dir(locale) for filename in ('django-partial.po', 'djangojs-partial.po', 'mako.po'): - clean_file(dirname.joinpath(filename)) + clean_file(configuration, dirname.joinpath(filename)) -def clean_file(filename): +def clean_file(configuration, filename): """ Strips out the warning from a translated po file about being an English source file. Replaces warning with a note about coming from Transifex. @@ -136,19 +138,19 @@ def clean_file(filename): ) return if pofile.header.find(EDX_MARKER) != -1: - new_header = get_new_header(pofile) + new_header = get_new_header(configuration, pofile) new = pofile.header.replace(EDX_MARKER, new_header) pofile.header = new pofile.save() -def get_new_header(pofile): +def get_new_header(configuration, pofile): """ Insert info about edX into the po file headers """ team = pofile.metadata.get('Language-Team', None) if not team: - return TRANSIFEX_HEADER.format(config.CONFIGURATION.TRANSIFEX_URL) + return TRANSIFEX_HEADER.format(configuration.TRANSIFEX_URL) else: return TRANSIFEX_HEADER.format(team) @@ -163,13 +165,13 @@ def run(self, args): if args.command == "push": push(*args.arg) elif args.command == "pull": - pull(*args.arg) + pull(self.configuration, *args.arg) elif args.command == "pull_all": - pull_all() + pull_all(self.configuration) elif args.command == "ltr": - pull_all_ltr() + pull_all_ltr(self.configuration) elif args.command == "rtl": - pull_all_rtl() + pull_all_rtl(self.configuration) elif args.command == "push_all": push_all() else: diff --git a/i18n/validate.py b/i18n/validate.py index 45ae329..e8ce851 100644 --- a/i18n/validate.py +++ b/i18n/validate.py @@ -14,19 +14,19 @@ from i18n.dummy import is_format_message from i18n.execute import call from i18n.converter import Converter -from i18n import Runner, config +from i18n import Runner log = logging.getLogger(__name__) -def validate_po_files(root, report_empty=False): +def validate_po_files(configuration, locale_dir, root_dir=None, report_empty=False): """ Validate all of the po files found in the root directory that are not product of a merge. """ # List of .po files that are the product of a merge (see generate.py). - merged_files = config.CONFIGURATION.generate_merge.keys() + merged_files = configuration.generate_merge.keys() - for dirpath, __, filenames in os.walk(root): + for dirpath, __, filenames in os.walk(root_dir if root_dir else locale_dir): for name in filenames: __, ext = os.path.splitext(name) filename = os.path.join(dirpath, name) @@ -36,7 +36,7 @@ def validate_po_files(root, report_empty=False): if ext.lower() == '.po' and os.path.basename(filename) not in merged_files: # First validate the format of this file - msgfmt_check_po_file(filename) + msgfmt_check_po_file(locale_dir, filename) # Check that the translated strings are valid, and optionally # check for empty translations. But don't check English. @@ -45,14 +45,14 @@ def validate_po_files(root, report_empty=False): report_problems(filename, problems) -def msgfmt_check_po_file(filename): +def msgfmt_check_po_file(locale_dir, filename): """ Call GNU msgfmt -c on each .po file to validate its format. Any errors caught by msgfmt are logged to log. """ # Use relative paths to make output less noisy. - rfile = os.path.relpath(filename, config.LOCALE_DIR) - out, err = call('msgfmt -c -o /dev/null {}'.format(rfile), working_directory=config.LOCALE_DIR) + rfile = os.path.relpath(filename, locale_dir) + out, err = call('msgfmt -c -o /dev/null {}'.format(rfile), working_directory=locale_dir) if err != '': log.info('\n' + out) log.warning('\n' + err) @@ -214,21 +214,20 @@ def run(self, args): logging.basicConfig(stream=sys.stdout, level=log_level) languages = args.language or [] - + locale_dir = self.configuration.locale_dir if not languages: - root = config.LOCALE_DIR - validate_po_files(root, args.empty) - return - - # languages will be a list of language codes; test each language. - for language in languages: - root = config.LOCALE_DIR / language - # Assert that a directory for this language code exists on the system - if not root.isdir(): - log.error(" %s is not a valid directory.\nSkipping language '%s'", root, language) - continue - # If we found the language code's directory, validate the files. - validate_po_files(root, args.empty) + # validate all languages + validate_po_files(self.configuration, locale_dir, args.empty) + else: + # languages will be a list of language codes; test each language. + for language in languages: + root_dir = self.configuration.locale_dir / language + # Assert that a directory for this language code exists on the system + if not root_dir.isdir(): + log.error(" %s is not a valid directory.\nSkipping language '%s'", root_dir, language) + continue + # If we found the language code's directory, validate the files. + validate_po_files(self.configuration, locale_dir, root_dir=root_dir, report_empty=args.empty) main = Validate() # pylint: disable=invalid-name diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..22126b2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,21 @@ +""" +Initialization for unit tests. +""" + +from path import Path +from unittest import TestCase + +from i18n import config + +TEST_DATA_DIR = Path('.').abspath() / 'tests' / 'data' +MOCK_APPLICATION_DIR = TEST_DATA_DIR / 'mock-application' +MOCK_DJANGO_APP_DIR = TEST_DATA_DIR / 'mock-django-app' + + +class I18nToolTestCase(TestCase): + """ + Base class for all i18n tool test cases. + """ + def setUp(self): + super(I18nToolTestCase, self).setUp() + self.configuration = config.Configuration(root_dir=MOCK_APPLICATION_DIR) diff --git a/tests/data/config.yaml b/tests/data/config.yaml index 853ed1d..bfa4a8a 100644 --- a/tests/data/config.yaml +++ b/tests/data/config.yaml @@ -73,7 +73,7 @@ locales: # The locales used for fake-accented English, for testing. dummy_locales: - eo - - fake2 + - mock # Directories we don't search for strings. ignore_dirs: diff --git a/conf/locale/config.yaml b/tests/data/mock-application/conf/locale/config.yaml similarity index 99% rename from conf/locale/config.yaml rename to tests/data/mock-application/conf/locale/config.yaml index 0f3f066..6d0c035 100644 --- a/conf/locale/config.yaml +++ b/tests/data/mock-application/conf/locale/config.yaml @@ -9,7 +9,7 @@ locales: # The locales used for fake-accented English, for testing. dummy_locales: - - fake2 + - mock # How should .po files be segmented? See i18n/segment.py for details. Strings # that are only found in a particular segment are segregated into that .po file diff --git a/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django-partial.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django-partial.po new file mode 100644 index 0000000..81f906b --- /dev/null +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django-partial.po @@ -0,0 +1,30 @@ +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.289785\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Translators: 'Discussion' refers to the tab in the courseware that leads to +#. the discussion forums +#: cms/djangoapps/contentstore/views/component.py +#: lms/djangoapps/courseware/tabs.py +#: lms/djangoapps/django_comment_client/forum/views.py +msgid "Discussion" +msgstr "Đᴉsɔnssᴉøn" + +#: cms/djangoapps/contentstore/views/component.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" diff --git a/conf/locale/fake2/LC_MESSAGES/django-studio.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django-studio.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/django-studio.po rename to tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django-studio.po index 98e6d68..20341ea 100644 --- a/conf/locale/fake2/LC_MESSAGES/django-studio.po +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django-studio.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 EdX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,10 +11,10 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.417033\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: cms/djangoapps/contentstore/course_group_config.py diff --git a/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000..81c570c --- /dev/null +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,136 @@ +# #-#-#-#-# django-partial.po (0.1a) #-#-#-#-# +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# django-studio.po (0.1a) #-#-#-#-# +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# mako.po (0.1a) #-#-#-#-# +# edX community translations have been downloaded from openedx-translation +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# mako-studio.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# messages.po (EdX Studio) #-#-#-#-# +# edX translation file +# Copyright (C) 2013 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# +# #-#-#-#-# wiki.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:15+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.401374\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Translators: 'Discussion' refers to the tab in the courseware that leads to +#. the discussion forums +#: cms/djangoapps/contentstore/views/component.py +#: lms/djangoapps/courseware/tabs.py +#: lms/djangoapps/django_comment_client/forum/views.py +msgid "Discussion" +msgstr "Đᴉsɔnssᴉøn" + +#: cms/djangoapps/contentstore/views/component.py wiki/forms.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" + +#: cms/djangoapps/contentstore/course_group_config.py +#: cms/djangoapps/contentstore/views/certificates.py +msgid "invalid JSON" +msgstr "ᴉnʌɐlᴉd ɈSØN" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have name of the configuration" +msgstr "ɯnsʇ ɥɐʌǝ nɐɯǝ øɟ ʇɥǝ ɔønɟᴉƃnɹɐʇᴉøn" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have at least one group" +msgstr "ɯnsʇ ɥɐʌǝ ɐʇ lǝɐsʇ ønǝ ƃɹønd" + +#: cms/djangoapps/contentstore/course_info_model.py +msgid "Invalid course update id." +msgstr "Ɨnʌɐlᴉd ɔønɹsǝ nddɐʇǝ ᴉd." + +#: cms/templates/404.html cms/templates/error.html +#: lms/templates/static_templates/404.html +msgid "Page Not Found" +msgstr "Ᵽɐƃǝ Nøʇ Fønnd" + +#: cms/templates/404.html lms/templates/static_templates/404.html +msgid "Page not found" +msgstr "Ᵽɐƃǝ nøʇ ɟønnd" + +#: cms/templates/asset_index.html lms/templates/courseware/courseware.html +#: lms/templates/verify_student/_modal_editname.html +msgid "close" +msgstr "ɔløsǝ" + +#: cms/templates/base.html lms/templates/main.html +msgid "Skip to main content" +msgstr "Sʞᴉd ʇø ɯɐᴉn ɔønʇǝnʇ" + +#: cms/templates/404.html +msgid "The page that you were looking for was not found." +msgstr "Ŧɥǝ dɐƃǝ ʇɥɐʇ ʎøn ʍǝɹǝ løøʞᴉnƃ ɟøɹ ʍɐs nøʇ ɟønnd." + +#: cms/templates/404.html +msgid "" +"Go back to the {homepage} or let us know about any pages that may have been " +"moved at {email}." +msgstr "" +"Ǥø bɐɔʞ ʇø ʇɥǝ {homepage} øɹ lǝʇ ns ʞnøʍ ɐbønʇ ɐnʎ dɐƃǝs ʇɥɐʇ ɯɐʎ ɥɐʌǝ bǝǝn " +"ɯøʌǝd ɐʇ {email}." + +#: cms/templates/500.html +msgid "{studio_name} Server Error" +msgstr "{studio_name} Sǝɹʌǝɹ Ɇɹɹøɹ" + +# empty +msgid "This is a key string." +msgstr "Ŧɥᴉs ᴉs ɐ ʞǝʎ sʇɹᴉnƃ." + +#: wiki/admin.py wiki/models/article.py +msgid "created" +msgstr "ɔɹǝɐʇǝd" + +#: wiki/forms.py +msgid "Only localhost... muahahaha" +msgstr "Ønlʎ løɔɐlɥøsʇ... ɯnɐɥɐɥɐɥɐ" + +#: wiki/forms.py +msgid "Title" +msgstr "Ŧᴉʇlǝ" + +#: wiki/forms.py +msgid "Initial title of the article. May be overridden with revision titles." +msgstr "Ɨnᴉʇᴉɐl ʇᴉʇlǝ øɟ ʇɥǝ ɐɹʇᴉɔlǝ. Mɐʎ bǝ øʌǝɹɹᴉddǝn ʍᴉʇɥ ɹǝʌᴉsᴉøn ʇᴉʇlǝs." + +#: wiki/forms.py +msgid "Type in some contents" +msgstr "Ŧʎdǝ ᴉn søɯǝ ɔønʇǝnʇs" diff --git a/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs-partial.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs-partial.po new file mode 100644 index 0000000..eecf460 --- /dev/null +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs-partial.po @@ -0,0 +1,59 @@ +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:14+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.454767\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/static/coffee/src/views/tabs.js cms/static/coffee/src/views/tabs.js +#: cms/static/coffee/src/xblock/cms.runtime.v1.js +#: cms/static/js/certificates/views/signatory_details.js +#: cms/static/js/models/section.js cms/static/js/utils/drag_and_drop.js +#: cms/static/js/views/asset.js cms/static/js/views/container.js +#: cms/static/js/views/course_info_handout.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/edit_textbook.js +#: cms/static/js/views/list_item_editor.js cms/static/js/views/overview.js +#: cms/static/js/views/overview_assignment_grader.js +#: cms/static/js/views/modals/edit_xblock.js +#: cms/static/js/views/utils/xblock_utils.js +#: cms/static/js/views/utils/xblock_utils.js lms/static/js/ccx/schedule.js +#: lms/static/js/views/fields.js +msgid "Saving" +msgstr "Sɐʌᴉnƃ" + +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/views/course_info_update.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +#: common/static/coffee/src/discussion/utils.js +msgid "OK" +msgstr "ØꝀ" + +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/certificates/views/signatory_editor.js +#: cms/static/js/factories/export.js cms/static/js/views/asset.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/manage_users_and_roles.js +#: cms/static/js/views/show_textbook.js cms/static/js/views/validation.js +#: cms/static/js/views/modals/base_modal.js +#: cms/static/js/views/modals/course_outline_modals.js +#: cms/static/js/views/utils/view_utils.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +msgid "Cancel" +msgstr "Ȼɐnɔǝl" diff --git a/conf/locale/fake2/LC_MESSAGES/djangojs-studio.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs-studio.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/djangojs-studio.po rename to tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs-studio.po index 18cd398..6e632fe 100644 --- a/conf/locale/fake2/LC_MESSAGES/djangojs-studio.po +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs-studio.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 EdX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,10 +11,10 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.506532\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: cms/static/coffee/src/main.js diff --git a/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs.po new file mode 100644 index 0000000..22112e3 --- /dev/null +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/djangojs.po @@ -0,0 +1,131 @@ +# #-#-#-#-# djangojs-partial.po (0.1a) #-#-#-#-# +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# djangojs-studio.po (0.1a) #-#-#-#-# +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# underscore.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# underscore-studio.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.718873\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/static/coffee/src/views/tabs.js +#: cms/static/coffee/src/xblock/cms.runtime.v1.js +#: cms/static/js/certificates/views/signatory_details.js +#: cms/static/js/models/section.js cms/static/js/utils/drag_and_drop.js +#: cms/static/js/views/asset.js cms/static/js/views/container.js +#: cms/static/js/views/course_info_handout.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/edit_textbook.js +#: cms/static/js/views/list_item_editor.js cms/static/js/views/overview.js +#: cms/static/js/views/overview_assignment_grader.js +#: cms/static/js/views/modals/edit_xblock.js +#: cms/static/js/views/utils/xblock_utils.js lms/static/js/ccx/schedule.js +#: lms/static/js/views/fields.js +msgid "Saving" +msgstr "Sɐʌᴉnƃ" + +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/views/course_info_update.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +#: common/static/coffee/src/discussion/utils.js +msgid "OK" +msgstr "ØꝀ" + +#. #-#-#-#-# djangojs-partial.po (0.1a) #-#-#-#-# +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/certificates/views/signatory_editor.js +#: cms/static/js/factories/export.js cms/static/js/views/asset.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/manage_users_and_roles.js +#: cms/static/js/views/show_textbook.js cms/static/js/views/validation.js +#: cms/static/js/views/modals/base_modal.js +#: cms/static/js/views/modals/course_outline_modals.js +#: cms/static/js/views/utils/view_utils.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +#: cms/templates/js/add-xblock-component-menu-problem.underscore +#: cms/templates/js/add-xblock-component-menu.underscore +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/content-group-editor.underscore +#: cms/templates/js/course_info_handouts.underscore +#: cms/templates/js/course_info_update.underscore +#: cms/templates/js/edit-textbook.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: cms/templates/js/section-name-edit.underscore +#: cms/templates/js/xblock-string-field-editor.underscore +#: lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore +msgid "Cancel" +msgstr "Ȼɐnɔǝl" + +#: cms/static/coffee/src/main.js +msgid "" +"This may be happening because of an error with our server or your internet " +"connection. Try refreshing the page or making sure you are online." +msgstr "" +"Ŧɥᴉs ɯɐʎ bǝ ɥɐddǝnᴉnƃ bǝɔɐnsǝ øɟ ɐn ǝɹɹøɹ ʍᴉʇɥ ønɹ sǝɹʌǝɹ øɹ ʎønɹ ᴉnʇǝɹnǝʇ " +"ɔønnǝɔʇᴉøn. Ŧɹʎ ɹǝɟɹǝsɥᴉnƃ ʇɥǝ dɐƃǝ øɹ ɯɐʞᴉnƃ snɹǝ ʎøn ɐɹǝ ønlᴉnǝ." + +#: cms/static/coffee/src/main.js +msgid "Studio's having trouble saving your work" +msgstr "Sʇndᴉø's ɥɐʌᴉnƃ ʇɹønblǝ sɐʌᴉnƃ ʎønɹ ʍøɹʞ" + +#: cms/static/coffee/src/views/tabs.js +msgid "Delete Page Confirmation" +msgstr "Đǝlǝʇǝ Ᵽɐƃǝ Ȼønɟᴉɹɯɐʇᴉøn" + +#: cms/templates/js/asset-library.underscore +#: cms/templates/js/basic-modal.underscore +#: lms/templates/instructor/instructor_dashboard_2/enrollment-code-lookup-links.underscore +msgid "Actions" +msgstr "Ⱥɔʇᴉøns" + +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: lms/templates/commerce/receipt.underscore +#: lms/templates/verify_student/payment_confirmation_step.underscore +msgid "Description" +msgstr "Đǝsɔɹᴉdʇᴉøn" + +#: cms/templates/js/active-video-upload-list.underscore +msgid "Drag and drop or click here to upload video files." +msgstr "Đɹɐƃ ɐnd dɹød øɹ ɔlᴉɔʞ ɥǝɹǝ ʇø ndløɐd ʌᴉdǝø ɟᴉlǝs." + +#: cms/templates/js/active-video-upload.underscore +msgid "status" +msgstr "sʇɐʇns" + +#: cms/templates/js/add-xblock-component-menu-problem.underscore +msgid "Common Problem Types" +msgstr "Ȼøɯɯøn Ᵽɹøblǝɯ Ŧʎdǝs" diff --git a/conf/locale/fake2/LC_MESSAGES/mako-studio.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/mako-studio.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/mako-studio.po rename to tests/data/mock-application/conf/locale/fr/LC_MESSAGES/mako-studio.po index 3f89954..9c4568a 100644 --- a/conf/locale/fake2/LC_MESSAGES/mako-studio.po +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/mako-studio.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 edX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,12 +11,12 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.763985\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: cms/templates/404.html msgid "The page that you were looking for was not found." diff --git a/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/mako.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/mako.po new file mode 100644 index 0000000..d6a31ac --- /dev/null +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/mako.po @@ -0,0 +1,37 @@ +# edX community translations have been downloaded from openedx-translation +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.587204\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/404.html cms/templates/error.html +#: lms/templates/static_templates/404.html +msgid "Page Not Found" +msgstr "Ᵽɐƃǝ Nøʇ Fønnd" + +#: cms/templates/404.html lms/templates/static_templates/404.html +msgid "Page not found" +msgstr "Ᵽɐƃǝ nøʇ ɟønnd" + +#: cms/templates/asset_index.html lms/templates/courseware/courseware.html +#: lms/templates/verify_student/_modal_editname.html +msgid "close" +msgstr "ɔløsǝ" + +#: cms/templates/base.html lms/templates/main.html +msgid "Skip to main content" +msgstr "Sʞᴉd ʇø ɯɐᴉn ɔønʇǝnʇ" diff --git a/conf/locale/fake2/LC_MESSAGES/messages.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/messages.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/messages.po rename to tests/data/mock-application/conf/locale/fr/LC_MESSAGES/messages.po index d536281..657fa39 100644 --- a/conf/locale/fake2/LC_MESSAGES/messages.po +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/messages.po @@ -1,7 +1,7 @@ # edX translation file # Copyright (C) 2013 edX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. -# +# msgid "" msgstr "" "Project-Id-Version: EdX Studio\n" @@ -10,10 +10,10 @@ msgstr "" "PO-Revision-Date: 2013-05-02 13:27-0400\n" "Last-Translator: \n" "Language-Team: translation team \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" # empty diff --git a/conf/locale/fake2/LC_MESSAGES/underscore-studio.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/underscore-studio.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/underscore-studio.po rename to tests/data/mock-application/conf/locale/fr/LC_MESSAGES/underscore-studio.po index 4c93acd..5ac2ed9 100644 --- a/conf/locale/fake2/LC_MESSAGES/underscore-studio.po +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/underscore-studio.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 edX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,12 +11,12 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.718873\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: cms/templates/js/active-video-upload-list.underscore msgid "Drag and drop or click here to upload video files." diff --git a/conf/locale/fake2/LC_MESSAGES/underscore.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/underscore.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/underscore.po rename to tests/data/mock-application/conf/locale/fr/LC_MESSAGES/underscore.po index a5fdb31..867e58d 100644 --- a/conf/locale/fake2/LC_MESSAGES/underscore.po +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/underscore.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 edX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,12 +11,12 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.817853\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: cms/templates/js/add-xblock-component-menu-problem.underscore #: cms/templates/js/add-xblock-component-menu.underscore diff --git a/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/wiki.po b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/wiki.po new file mode 100644 index 0000000..2087c09 --- /dev/null +++ b/tests/data/mock-application/conf/locale/fr/LC_MESSAGES/wiki.po @@ -0,0 +1,43 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:15+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.401374\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: wiki/admin.py wiki/models/article.py +msgid "created" +msgstr "ɔɹǝɐʇǝd" + +#: wiki/forms.py +msgid "Only localhost... muahahaha" +msgstr "Ønlʎ løɔɐlɥøsʇ... ɯnɐɥɐɥɐɥɐ" + +#: wiki/forms.py wiki/forms.py wiki/forms.py +msgid "Title" +msgstr "Ŧᴉʇlǝ" + +#: wiki/forms.py +msgid "Initial title of the article. May be overridden with revision titles." +msgstr "Ɨnᴉʇᴉɐl ʇᴉʇlǝ øɟ ʇɥǝ ɐɹʇᴉɔlǝ. Mɐʎ bǝ øʌǝɹɹᴉddǝn ʍᴉʇɥ ɹǝʌᴉsᴉøn ʇᴉʇlǝs." + +#: wiki/forms.py +msgid "Type in some contents" +msgstr "Ŧʎdǝ ᴉn søɯǝ ɔønʇǝnʇs" + +#: wiki/forms.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" diff --git a/conf/locale/fake2/LC_MESSAGES/django-partial.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/django-partial.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/django-partial.po rename to tests/data/mock-application/conf/locale/mock/LC_MESSAGES/django-partial.po index b0608a5..d6ac5db 100644 --- a/conf/locale/fake2/LC_MESSAGES/django-partial.po +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/django-partial.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 EdX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,10 +11,10 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.289785\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. Translators: 'Discussion' refers to the tab in the courseware that leads to diff --git a/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/django-studio.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/django-studio.po new file mode 100644 index 0000000..20341ea --- /dev/null +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/django-studio.po @@ -0,0 +1,40 @@ +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.417033\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/djangoapps/contentstore/course_group_config.py +#: cms/djangoapps/contentstore/views/certificates.py +msgid "invalid JSON" +msgstr "ᴉnʌɐlᴉd ɈSØN" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have name of the configuration" +msgstr "ɯnsʇ ɥɐʌǝ nɐɯǝ øɟ ʇɥǝ ɔønɟᴉƃnɹɐʇᴉøn" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have at least one group" +msgstr "ɯnsʇ ɥɐʌǝ ɐʇ lǝɐsʇ ønǝ ƃɹønd" + +#: cms/djangoapps/contentstore/course_info_model.py +#: cms/djangoapps/contentstore/course_info_model.py +msgid "Invalid course update id." +msgstr "Ɨnʌɐlᴉd ɔønɹsǝ nddɐʇǝ ᴉd." + +#: cms/djangoapps/contentstore/views/component.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" diff --git a/conf/locale/fake2/LC_MESSAGES/djangojs-partial.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/djangojs-partial.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/djangojs-partial.po rename to tests/data/mock-application/conf/locale/mock/LC_MESSAGES/djangojs-partial.po index c6e36f3..5ecbb93 100644 --- a/conf/locale/fake2/LC_MESSAGES/djangojs-partial.po +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/djangojs-partial.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 EdX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,10 +11,10 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.454767\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: cms/static/coffee/src/views/tabs.js cms/static/coffee/src/views/tabs.js diff --git a/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/djangojs-studio.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/djangojs-studio.po new file mode 100644 index 0000000..6e632fe --- /dev/null +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/djangojs-studio.po @@ -0,0 +1,34 @@ +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:14+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.506532\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/static/coffee/src/main.js +msgid "" +"This may be happening because of an error with our server or your internet " +"connection. Try refreshing the page or making sure you are online." +msgstr "" +"Ŧɥᴉs ɯɐʎ bǝ ɥɐddǝnᴉnƃ bǝɔɐnsǝ øɟ ɐn ǝɹɹøɹ ʍᴉʇɥ ønɹ sǝɹʌǝɹ øɹ ʎønɹ ᴉnʇǝɹnǝʇ " +"ɔønnǝɔʇᴉøn. Ŧɹʎ ɹǝɟɹǝsɥᴉnƃ ʇɥǝ dɐƃǝ øɹ ɯɐʞᴉnƃ snɹǝ ʎøn ɐɹǝ ønlᴉnǝ." + +#: cms/static/coffee/src/main.js +msgid "Studio's having trouble saving your work" +msgstr "Sʇndᴉø's ɥɐʌᴉnƃ ʇɹønblǝ sɐʌᴉnƃ ʎønɹ ʍøɹʞ" + +#: cms/static/coffee/src/views/tabs.js +msgid "Delete Page Confirmation" +msgstr "Đǝlǝʇǝ Ᵽɐƃǝ Ȼønɟᴉɹɯɐʇᴉøn" diff --git a/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/mako-studio.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/mako-studio.po new file mode 100644 index 0000000..9c4568a --- /dev/null +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/mako-studio.po @@ -0,0 +1,35 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.763985\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/404.html +msgid "The page that you were looking for was not found." +msgstr "Ŧɥǝ dɐƃǝ ʇɥɐʇ ʎøn ʍǝɹǝ løøʞᴉnƃ ɟøɹ ʍɐs nøʇ ɟønnd." + +#: cms/templates/404.html +msgid "" +"Go back to the {homepage} or let us know about any pages that may have been " +"moved at {email}." +msgstr "" +"Ǥø bɐɔʞ ʇø ʇɥǝ {homepage} øɹ lǝʇ ns ʞnøʍ ɐbønʇ ɐnʎ dɐƃǝs ʇɥɐʇ ɯɐʎ ɥɐʌǝ bǝǝn " +"ɯøʌǝd ɐʇ {email}." + +#: cms/templates/500.html +msgid "{studio_name} Server Error" +msgstr "{studio_name} Sǝɹʌǝɹ Ɇɹɹøɹ" diff --git a/conf/locale/fake2/LC_MESSAGES/mako.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/mako.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/mako.po rename to tests/data/mock-application/conf/locale/mock/LC_MESSAGES/mako.po index 69f3a49..da3b678 100644 --- a/conf/locale/fake2/LC_MESSAGES/mako.po +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/mako.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 edX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,12 +11,12 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.587204\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: cms/templates/404.html cms/templates/error.html #: lms/templates/static_templates/404.html diff --git a/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/messages.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/messages.po new file mode 100644 index 0000000..657fa39 --- /dev/null +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/messages.po @@ -0,0 +1,21 @@ +# edX translation file +# Copyright (C) 2013 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# +msgid "" +msgstr "" +"Project-Id-Version: EdX Studio\n" +"Report-Msgid-Bugs-To: translation_team@edx.org\n" +"POT-Creation-Date: 2013-05-02 13:13-0400\n" +"PO-Revision-Date: 2013-05-02 13:27-0400\n" +"Last-Translator: \n" +"Language-Team: translation team \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +# empty +msgid "This is a key string." +msgstr "Ŧɥᴉs ᴉs ɐ ʞǝʎ sʇɹᴉnƃ." diff --git a/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/underscore-studio.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/underscore-studio.po new file mode 100644 index 0000000..5ac2ed9 --- /dev/null +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/underscore-studio.po @@ -0,0 +1,31 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.718873\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/js/active-video-upload-list.underscore +msgid "Drag and drop or click here to upload video files." +msgstr "Đɹɐƃ ɐnd dɹød øɹ ɔlᴉɔʞ ɥǝɹǝ ʇø ndløɐd ʌᴉdǝø ɟᴉlǝs." + +#: cms/templates/js/active-video-upload.underscore +msgid "status" +msgstr "sʇɐʇns" + +#: cms/templates/js/add-xblock-component-menu-problem.underscore +msgid "Common Problem Types" +msgstr "Ȼøɯɯøn Ᵽɹøblǝɯ Ŧʎdǝs" diff --git a/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/underscore.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/underscore.po new file mode 100644 index 0000000..867e58d --- /dev/null +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/underscore.po @@ -0,0 +1,46 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.817853\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/js/add-xblock-component-menu-problem.underscore +#: cms/templates/js/add-xblock-component-menu.underscore +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/content-group-editor.underscore +#: cms/templates/js/course_info_handouts.underscore +#: cms/templates/js/course_info_update.underscore +#: cms/templates/js/edit-textbook.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: cms/templates/js/section-name-edit.underscore +#: cms/templates/js/xblock-string-field-editor.underscore +#: lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore +msgid "Cancel" +msgstr "Ȼɐnɔǝl" + +#: cms/templates/js/asset-library.underscore +#: cms/templates/js/basic-modal.underscore +#: lms/templates/instructor/instructor_dashboard_2/enrollment-code-lookup-links.underscore +msgid "Actions" +msgstr "Ⱥɔʇᴉøns" + +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: lms/templates/commerce/receipt.underscore +#: lms/templates/verify_student/payment_confirmation_step.underscore +msgid "Description" +msgstr "Đǝsɔɹᴉdʇᴉøn" diff --git a/conf/locale/fake2/LC_MESSAGES/wiki.po b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/wiki.po similarity index 99% rename from conf/locale/fake2/LC_MESSAGES/wiki.po rename to tests/data/mock-application/conf/locale/mock/LC_MESSAGES/wiki.po index acf18c9..040d2ca 100644 --- a/conf/locale/fake2/LC_MESSAGES/wiki.po +++ b/tests/data/mock-application/conf/locale/mock/LC_MESSAGES/wiki.po @@ -2,7 +2,7 @@ # Copyright (C) 2015 edX # This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. # EdX Team , 2015. -# +# msgid "" msgstr "" "Project-Id-Version: 0.1a\n" @@ -11,12 +11,12 @@ msgstr "" "PO-Revision-Date: 2015-06-15 20:15:26.401374\n" "Last-Translator: \n" "Language-Team: openedx-translation \n" -"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: wiki/admin.py wiki/models/article.py msgid "created" diff --git a/tests/data/mock-django-app/locale/config.yaml b/tests/data/mock-django-app/locale/config.yaml new file mode 100644 index 0000000..a8f8c50 --- /dev/null +++ b/tests/data/mock-django-app/locale/config.yaml @@ -0,0 +1,45 @@ +# Default configuration file (example) +# Configuration for i18n workflow. +TRANSIFEX_URL: 'https://www.transifex.com/open-edx/edx-platform/' + +locales: + - mock + +source_locale: mock + +# How should .po files be segmented? See i18n/segment.py for details. Strings +# that are only found in a particular segment are segregated into that .po file +# so that translators can focus on separate parts of the product. +# +# We segregate Studio so we can provide new languages for LMS without having to +# also translate the Studio strings. LMS needs the strings from lms/* and +# common/*, so those will stay in the main .po file. +segment: + django-partial.po: # This .po file.. + django-studio.po: # produces this .po file.. + - cms/* # by segregating strings from these files. + # Anything that doesn't match a pattern stays in the original file. + djangojs-partial.po: + djangojs-studio.po: + - cms/* + mako.po: + mako-studio.po: + - cms/* + underscore.po: + underscore-studio.po: + - cms/* + +# How should the generate step merge files? +generate_merge: + django.po: + - django-partial.po + - django-studio.po + - mako.po + - mako-studio.po + - messages.po + - wiki.po + djangojs.po: + - djangojs-partial.po + - djangojs-studio.po + - underscore.po + - underscore-studio.po diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django-partial.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django-partial.po new file mode 100644 index 0000000..81f906b --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django-partial.po @@ -0,0 +1,30 @@ +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.289785\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Translators: 'Discussion' refers to the tab in the courseware that leads to +#. the discussion forums +#: cms/djangoapps/contentstore/views/component.py +#: lms/djangoapps/courseware/tabs.py +#: lms/djangoapps/django_comment_client/forum/views.py +msgid "Discussion" +msgstr "Đᴉsɔnssᴉøn" + +#: cms/djangoapps/contentstore/views/component.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django-studio.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django-studio.po new file mode 100644 index 0000000..20341ea --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django-studio.po @@ -0,0 +1,40 @@ +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.417033\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/djangoapps/contentstore/course_group_config.py +#: cms/djangoapps/contentstore/views/certificates.py +msgid "invalid JSON" +msgstr "ᴉnʌɐlᴉd ɈSØN" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have name of the configuration" +msgstr "ɯnsʇ ɥɐʌǝ nɐɯǝ øɟ ʇɥǝ ɔønɟᴉƃnɹɐʇᴉøn" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have at least one group" +msgstr "ɯnsʇ ɥɐʌǝ ɐʇ lǝɐsʇ ønǝ ƃɹønd" + +#: cms/djangoapps/contentstore/course_info_model.py +#: cms/djangoapps/contentstore/course_info_model.py +msgid "Invalid course update id." +msgstr "Ɨnʌɐlᴉd ɔønɹsǝ nddɐʇǝ ᴉd." + +#: cms/djangoapps/contentstore/views/component.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django.po new file mode 100644 index 0000000..81c570c --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/django.po @@ -0,0 +1,136 @@ +# #-#-#-#-# django-partial.po (0.1a) #-#-#-#-# +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# django-studio.po (0.1a) #-#-#-#-# +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# mako.po (0.1a) #-#-#-#-# +# edX community translations have been downloaded from openedx-translation +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# mako-studio.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# messages.po (EdX Studio) #-#-#-#-# +# edX translation file +# Copyright (C) 2013 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# +# #-#-#-#-# wiki.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:15+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.401374\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Translators: 'Discussion' refers to the tab in the courseware that leads to +#. the discussion forums +#: cms/djangoapps/contentstore/views/component.py +#: lms/djangoapps/courseware/tabs.py +#: lms/djangoapps/django_comment_client/forum/views.py +msgid "Discussion" +msgstr "Đᴉsɔnssᴉøn" + +#: cms/djangoapps/contentstore/views/component.py wiki/forms.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" + +#: cms/djangoapps/contentstore/course_group_config.py +#: cms/djangoapps/contentstore/views/certificates.py +msgid "invalid JSON" +msgstr "ᴉnʌɐlᴉd ɈSØN" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have name of the configuration" +msgstr "ɯnsʇ ɥɐʌǝ nɐɯǝ øɟ ʇɥǝ ɔønɟᴉƃnɹɐʇᴉøn" + +#: cms/djangoapps/contentstore/course_group_config.py +msgid "must have at least one group" +msgstr "ɯnsʇ ɥɐʌǝ ɐʇ lǝɐsʇ ønǝ ƃɹønd" + +#: cms/djangoapps/contentstore/course_info_model.py +msgid "Invalid course update id." +msgstr "Ɨnʌɐlᴉd ɔønɹsǝ nddɐʇǝ ᴉd." + +#: cms/templates/404.html cms/templates/error.html +#: lms/templates/static_templates/404.html +msgid "Page Not Found" +msgstr "Ᵽɐƃǝ Nøʇ Fønnd" + +#: cms/templates/404.html lms/templates/static_templates/404.html +msgid "Page not found" +msgstr "Ᵽɐƃǝ nøʇ ɟønnd" + +#: cms/templates/asset_index.html lms/templates/courseware/courseware.html +#: lms/templates/verify_student/_modal_editname.html +msgid "close" +msgstr "ɔløsǝ" + +#: cms/templates/base.html lms/templates/main.html +msgid "Skip to main content" +msgstr "Sʞᴉd ʇø ɯɐᴉn ɔønʇǝnʇ" + +#: cms/templates/404.html +msgid "The page that you were looking for was not found." +msgstr "Ŧɥǝ dɐƃǝ ʇɥɐʇ ʎøn ʍǝɹǝ løøʞᴉnƃ ɟøɹ ʍɐs nøʇ ɟønnd." + +#: cms/templates/404.html +msgid "" +"Go back to the {homepage} or let us know about any pages that may have been " +"moved at {email}." +msgstr "" +"Ǥø bɐɔʞ ʇø ʇɥǝ {homepage} øɹ lǝʇ ns ʞnøʍ ɐbønʇ ɐnʎ dɐƃǝs ʇɥɐʇ ɯɐʎ ɥɐʌǝ bǝǝn " +"ɯøʌǝd ɐʇ {email}." + +#: cms/templates/500.html +msgid "{studio_name} Server Error" +msgstr "{studio_name} Sǝɹʌǝɹ Ɇɹɹøɹ" + +# empty +msgid "This is a key string." +msgstr "Ŧɥᴉs ᴉs ɐ ʞǝʎ sʇɹᴉnƃ." + +#: wiki/admin.py wiki/models/article.py +msgid "created" +msgstr "ɔɹǝɐʇǝd" + +#: wiki/forms.py +msgid "Only localhost... muahahaha" +msgstr "Ønlʎ løɔɐlɥøsʇ... ɯnɐɥɐɥɐɥɐ" + +#: wiki/forms.py +msgid "Title" +msgstr "Ŧᴉʇlǝ" + +#: wiki/forms.py +msgid "Initial title of the article. May be overridden with revision titles." +msgstr "Ɨnᴉʇᴉɐl ʇᴉʇlǝ øɟ ʇɥǝ ɐɹʇᴉɔlǝ. Mɐʎ bǝ øʌǝɹɹᴉddǝn ʍᴉʇɥ ɹǝʌᴉsᴉøn ʇᴉʇlǝs." + +#: wiki/forms.py +msgid "Type in some contents" +msgstr "Ŧʎdǝ ᴉn søɯǝ ɔønʇǝnʇs" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs-partial.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs-partial.po new file mode 100644 index 0000000..eecf460 --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs-partial.po @@ -0,0 +1,59 @@ +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:14+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.454767\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/static/coffee/src/views/tabs.js cms/static/coffee/src/views/tabs.js +#: cms/static/coffee/src/xblock/cms.runtime.v1.js +#: cms/static/js/certificates/views/signatory_details.js +#: cms/static/js/models/section.js cms/static/js/utils/drag_and_drop.js +#: cms/static/js/views/asset.js cms/static/js/views/container.js +#: cms/static/js/views/course_info_handout.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/edit_textbook.js +#: cms/static/js/views/list_item_editor.js cms/static/js/views/overview.js +#: cms/static/js/views/overview_assignment_grader.js +#: cms/static/js/views/modals/edit_xblock.js +#: cms/static/js/views/utils/xblock_utils.js +#: cms/static/js/views/utils/xblock_utils.js lms/static/js/ccx/schedule.js +#: lms/static/js/views/fields.js +msgid "Saving" +msgstr "Sɐʌᴉnƃ" + +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/views/course_info_update.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +#: common/static/coffee/src/discussion/utils.js +msgid "OK" +msgstr "ØꝀ" + +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/certificates/views/signatory_editor.js +#: cms/static/js/factories/export.js cms/static/js/views/asset.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/manage_users_and_roles.js +#: cms/static/js/views/show_textbook.js cms/static/js/views/validation.js +#: cms/static/js/views/modals/base_modal.js +#: cms/static/js/views/modals/course_outline_modals.js +#: cms/static/js/views/utils/view_utils.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +msgid "Cancel" +msgstr "Ȼɐnɔǝl" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs-studio.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs-studio.po new file mode 100644 index 0000000..6e632fe --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs-studio.po @@ -0,0 +1,34 @@ +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:14+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.506532\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/static/coffee/src/main.js +msgid "" +"This may be happening because of an error with our server or your internet " +"connection. Try refreshing the page or making sure you are online." +msgstr "" +"Ŧɥᴉs ɯɐʎ bǝ ɥɐddǝnᴉnƃ bǝɔɐnsǝ øɟ ɐn ǝɹɹøɹ ʍᴉʇɥ ønɹ sǝɹʌǝɹ øɹ ʎønɹ ᴉnʇǝɹnǝʇ " +"ɔønnǝɔʇᴉøn. Ŧɹʎ ɹǝɟɹǝsɥᴉnƃ ʇɥǝ dɐƃǝ øɹ ɯɐʞᴉnƃ snɹǝ ʎøn ɐɹǝ ønlᴉnǝ." + +#: cms/static/coffee/src/main.js +msgid "Studio's having trouble saving your work" +msgstr "Sʇndᴉø's ɥɐʌᴉnƃ ʇɹønblǝ sɐʌᴉnƃ ʎønɹ ʍøɹʞ" + +#: cms/static/coffee/src/views/tabs.js +msgid "Delete Page Confirmation" +msgstr "Đǝlǝʇǝ Ᵽɐƃǝ Ȼønɟᴉɹɯɐʇᴉøn" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs.po new file mode 100644 index 0000000..22112e3 --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/djangojs.po @@ -0,0 +1,131 @@ +# #-#-#-#-# djangojs-partial.po (0.1a) #-#-#-#-# +# edX community translations have been downloaded from openedx-translation . +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# djangojs-studio.po (0.1a) #-#-#-#-# +# edX translation file. +# Copyright (C) 2015 EdX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# underscore.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +# #-#-#-#-# underscore-studio.po (0.1a) #-#-#-#-# +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.718873\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/static/coffee/src/views/tabs.js +#: cms/static/coffee/src/xblock/cms.runtime.v1.js +#: cms/static/js/certificates/views/signatory_details.js +#: cms/static/js/models/section.js cms/static/js/utils/drag_and_drop.js +#: cms/static/js/views/asset.js cms/static/js/views/container.js +#: cms/static/js/views/course_info_handout.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/edit_textbook.js +#: cms/static/js/views/list_item_editor.js cms/static/js/views/overview.js +#: cms/static/js/views/overview_assignment_grader.js +#: cms/static/js/views/modals/edit_xblock.js +#: cms/static/js/views/utils/xblock_utils.js lms/static/js/ccx/schedule.js +#: lms/static/js/views/fields.js +msgid "Saving" +msgstr "Sɐʌᴉnƃ" + +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/views/course_info_update.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +#: common/static/coffee/src/discussion/utils.js +msgid "OK" +msgstr "ØꝀ" + +#. #-#-#-#-# djangojs-partial.po (0.1a) #-#-#-#-# +#. Translators: this is a message from the raw HTML editor displayed in the +#. browser when a user needs to edit HTML +#: cms/static/coffee/src/views/tabs.js +#: cms/static/js/certificates/views/signatory_editor.js +#: cms/static/js/factories/export.js cms/static/js/views/asset.js +#: cms/static/js/views/course_info_update.js +#: cms/static/js/views/manage_users_and_roles.js +#: cms/static/js/views/show_textbook.js cms/static/js/views/validation.js +#: cms/static/js/views/modals/base_modal.js +#: cms/static/js/views/modals/course_outline_modals.js +#: cms/static/js/views/utils/view_utils.js +#: common/lib/xmodule/xmodule/js/src/html/edit.js +#: cms/templates/js/add-xblock-component-menu-problem.underscore +#: cms/templates/js/add-xblock-component-menu.underscore +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/content-group-editor.underscore +#: cms/templates/js/course_info_handouts.underscore +#: cms/templates/js/course_info_update.underscore +#: cms/templates/js/edit-textbook.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: cms/templates/js/section-name-edit.underscore +#: cms/templates/js/xblock-string-field-editor.underscore +#: lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore +msgid "Cancel" +msgstr "Ȼɐnɔǝl" + +#: cms/static/coffee/src/main.js +msgid "" +"This may be happening because of an error with our server or your internet " +"connection. Try refreshing the page or making sure you are online." +msgstr "" +"Ŧɥᴉs ɯɐʎ bǝ ɥɐddǝnᴉnƃ bǝɔɐnsǝ øɟ ɐn ǝɹɹøɹ ʍᴉʇɥ ønɹ sǝɹʌǝɹ øɹ ʎønɹ ᴉnʇǝɹnǝʇ " +"ɔønnǝɔʇᴉøn. Ŧɹʎ ɹǝɟɹǝsɥᴉnƃ ʇɥǝ dɐƃǝ øɹ ɯɐʞᴉnƃ snɹǝ ʎøn ɐɹǝ ønlᴉnǝ." + +#: cms/static/coffee/src/main.js +msgid "Studio's having trouble saving your work" +msgstr "Sʇndᴉø's ɥɐʌᴉnƃ ʇɹønblǝ sɐʌᴉnƃ ʎønɹ ʍøɹʞ" + +#: cms/static/coffee/src/views/tabs.js +msgid "Delete Page Confirmation" +msgstr "Đǝlǝʇǝ Ᵽɐƃǝ Ȼønɟᴉɹɯɐʇᴉøn" + +#: cms/templates/js/asset-library.underscore +#: cms/templates/js/basic-modal.underscore +#: lms/templates/instructor/instructor_dashboard_2/enrollment-code-lookup-links.underscore +msgid "Actions" +msgstr "Ⱥɔʇᴉøns" + +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: lms/templates/commerce/receipt.underscore +#: lms/templates/verify_student/payment_confirmation_step.underscore +msgid "Description" +msgstr "Đǝsɔɹᴉdʇᴉøn" + +#: cms/templates/js/active-video-upload-list.underscore +msgid "Drag and drop or click here to upload video files." +msgstr "Đɹɐƃ ɐnd dɹød øɹ ɔlᴉɔʞ ɥǝɹǝ ʇø ndløɐd ʌᴉdǝø ɟᴉlǝs." + +#: cms/templates/js/active-video-upload.underscore +msgid "status" +msgstr "sʇɐʇns" + +#: cms/templates/js/add-xblock-component-menu-problem.underscore +msgid "Common Problem Types" +msgstr "Ȼøɯɯøn Ᵽɹøblǝɯ Ŧʎdǝs" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/mako-studio.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/mako-studio.po new file mode 100644 index 0000000..9c4568a --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/mako-studio.po @@ -0,0 +1,35 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.763985\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/404.html +msgid "The page that you were looking for was not found." +msgstr "Ŧɥǝ dɐƃǝ ʇɥɐʇ ʎøn ʍǝɹǝ løøʞᴉnƃ ɟøɹ ʍɐs nøʇ ɟønnd." + +#: cms/templates/404.html +msgid "" +"Go back to the {homepage} or let us know about any pages that may have been " +"moved at {email}." +msgstr "" +"Ǥø bɐɔʞ ʇø ʇɥǝ {homepage} øɹ lǝʇ ns ʞnøʍ ɐbønʇ ɐnʎ dɐƃǝs ʇɥɐʇ ɯɐʎ ɥɐʌǝ bǝǝn " +"ɯøʌǝd ɐʇ {email}." + +#: cms/templates/500.html +msgid "{studio_name} Server Error" +msgstr "{studio_name} Sǝɹʌǝɹ Ɇɹɹøɹ" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/mako.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/mako.po new file mode 100644 index 0000000..d6a31ac --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/mako.po @@ -0,0 +1,37 @@ +# edX community translations have been downloaded from openedx-translation +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.587204\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/404.html cms/templates/error.html +#: lms/templates/static_templates/404.html +msgid "Page Not Found" +msgstr "Ᵽɐƃǝ Nøʇ Fønnd" + +#: cms/templates/404.html lms/templates/static_templates/404.html +msgid "Page not found" +msgstr "Ᵽɐƃǝ nøʇ ɟønnd" + +#: cms/templates/asset_index.html lms/templates/courseware/courseware.html +#: lms/templates/verify_student/_modal_editname.html +msgid "close" +msgstr "ɔløsǝ" + +#: cms/templates/base.html lms/templates/main.html +msgid "Skip to main content" +msgstr "Sʞᴉd ʇø ɯɐᴉn ɔønʇǝnʇ" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/messages.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/messages.po new file mode 100644 index 0000000..657fa39 --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/messages.po @@ -0,0 +1,21 @@ +# edX translation file +# Copyright (C) 2013 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# +msgid "" +msgstr "" +"Project-Id-Version: EdX Studio\n" +"Report-Msgid-Bugs-To: translation_team@edx.org\n" +"POT-Creation-Date: 2013-05-02 13:13-0400\n" +"PO-Revision-Date: 2013-05-02 13:27-0400\n" +"Last-Translator: \n" +"Language-Team: translation team \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +# empty +msgid "This is a key string." +msgstr "Ŧɥᴉs ᴉs ɐ ʞǝʎ sʇɹᴉnƃ." diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/underscore-studio.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/underscore-studio.po new file mode 100644 index 0000000..5ac2ed9 --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/underscore-studio.po @@ -0,0 +1,31 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.718873\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/js/active-video-upload-list.underscore +msgid "Drag and drop or click here to upload video files." +msgstr "Đɹɐƃ ɐnd dɹød øɹ ɔlᴉɔʞ ɥǝɹǝ ʇø ndløɐd ʌᴉdǝø ɟᴉlǝs." + +#: cms/templates/js/active-video-upload.underscore +msgid "status" +msgstr "sʇɐʇns" + +#: cms/templates/js/add-xblock-component-menu-problem.underscore +msgid "Common Problem Types" +msgstr "Ȼøɯɯøn Ᵽɹøblǝɯ Ŧʎdǝs" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/underscore.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/underscore.po new file mode 100644 index 0000000..867e58d --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/underscore.po @@ -0,0 +1,46 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:13+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.817853\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cms/templates/js/add-xblock-component-menu-problem.underscore +#: cms/templates/js/add-xblock-component-menu.underscore +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/content-group-editor.underscore +#: cms/templates/js/course_info_handouts.underscore +#: cms/templates/js/course_info_update.underscore +#: cms/templates/js/edit-textbook.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: cms/templates/js/section-name-edit.underscore +#: cms/templates/js/xblock-string-field-editor.underscore +#: lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore +msgid "Cancel" +msgstr "Ȼɐnɔǝl" + +#: cms/templates/js/asset-library.underscore +#: cms/templates/js/basic-modal.underscore +#: lms/templates/instructor/instructor_dashboard_2/enrollment-code-lookup-links.underscore +msgid "Actions" +msgstr "Ⱥɔʇᴉøns" + +#: cms/templates/js/certificate-editor.underscore +#: cms/templates/js/group-configuration-editor.underscore +#: lms/templates/commerce/receipt.underscore +#: lms/templates/verify_student/payment_confirmation_step.underscore +msgid "Description" +msgstr "Đǝsɔɹᴉdʇᴉøn" diff --git a/tests/data/mock-django-app/locale/mock/LC_MESSAGES/wiki.po b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/wiki.po new file mode 100644 index 0000000..2087c09 --- /dev/null +++ b/tests/data/mock-django-app/locale/mock/LC_MESSAGES/wiki.po @@ -0,0 +1,43 @@ +# edX translation file +# Copyright (C) 2015 edX +# This file is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE. +# EdX Team , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.1a\n" +"Report-Msgid-Bugs-To: openedx-translation@googlegroups.com\n" +"POT-Creation-Date: 2015-06-15 20:15+0000\n" +"PO-Revision-Date: 2015-06-15 20:15:26.401374\n" +"Last-Translator: \n" +"Language-Team: openedx-translation \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: wiki/admin.py wiki/models/article.py +msgid "created" +msgstr "ɔɹǝɐʇǝd" + +#: wiki/forms.py +msgid "Only localhost... muahahaha" +msgstr "Ønlʎ løɔɐlɥøsʇ... ɯnɐɥɐɥɐɥɐ" + +#: wiki/forms.py wiki/forms.py wiki/forms.py +msgid "Title" +msgstr "Ŧᴉʇlǝ" + +#: wiki/forms.py +msgid "Initial title of the article. May be overridden with revision titles." +msgstr "Ɨnᴉʇᴉɐl ʇᴉʇlǝ øɟ ʇɥǝ ɐɹʇᴉɔlǝ. Mɐʎ bǝ øʌǝɹɹᴉddǝn ʍᴉʇɥ ɹǝʌᴉsᴉøn ʇᴉʇlǝs." + +#: wiki/forms.py +msgid "Type in some contents" +msgstr "Ŧʎdǝ ᴉn søɯǝ ɔønʇǝnʇs" + +#: wiki/forms.py +msgid "Problem" +msgstr "Ṗṛöḅḷëṁ" diff --git a/tests/test_changed.py b/tests/test_changed.py index e5bb4b4..b373b91 100644 --- a/tests/test_changed.py +++ b/tests/test_changed.py @@ -1,14 +1,15 @@ from os import remove from shutil import copyfile -from unittest import TestCase import ddt import mock from i18n.changed import Changed +from . import I18nToolTestCase, MOCK_APPLICATION_DIR + @ddt.ddt -class TestChanged(TestCase): +class TestChanged(I18nToolTestCase): """ Tests functionality of i18n/changed.py """ @@ -19,8 +20,9 @@ def test_detect_changes(self): """ Verifies the detect_changes method can detect changes in translation source files. """ - file_name = 'conf/locale/fake2/LC_MESSAGES/mako.po' - copy = 'conf/locale/fake2/LC_MESSAGES/mako_copy.po' + fake_locale_dir = MOCK_APPLICATION_DIR / 'conf' / 'locale' / 'mock' + file_name = fake_locale_dir / 'LC_MESSAGES' / 'mako.po' + copy = fake_locale_dir / 'LC_MESSAGES' / 'mako_copy.po' self.assertFalse(self.changed.detect_changes()) diff --git a/tests/test_compiled_messages.py b/tests/test_compiled_messages.py deleted file mode 100644 index bc4e03d..0000000 --- a/tests/test_compiled_messages.py +++ /dev/null @@ -1,59 +0,0 @@ -""" -Test that the compiled .mo files match the translations in the -uncompiled .po files. - -This is required because we are checking in the .mo files into -the repo, but compiling them is a manual process. We want to make -sure that we find out if someone forgets the compilation step. -""" - -import ddt -import polib -from unittest import TestCase - -from i18n.config import CONFIGURATION, LOCALE_DIR - - -@ddt.ddt -class TestCompiledMessages(TestCase): - """ - Test that mo files match their source po files - """ - - PO_FILES = ['django.po', 'djangojs.po'] - - @ddt.data(*CONFIGURATION.translated_locales) - def test_translated_messages(self, locale): - message_dir = LOCALE_DIR / locale / 'LC_MESSAGES' - for pofile_name in self.PO_FILES: - pofile_path = message_dir / pofile_name - pofile = polib.pofile(pofile_path) - mofile = polib.mofile(pofile_path.stripext() + '.mo') - - po_entries = {entry.msgid: entry for entry in pofile.translated_entries()} - mo_entries = {entry.msgid: entry for entry in mofile.translated_entries()} - - # Check that there are no entries in po that aren't in mo, and vice-versa - self.assertEquals(po_entries.viewkeys(), mo_entries.viewkeys()) - - for entry_id, po_entry in po_entries.items(): - mo_entry = mo_entries[entry_id] - for attr in ('msgstr', 'msgid_plural', 'msgstr_plural', 'msgctxt', 'obsolete', 'encoding'): - po_attr = getattr(po_entry, attr) - mo_attr = getattr(mo_entry, attr) - - # The msgstr_plural in the mo_file is keyed on ints, but in the po_file it's - # keyed on strings. This normalizes them. - if attr == 'msgstr_plural': - po_attr = {int(key): val for (key, val) in po_attr.items()} - - self.assertEquals( - po_attr, - mo_attr, - "When comparing {} for entry {!r}, {!r} from the .po file doesn't match {!r} from the .mo file".format( - attr, - entry_id, - po_attr, - mo_attr, - ) - ) diff --git a/tests/test_config.py b/tests/test_config.py index 7f2e3aa..586a589 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,10 +1,17 @@ +""" +Unit tests for i18n configuration handling. +""" + +import ddt import os -from unittest import TestCase from i18n import config +from . import I18nToolTestCase, MOCK_APPLICATION_DIR, MOCK_DJANGO_APP_DIR + -class TestConfiguration(TestCase): +@ddt.ddt +class TestConfiguration(I18nToolTestCase): """ Tests functionality of i18n/config.py """ @@ -15,38 +22,42 @@ def test_config(self): self.assertEqual(cfg.source_locale, 'en') def test_no_config(self): - config_filename = os.path.normpath(os.path.join(config.LOCALE_DIR, 'no_such_file')) + config_filename = os.path.normpath(os.path.join(config.BASE_DIR, 'no_such_file')) with self.assertRaises(Exception): config.Configuration(config_filename) - def test_default_configuration(self): + @ddt.data( + MOCK_APPLICATION_DIR, + MOCK_DJANGO_APP_DIR, + ) + def test_default_configuration(self, root_dir): """ Make sure we have a valid defaults in the configuration file: that it contains an 'en' locale, has values for dummy_locale, source_locale, and others. """ - config.CONFIGURATION = config.Configuration() - self.assertIsNotNone(config.CONFIGURATION) + test_configuration = config.Configuration(root_dir=root_dir) + self.assertIsNotNone(test_configuration) # these will just be defaults - locales = config.CONFIGURATION.locales + locales = test_configuration.locales self.assertIsNotNone(locales) self.assertIsInstance(locales, list) self.assertEqual( 'https://www.transifex.com/open-edx/edx-platform/', - config.CONFIGURATION.TRANSIFEX_URL + test_configuration.TRANSIFEX_URL ) def test_configuration_overrides(self): # Test overriding the default configuration, and that overrides # values are recognized config_filename = os.path.normpath(os.path.join('tests', 'data', 'config.yaml')) - config.CONFIGURATION = config.Configuration(config_filename) - locales = config.CONFIGURATION.locales + test_configuration = config.Configuration(config_filename) + locales = test_configuration.locales self.assertIn('ar', locales) - self.assertEqual('eo', config.CONFIGURATION.dummy_locales[0]) - self.assertEqual('en', config.CONFIGURATION.source_locale) + self.assertEqual('eo', test_configuration.dummy_locales[0]) + self.assertEqual('en', test_configuration.source_locale) self.assertEqual( 'https://www.transifex.com/open-edx-releases/cypress-release/', - config.CONFIGURATION.TRANSIFEX_URL + test_configuration.TRANSIFEX_URL ) diff --git a/tests/test_converter.py b/tests/test_converter.py index e302d99..3f398dc 100644 --- a/tests/test_converter.py +++ b/tests/test_converter.py @@ -1,11 +1,11 @@ """Tests of i18n/converter.py""" -from unittest import TestCase - import ddt from i18n import converter +from . import I18nToolTestCase + class UpcaseConverter(converter.Converter): """ @@ -16,7 +16,7 @@ def inner_convert_string(self, string): @ddt.ddt -class TestConverter(TestCase): +class TestConverter(I18nToolTestCase): """ Tests functionality of i18n/converter.py """ diff --git a/tests/test_dummy.py b/tests/test_dummy.py index 2cd8925..6be7ae6 100644 --- a/tests/test_dummy.py +++ b/tests/test_dummy.py @@ -1,16 +1,16 @@ # -*- coding: utf-8 -*- """Tests of i18n/dummy.py""" -from unittest import TestCase - import ddt from polib import POEntry from i18n import dummy +from . import I18nToolTestCase + @ddt.ddt -class TestDummy(TestCase): +class TestDummy(I18nToolTestCase): """ Tests functionality of i18n/dummy.py """ diff --git a/tests/test_extract.py b/tests/test_extract.py index 8ac0214..4882ca6 100644 --- a/tests/test_extract.py +++ b/tests/test_extract.py @@ -1,12 +1,13 @@ from datetime import datetime, timedelta import os -from unittest import TestCase, skip +from unittest import skip import polib from pytz import UTC from i18n import extract -from i18n.config import CONFIGURATION + +from . import I18nToolTestCase # Make sure setup runs only once SETUP_HAS_RUN = False @@ -16,7 +17,7 @@ # TODO: figure out how to declare a "long-running" test suite # and add this test to it. @skip('Long running test') -class TestExtract(TestCase): +class TestExtract(I18nToolTestCase): """ Tests functionality of i18n/extract.py """ @@ -41,7 +42,7 @@ def get_files(self): Fails assertion if one of the files doesn't exist. """ for filename in self.generated_files: - path = os.path.join(CONFIGURATION.source_messages_dir, filename) + path = os.path.join(self.configuration.source_messages_dir, filename) exists = os.path.exists(path) self.assertTrue(exists, msg='Missing file: %s' % filename) if exists: diff --git a/tests/test_generate.py b/tests/test_generate.py index 52c565f..571c2bb 100644 --- a/tests/test_generate.py +++ b/tests/test_generate.py @@ -8,17 +8,17 @@ import sys import string import subprocess -from unittest import TestCase from mock import patch from polib import pofile from pytz import UTC -from i18n import generate -from i18n.config import CONFIGURATION +from i18n import config, generate +from . import I18nToolTestCase, MOCK_APPLICATION_DIR, MOCK_DJANGO_APP_DIR -class TestGenerate(TestCase): + +class TestGenerate(I18nToolTestCase): """ Tests functionality of i18n/generate.py """ @@ -27,8 +27,11 @@ class TestGenerate(TestCase): # some concurrency issues. If this fails, you can try rerunning the tests. @classmethod def tearDownClass(cls): - # Clear the fake2 directory of any test artifacts - cmd = "rm conf/locale/fake2/LC_MESSAGES/django.po; rm conf/locale/fake2/LC_MESSAGES/djangojs.po" + # Clear the mock locale directory of any test artifacts + fake_locale_dir = MOCK_APPLICATION_DIR / 'conf' / 'locale' / 'mock' + cmd = "rm {fake_locale_dir}/LC_MESSAGES/django.po; rm {fake_locale_dir}/LC_MESSAGES/djangojs.po".format( + fake_locale_dir=fake_locale_dir + ) sys.stderr.write("\nCleaning up dummy language directories: {}\n".format(cmd)) sys.stderr.flush() returncode = subprocess.call(cmd, shell=True) @@ -36,24 +39,22 @@ def tearDownClass(cls): super(TestGenerate, cls).tearDownClass() def setUp(self): + super(TestGenerate, self).setUp() # Subtract 1 second to help comparisons with file-modify time succeed, # since os.path.getmtime() is not millisecond-accurate self.start_time = datetime.now(UTC) - timedelta(seconds=1) - # Patch source_language to be the fake files we already have - @patch.object(CONFIGURATION, 'source_locale', 'fake2') def test_merge(self): """ Tests merge script on English source files. """ - filename = os.path.join(CONFIGURATION.source_messages_dir, random_name()) - generate.merge(CONFIGURATION.source_locale, target=filename) + test_configuration = config.Configuration(root_dir=MOCK_DJANGO_APP_DIR) + filename = os.path.join(test_configuration.source_messages_dir, random_name()) + generate.merge(test_configuration, test_configuration.source_locale, target=filename) self.assertTrue(os.path.exists(filename)) os.remove(filename) # Patch dummy_locales to not have esperanto present - @patch.object(CONFIGURATION, 'locales', ['fake2']) - @patch.object(CONFIGURATION, 'source_locale', 'en') def test_main(self): """ Runs generate.main() which should merge source files, @@ -62,19 +63,19 @@ def test_main(self): .mo files should exist, and be recently created (modified after start of test suite) """ - generate.main(verbose=0, strict=False) - for locale in CONFIGURATION.translated_locales: + generate.main(verbose=0, strict=False, root_dir=MOCK_APPLICATION_DIR) + for locale in ['mock',]: for (filename, num_headers) in zip(('django', 'djangojs'), (6, 4)): mofile = filename + '.mo' - file_path = os.path.join(CONFIGURATION.get_messages_dir(locale), mofile) + file_path = os.path.join(self.configuration.get_messages_dir(locale), mofile) exists = os.path.exists(file_path) self.assertTrue(exists, msg='Missing file in locale %s: %s' % (locale, mofile)) self.assertTrue( datetime.fromtimestamp(os.path.getmtime(file_path), UTC) >= self.start_time, - msg='File not recently modified: %s' % file_path + msg='File should be recently modified: %s' % file_path ) # Assert merge headers look right - file_path = os.path.join(CONFIGURATION.get_messages_dir(locale), filename + '.po') + file_path = os.path.join(self.configuration.get_messages_dir(locale), filename + '.po') self.assert_merge_headers(file_path, num_headers) def assert_merge_headers(self, file_path, num_headers): @@ -99,10 +100,10 @@ def assert_merge_headers(self, file_path, num_headers): @patch('i18n.generate.LOG') def test_resolve_merge_conflicts(self, mock_log): - django_po_path = os.path.join(CONFIGURATION.get_messages_dir('fake2'), 'django.po') + django_po_path = os.path.join(self.configuration.get_messages_dir('mock'), 'django.po') # File ought to have been generated in test_main # if not os.path.exists(django_po_path): - generate.main(verbose=0, strict=False) + generate.main(verbose=0, strict=False, root_dir=MOCK_APPLICATION_DIR) with open(django_po_path, 'r') as django_po_file: po_lines = django_po_file.read() diff --git a/tests/test_segment.py b/tests/test_segment.py index bf7331a..ff75fac 100644 --- a/tests/test_segment.py +++ b/tests/test_segment.py @@ -2,23 +2,25 @@ import os.path import shutil -import unittest from path import Path import polib from i18n.segment import segment_pofile +from . import I18nToolTestCase + HERE = Path(__file__).dirname() TEST_DATA = HERE / "data" WORK = HERE / "work" -class SegmentTest(unittest.TestCase): +class SegmentTest(I18nToolTestCase): """Test segment_pofile.""" def setUp(self): + super(SegmentTest, self).setUp() if not os.path.exists(WORK): os.mkdir(WORK) self.addCleanup(shutil.rmtree, WORK) diff --git a/tests/test_transifex.py b/tests/test_transifex.py index b388143..0982a3e 100644 --- a/tests/test_transifex.py +++ b/tests/test_transifex.py @@ -2,19 +2,21 @@ This test tests that calls to Transifex work as expected. """ -from unittest import TestCase - import mock from i18n import transifex +from . import I18nToolTestCase + -class TestTransifex(TestCase): +class TestTransifex(I18nToolTestCase): """ Tests functionality of i18n/transifex.py because Ned is making me write tests. """ + def setUp(self): + super(TestTransifex, self).setUp() self.patcher = mock.patch('i18n.transifex.execute') self.addCleanup(self.patcher.stop) self.mock_execute = self.patcher.start() @@ -53,7 +55,7 @@ def test_push_all_command(self): def test_pull_command(self): # Call the pull command - transifex.pull() + transifex.pull(self.configuration) # conf/locale/config.yaml specifies two non-source locales, 'fr' and 'zh_CN' call_args = [ @@ -67,7 +69,7 @@ def test_pull_command(self): def test_pull_command_with_resources(self): # Call the pull command - transifex.pull("foo.1", "foo.2") + transifex.pull(self.configuration, "foo.1", "foo.2") # conf/locale/config.yaml specifies two non-source locales, 'fr' and 'zh_CN' call_args = [ @@ -83,9 +85,12 @@ def test_pull_command_with_resources(self): def test_clean_translated_locales(self): with mock.patch('i18n.transifex.clean_locale') as patched: - transifex.clean_translated_locales(langs=['fr', 'zh_CN']) + transifex.clean_translated_locales(self.configuration, langs=['fr', 'zh_CN']) self.assertEqual(2, patched.call_count) - call_args = [('fr',), ('zh_CN',)] + call_args = [ + (self.configuration, 'fr'), + (self.configuration, 'zh_CN'), + ] self.assertEqual( call_args, [callarg[0] for callarg in patched.call_args_list] @@ -93,11 +98,11 @@ def test_clean_translated_locales(self): def test_clean_locale(self): with mock.patch('i18n.transifex.clean_file') as patched: - transifex.clean_locale('fr') + transifex.clean_locale(self.configuration, 'fr') self.assertEqual(3, patched.call_count) call_args = ['django-partial.po', 'djangojs-partial.po', 'mako.po'] for callarg, expected in zip(patched.call_args_list, call_args): self.assertEqual( - callarg[0][0].name, + callarg[0][1].name, expected ) diff --git a/tests/test_validate.py b/tests/test_validate.py index 34935d1..8cc2458 100644 --- a/tests/test_validate.py +++ b/tests/test_validate.py @@ -5,12 +5,13 @@ import os import textwrap -from unittest import TestCase from path import Path from i18n import validate +from . import I18nToolTestCase + HERE = Path(__file__).dirname() TEST_DATA = HERE / "data" @@ -56,7 +57,7 @@ ] -class TestValidate(TestCase): +class TestValidate(I18nToolTestCase): """ Tests functionality in i18n/validate.py, because if Sarina weren't quitting, she'd be making me write tests.