summaryrefslogtreecommitdiffstats
path: root/chrome/tools
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 14:42:19 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 14:42:19 +0000
commite2260edd7101ad9748831e1414db1289dd911009 (patch)
treeaad166db112052be232ad53c9c9bdb8ae9b7f6b3 /chrome/tools
parentc710a5649efa1c8d33f4c2ecc52d7e9300a37fe2 (diff)
downloadchromium_src-e2260edd7101ad9748831e1414db1289dd911009.zip
chromium_src-e2260edd7101ad9748831e1414db1289dd911009.tar.gz
chromium_src-e2260edd7101ad9748831e1414db1289dd911009.tar.bz2
EN, mf, DO YOU SPEAK IT?
No more symbolic links in the .app. Except for the ones that codesign adds. The en_US.lproj directory should not exist, there should be only en.lproj. Formerly, there was a symbolic link from en.lproj to en_US.lproj. BUG=25578, 19165 TEST= - find C.app -name en_US.lproj should return nothing. - find C.app -name en.lproj should show en.lproj in C.app, C F.framework, and C H.app. - find C.app -type l should return nothing, however, on a signed build, it will still show symbolic links for CodeResources. - Say "What" again. Say "What" again. I dare you. I double-dare you. - With English or U.S. English as the top or only choices in the International (10.5) or Language & Text (10.6) system preference pane's Language tab, the localized language should be English. - In this configuration, the Accept-Language header field should be "en-US,en;q=0.8". See http://whatsmyuseragent.com/ and look for HTTP_ACCEPT_LANGUAGE. Review URL: http://codereview.chromium.org/345057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30955 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rwxr-xr-xchrome/tools/build/apply_locales.py8
-rwxr-xr-xchrome/tools/build/mac/symlink_lprojs28
-rwxr-xr-xchrome/tools/build/mac/transition_lprojs22
-rwxr-xr-xchrome/tools/build/repack_locales.py5
-rw-r--r--chrome/tools/mac_helpers/infoplist_strings_util.mm15
5 files changed, 42 insertions, 36 deletions
diff --git a/chrome/tools/build/apply_locales.py b/chrome/tools/build/apply_locales.py
index fc8c4af..6af7280 100755
--- a/chrome/tools/build/apply_locales.py
+++ b/chrome/tools/build/apply_locales.py
@@ -14,7 +14,8 @@ def main(argv):
usage = 'usage: %s [options ...] format_string locale_list'
parser.set_usage(usage.replace('%s', '%prog'))
parser.add_option('-d', dest='dash_to_underscore', action="store_true",
- default=False, help='map "-" to "_" in locales')
+ default=False,
+ help='map "en-US" to "en" and "-" to "_" in locales')
(options, arglist) = parser.parse_args(argv)
@@ -28,8 +29,11 @@ def main(argv):
results = []
for locale in locales:
# For Cocoa to find the locale at runtime, it needs to use '_' instead
- # of '-'. (http://crbug.com/20441)
+ # of '-' (http://crbug.com/20441). Also, 'en-US' should be represented
+ # simply as 'en' (http://crbug.com/19165, http://crbug.com/25578).
if options.dash_to_underscore:
+ if locale == 'en-US':
+ locale = 'en'
locale = locale.replace('-', '_')
results.append(str_template.replace('ZZLOCALE', locale))
diff --git a/chrome/tools/build/mac/symlink_lprojs b/chrome/tools/build/mac/symlink_lprojs
deleted file mode 100755
index 6fffcdf..0000000
--- a/chrome/tools/build/mac/symlink_lprojs
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script is intended to run from a "postbuild" action from within Xcode.
-# It will create any symlinks needed to sync up what comes from the GRIT files
-# with what Cocoa would like.
-
-set -e
-
-# Working in the resources directory
-cd "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources"
-
-# Provide an link for en.lproj that points to en_US.lproj.
-
-# The standard OS language list includes English (en) and not a specific
-# "flavor" such as U.S. English (en_US). When checking for a language match,
-# the OS will remove subtags if no exact match is found, so that en will be
-# used if the user's preferred language list only contains British English
-# (en_GB) and no specific en_GB translation is available.
-#
-# To ensure that users with the default language list, which contains English
-# without any regional subtag, as well as users with a specific variant of
-# English with a regional subtag, will have access to an English-localized
-# application, a symbolic link from en.lproj to en_US.lproj is provided.
-ln -fhs "en_US.lproj" "en.lproj"
diff --git a/chrome/tools/build/mac/transition_lprojs b/chrome/tools/build/mac/transition_lprojs
new file mode 100755
index 0000000..40ccb44
--- /dev/null
+++ b/chrome/tools/build/mac/transition_lprojs
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Clean up the old .lproj structure, where English was in en_US.lproj, and
+# en.lproj was a symbolic link.
+#
+# TODO(mark): Remove after November 17, 2009, allowing two weeks for the
+# transition.
+
+RESOURCES_DIR="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources"
+
+# Always dump en_US.lproj.
+rm -rf "${RESOURCES_DIR}/en_US.lproj"
+
+# Only dump en.lproj if it's a symbolic link. If it's a directory, then the
+# transition has already been performed.
+if [ -L "${RESOURCES_DIR}/en.lproj" ] ; then
+ rm -f "${RESOURCES_DIR}/en.lproj"
+fi
diff --git a/chrome/tools/build/repack_locales.py b/chrome/tools/build/repack_locales.py
index fc55b2d..8124c38 100755
--- a/chrome/tools/build/repack_locales.py
+++ b/chrome/tools/build/repack_locales.py
@@ -37,7 +37,10 @@ def calc_output(locale):
#e.g. '<(INTERMEDIATE_DIR)/repack/da.pak',
if sys.platform in ('darwin',):
# For Cocoa to find the locale at runtime, it needs to use '_' instead
- # of '-'. (http://crbug.com/20441)
+ # of '-' (http://crbug.com/20441). Also, 'en-US' should be represented
+ # simply as 'en' (http://crbug.com/19165, http://crbug.com/25578).
+ if locale == 'en-US':
+ locale = 'en'
return '%s/repack/%s.lproj/locale.pak' % (INT_DIR, locale.replace('-', '_'))
else:
return '%s/repack/%s.pak' % (INT_DIR, locale)
diff --git a/chrome/tools/mac_helpers/infoplist_strings_util.mm b/chrome/tools/mac_helpers/infoplist_strings_util.mm
index d5249bf..474e587 100644
--- a/chrome/tools/mac_helpers/infoplist_strings_util.mm
+++ b/chrome/tools/mac_helpers/infoplist_strings_util.mm
@@ -266,12 +266,17 @@ int main(int argc, char* const argv[]) {
exit(1);
}
- // Make sure the lproj we write to exists
- NSString *lproj_name = [NSString stringWithFormat:@"%s.lproj", cur_lang];
// For Cocoa to find the locale at runtime, it needs to use '_' instead of
- // '-'. (http://crbug.com/20441)
- lproj_name = [lproj_name stringByReplacingOccurrencesOfString:@"-"
- withString:@"_"];
+ // '-' (http://crbug.com/20441). Also, 'en-US' should be represented
+ // simply as 'en' (http://crbug.com/19165, http://crbug.com/25578).
+ NSString* cur_lang_ns = [NSString stringWithUTF8String:cur_lang];
+ if ([cur_lang_ns isEqualToString:@"en-US"]) {
+ cur_lang_ns = @"en";
+ }
+ cur_lang_ns = [cur_lang_ns stringByReplacingOccurrencesOfString:@"-"
+ withString:@"_"];
+ // Make sure the lproj we write to exists
+ NSString *lproj_name = [NSString stringWithFormat:@"%@.lproj", cur_lang_ns];
NSString *output_path =
[[NSString stringWithUTF8String:output_dir]
stringByAppendingPathComponent:lproj_name];