OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
11 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
12 #include "ui/base/l10n/l10n_util_mac.h" | 12 #include "ui/base/l10n/l10n_util_mac.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 base::LazyInstance<std::string> g_overridden_locale = LAZY_INSTANCE_INITIALIZER; | 16 base::LazyInstance<std::string>::DestructorAtExit g_overridden_locale = |
| 17 LAZY_INSTANCE_INITIALIZER; |
17 | 18 |
18 } // namespace | 19 } // namespace |
19 | 20 |
20 namespace l10n_util { | 21 namespace l10n_util { |
21 | 22 |
22 const std::string& GetLocaleOverride() { | 23 const std::string& GetLocaleOverride() { |
23 return g_overridden_locale.Get(); | 24 return g_overridden_locale.Get(); |
24 } | 25 } |
25 | 26 |
26 void OverrideLocaleWithCocoaLocale() { | 27 void OverrideLocaleWithCocoaLocale() { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return FixUpWindowsStyleLabel(l10n_util::GetStringFUTF16(message_id, | 158 return FixUpWindowsStyleLabel(l10n_util::GetStringFUTF16(message_id, |
158 a, b, c, d)); | 159 a, b, c, d)); |
159 } | 160 } |
160 | 161 |
161 NSString* GetPluralNSStringF(int message_id, int number) { | 162 NSString* GetPluralNSStringF(int message_id, int number) { |
162 return base::SysUTF16ToNSString(l10n_util::GetPluralStringFUTF16(message_id, | 163 return base::SysUTF16ToNSString(l10n_util::GetPluralStringFUTF16(message_id, |
163 number)); | 164 number)); |
164 } | 165 } |
165 | 166 |
166 } // namespace l10n_util | 167 } // namespace l10n_util |
OLD | NEW |