Bug 1413985 - Package .ftl files on repackage for both, source and AB_CD locales. r?glandium
When repackaging, we want to take all localization resources from the source package,
and add all localization resources from the repackage target locale.
This patch makes packager.l10n scan for `localization` directories in l10n_finder and
add them.
MozReview-Commit-ID: CRLP3bOAyDx
--- a/python/mozbuild/mozpack/packager/l10n.py
+++ b/python/mozbuild/mozpack/packager/l10n.py
@@ -211,16 +211,22 @@ def _repack(app_finder, l10n_finder, cop
# Add any remaining non chrome files.
for pattern in non_chrome:
for base in bases:
for p, f in l10n_finder.find(mozpath.join(base, pattern)):
if not formatter.contains(p):
formatter.add(p, f)
+ # Resources in `localization` directories are packaged from the source and then
+ # if localized versions are present in the l10n dir, we package them as well
+ # keeping the source dir resources as a runtime fallback.
+ for p, f in l10n_finder.find('**/localization'):
+ formatter.add(p, f)
+
# Transplant jar preloading information.
for path, log in app_finder.jarlogs.iteritems():
assert isinstance(copier[path], Jarrer)
copier[path].preload([l.replace(locale, l10n_locale) for l in log])
def repack(source, l10n, extra_l10n={}, non_resources=[], non_chrome=set()):
'''