| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//remoting/remoting_locales.gni") |
| 5 import("//tools/grit/grit_rule.gni") | 6 import("//tools/grit/grit_rule.gni") |
| 6 | 7 |
| 7 # See also remoting_locales_with_underscores below. | |
| 8 remoting_locales = [ | |
| 9 "am", | |
| 10 "ar", | |
| 11 "bg", | |
| 12 "bn", | |
| 13 "ca", | |
| 14 "cs", | |
| 15 "da", | |
| 16 "de", | |
| 17 "el", | |
| 18 "en", | |
| 19 "en-GB", | |
| 20 "es", | |
| 21 "es-419", | |
| 22 "et", | |
| 23 "fa", | |
| 24 "fake-bidi", | |
| 25 "fi", | |
| 26 "fil", | |
| 27 "fr", | |
| 28 "gu", | |
| 29 "he", | |
| 30 "hi", | |
| 31 "hr", | |
| 32 "hu", | |
| 33 "id", | |
| 34 "it", | |
| 35 "ja", | |
| 36 "kn", | |
| 37 "ko", | |
| 38 "lt", | |
| 39 "lv", | |
| 40 "ml", | |
| 41 "mr", | |
| 42 "ms", | |
| 43 "nb", | |
| 44 "nl", | |
| 45 "pl", | |
| 46 "pt-BR", | |
| 47 "pt-PT", | |
| 48 "ro", | |
| 49 "ru", | |
| 50 "sk", | |
| 51 "sl", | |
| 52 "sr", | |
| 53 "sv", | |
| 54 "sw", | |
| 55 "ta", | |
| 56 "te", | |
| 57 "th", | |
| 58 "tr", | |
| 59 "uk", | |
| 60 "vi", | |
| 61 "zh-CN", | |
| 62 "zh-TW", | |
| 63 ] | |
| 64 | |
| 65 # Some locales have hyphens in the names but for some uses underscores are | |
| 66 # needed. | |
| 67 remoting_locales_with_underscores = remoting_locales | |
| 68 remoting_locales_with_underscores -= [ | |
| 69 "en-GB", | |
| 70 "es-419", | |
| 71 "fake-bidi", | |
| 72 "pt-BR", | |
| 73 "pt-PT", | |
| 74 "zh-CN", | |
| 75 "zh-TW", | |
| 76 ] | |
| 77 remoting_locales_with_underscores += [ | |
| 78 "en_GB", | |
| 79 "es_419", | |
| 80 "fake_bidi", | |
| 81 "pt_BR", | |
| 82 "pt_PT", | |
| 83 "zh_CN", | |
| 84 "zh_TW", | |
| 85 ] | |
| 86 | |
| 87 if (is_chromeos) { | |
| 88 remoting_locales += [ "en-US" ] | |
| 89 remoting_locales_with_underscores += [ "en_US" ] | |
| 90 } | |
| 91 | |
| 92 group("resources") { | 8 group("resources") { |
| 93 deps = [ | 9 deps = [ |
| 94 ":copy_locales", | 10 ":copy_locales", |
| 95 ":strings", | 11 ":strings", |
| 96 | 12 |
| 97 #":verify_resources", TODO(GYP) enable this. | 13 #":verify_resources", TODO(GYP) enable this. |
| 98 ] | 14 ] |
| 99 } | 15 } |
| 100 | 16 |
| 101 # TODO(GYP) enable verify_resources. The bots are complaining about | 17 # TODO(GYP) enable verify_resources. The bots are complaining about |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 outputs = [ | 75 outputs = [ |
| 160 "remoting/base/string_resources.h", | 76 "remoting/base/string_resources.h", |
| 161 ] | 77 ] |
| 162 | 78 |
| 163 # The grd produces a *.pak file and a messages.json file (this one uses | 79 # The grd produces a *.pak file and a messages.json file (this one uses |
| 164 # underscores instead of hyphens) for each locale. | 80 # underscores instead of hyphens) for each locale. |
| 165 outputs += | 81 outputs += |
| 166 process_file_template(remoting_locales, | 82 process_file_template(remoting_locales, |
| 167 [ "remoting/resources/{{source_name_part}}.pak" ]) | 83 [ "remoting/resources/{{source_name_part}}.pak" ]) |
| 168 | 84 |
| 169 messages_locales = remoting_locales_with_underscores | 85 outputs += remoting_webapp_locale_files |
| 170 if (!is_chromeos) { | |
| 171 # The messages output includes a separate one for en-US that the pak ones | |
| 172 # don't have. We don't need to do this on ChromeOS since en_US is in the | |
| 173 # locales list be default there. | |
| 174 messages_locales += [ "en_US" ] | |
| 175 } | |
| 176 outputs += process_file_template( | |
| 177 messages_locales, | |
| 178 [ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ]) | |
| 179 } | 86 } |
| 180 | 87 |
| 181 action("copy_locales") { | 88 action("copy_locales") { |
| 182 script = "../tools/build/remoting_copy_locales.py" | 89 script = "../tools/build/remoting_copy_locales.py" |
| 183 | 90 |
| 184 # The gyp build calls out to Python, but the Python just computes a simple | 91 # The gyp build calls out to Python, but the Python just computes a simple |
| 185 # replacement over the locales. Here, we can do this in GN script by | 92 # replacement over the locales. Here, we can do this in GN script by |
| 186 # pretending the locale list is a list of files. The {{source_name_part}} | 93 # pretending the locale list is a list of files. The {{source_name_part}} |
| 187 # will just expand to the locale name. | 94 # will just expand to the locale name. |
| 188 inputs = process_file_template(remoting_locales, | 95 inputs = process_file_template(remoting_locales, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 207 "-g", | 114 "-g", |
| 208 rebase_path(root_gen_dir, root_build_dir), | 115 rebase_path(root_gen_dir, root_build_dir), |
| 209 "-x", | 116 "-x", |
| 210 rebase_path(root_out_dir, root_build_dir), | 117 rebase_path(root_out_dir, root_build_dir), |
| 211 ] + remoting_locales | 118 ] + remoting_locales |
| 212 | 119 |
| 213 deps = [ | 120 deps = [ |
| 214 ":strings", | 121 ":strings", |
| 215 ] | 122 ] |
| 216 } | 123 } |
| OLD | NEW |