diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 21:31:57 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 21:31:57 +0000 |
commit | 464dca7a6ff0f7649ec54fcac964306d07499c30 (patch) | |
tree | 4dff0db9ea97395c0e0db6a594f2c5ddf08ae5f2 /chrome/tools/mac_helpers | |
parent | e984058bf2de1d110a3ecca1c9b6a77e3f297704 (diff) | |
download | chromium_src-464dca7a6ff0f7649ec54fcac964306d07499c30.zip chromium_src-464dca7a6ff0f7649ec54fcac964306d07499c30.tar.gz chromium_src-464dca7a6ff0f7649ec54fcac964306d07499c30.tar.bz2 |
Even though the Finder's Get Info shows the language correctly when you use lproj folders with '-' instead of '_', Cocoa fails to load things at runtime from within them.
Map the names when writing lproj folders to use underscore.
Put an option on the helper script to control dash/underscore mapping since we need support for both.
TEST=try chinese and traditional chinese, they work now.
BUG=20441
Review URL: http://codereview.chromium.org/187011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25243 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools/mac_helpers')
-rw-r--r-- | chrome/tools/mac_helpers/infoplist_strings_util.mm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/tools/mac_helpers/infoplist_strings_util.mm b/chrome/tools/mac_helpers/infoplist_strings_util.mm index 70fbca6..f2bbf7a 100644 --- a/chrome/tools/mac_helpers/infoplist_strings_util.mm +++ b/chrome/tools/mac_helpers/infoplist_strings_util.mm @@ -267,10 +267,14 @@ int main(int argc, char* const argv[]) { } // 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:@"_"]; NSString *output_path = [[NSString stringWithUTF8String:output_dir] - stringByAppendingPathComponent: - [NSString stringWithFormat:@"%s.lproj", cur_lang]]; + stringByAppendingPathComponent:lproj_name]; NSError* error = nil; if (![fm fileExistsAtPath:output_path] && ![fm createDirectoryAtPath:output_path |