Fixed #1771: automated .mo building doesn't work properly with template translation: sphinx-build will load sphinx.mo file to initialize template-bridge before compiling sphinx.po file.

This commit is contained in:
shimizukawa
2015-03-16 23:01:16 +09:00
parent ef3a1f7b2e
commit 30d6d72f47
5 changed files with 38 additions and 12 deletions

View File

@@ -55,10 +55,13 @@ def test_compile_all_catalogs(app, status, warning):
@with_app(buildername='html', testroot='intl',
confoverrides={'language': 'en', 'locale_dirs': [locale_dir]})
def test_compile_specific_catalogs(app, status, warning):
app.builder.compile_specific_catalogs(['admonitions'])
catalog_dir = locale_dir / app.config.language / 'LC_MESSAGES'
actual = set(find_files(catalog_dir, '.mo'))
def get_actual():
return set(find_files(catalog_dir, '.mo'))
actual_on_boot = get_actual() # sphinx.mo might be included
app.builder.compile_specific_catalogs(['admonitions'])
actual = get_actual() - actual_on_boot
assert actual == set(['admonitions.mo'])

View File

@@ -77,8 +77,8 @@ def test_get_catalogs_for_xx(dir):
assert domains == set([
'test1',
'test2',
path.normpath('sub/test4'),
path.normpath('sub/test5'),
'sub/test4',
'sub/test5',
])
@@ -131,8 +131,8 @@ def test_get_catalogs_for_xx_without_outdated(dir):
assert domains == set([
'test1',
'test2',
path.normpath('sub/test4'),
path.normpath('sub/test5'),
'sub/test4',
'sub/test5',
])