Skip to content

Commit

Permalink
sync locales pak files
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoweb committed Nov 1, 2015
1 parent 42ad7ac commit 651a0a8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,7 @@ protected void showSingleOriginSettings(String url) {
protected void initializeLibraryDependencies() {
// The ResourceExtractor is only needed by the browser process, but this will have no
// impact on the renderer process construction.
// TODO:(alex)
// ResourceBundle.initializeLocalePaks(this, R.array.locale_paks);
ResourceBundle.initializeLocalePaks(this, R.array.locale_paks);
if (!BuildInfo.hasLanguageApkSplits(this)) {
ResourceExtractor.setResourcesToExtract(ResourceBundle.getActiveLocaleResources());
}
Expand Down
Binary file added app/src/main/res/assets/locales/en-US.pak
Binary file not shown.
Binary file added app/src/main/res/assets/locales/zh-CN.pak
Binary file not shown.
11 changes: 11 additions & 0 deletions libraries/chrome_res/src/main/res/values/locales.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="locales_en_us">locales/en-US.pak</string>
<string name="locales_zh_cn">locales/zh-CN.pak</string>

<!-- for locales pak -->
<array name="locale_paks">
<item>@string/locales_en_us</item>
<item>@string/locales_zh_cn</item>
</array>
</resources>
8 changes: 8 additions & 0 deletions script/sync_chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,15 @@ def sync_manifest_files(options):
policy_gen_dir = os.path.join(options.chromium_root, "out", options.buildtype,
"gen", "policy")
args = {'only': ['\S+\\.xml']}
# TODO(alex)
# sync(policy_gen_dir, xml_dir, "sync", **args)

def sync_data_files(options):
locales_dir = os.path.join(constants.DIR_APP_ROOT, "src", "main", "res", "assets", "locales")
pak_gen_dir = os.path.join(options.chromium_root, "out", options.buildtype, "locales")
args = {'only': ['en-US.pak', 'zh-CN.pak']}
sync(pak_gen_dir, locales_dir, "sync", **args)

def main(argv):
parser = optparse.OptionParser(usage='Usage: %prog [options]', description=__doc__)
parser.add_option('--chromium_root',
Expand All @@ -149,6 +156,7 @@ def main(argv):
sync_datausagechart_res_files(options)
sync_androidmedia_res_files(options)
sync_manifest_files(options)
sync_data_files(options)

if __name__ == '__main__':
main(sys.argv)

0 comments on commit 651a0a8

Please sign in to comment.