diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 19:26:36 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 19:26:36 +0000 |
commit | aff5eec98954766821f46a7e9fab07b7007f0319 (patch) | |
tree | f1f93210978317adc3ca097e49486cf79035c389 /chrome/browser/cocoa/ui_localizer.mm | |
parent | 086eaec4d8ed6b6207925253f17fdabef82a0ed7 (diff) | |
download | chromium_src-aff5eec98954766821f46a7e9fab07b7007f0319.zip chromium_src-aff5eec98954766821f46a7e9fab07b7007f0319.tar.gz chromium_src-aff5eec98954766821f46a7e9fab07b7007f0319.tar.bz2 |
Move some Mac l10n helpers out into app/l10n so they are closer to the generic ones.
Complete the apis points so the ones folks might need are all there already.
Switch the code using the old calls over to the new helpers.
TEST=no l10n stuff broke
BUG=none
Review URL: http://codereview.chromium.org/165132
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/ui_localizer.mm')
-rw-r--r-- | chrome/browser/cocoa/ui_localizer.mm | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/chrome/browser/cocoa/ui_localizer.mm b/chrome/browser/cocoa/ui_localizer.mm index 5467203..7fd4d44 100644 --- a/chrome/browser/cocoa/ui_localizer.mm +++ b/chrome/browser/cocoa/ui_localizer.mm @@ -6,36 +6,12 @@ #import <Foundation/Foundation.h> -#include "app/l10n_util.h" +#include "app/l10n_util_mac.h" #include "base/sys_string_conversions.h" #include "base/logging.h" namespace ui_localizer { -NSString* FixUpWindowsStyleLabel(const string16& label) { - const char16 kEllipsisUTF16 = 0x2026; - string16 ret; - size_t label_len = label.length(); - ret.reserve(label_len); - for (size_t i = 0; i < label_len; ++i) { - char16 c = label[i]; - if (c == '&') { - if (i + 1 < label_len && label[i + 1] == '&') { - ret.push_back(c); - ++i; - } - } else if (c == '.' && i + 2 < label_len && label[i + 1] == '.' - && label[i + 2] == '.') { - ret.push_back(kEllipsisUTF16); - i += 2; - } else { - ret.push_back(c); - } - } - - return base::SysUTF16ToNSString(ret); -} - NSString* LocalizedStringForKeyFromMapList(NSString* key, const ResourceMap* map_list, size_t map_list_len) { @@ -54,12 +30,11 @@ NSString* LocalizedStringForKeyFromMapList(NSString* key, if (map_list[i].label_arg_id != 0) { const string16 label_arg( l10n_util::GetStringUTF16(map_list[i].label_arg_id)); - return FixUpWindowsStyleLabel( - l10n_util::GetStringFUTF16(map_list[i].label_id, label_arg)); + return l10n_util::GetNSStringFWithFixup(map_list[i].label_id, + label_arg); } - return FixUpWindowsStyleLabel( - l10n_util::GetStringUTF16(map_list[i].label_id)); + return l10n_util::GetNSStringWithFixup(map_list[i].label_id); } // If we've passed where the string would be, give up. |