Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: ios/chrome/browser/ui/util/i18n_string.mm

Issue 2730763003: Fix util to adjust string for locale direction (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ios/chrome/browser/ui/util/i18n_string.h" 5 #import "ios/chrome/browser/ui/util/i18n_string.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 10
11 NSString* AdjustStringForLocaleDirection(NSString* text) { 11 NSString* AdjustStringForLocaleDirection(NSString* text) {
12 base::string16 converted_text = base::SysNSStringToUTF16(text); 12 base::string16 converted_text = base::SysNSStringToUTF16(text);
13 bool has_changed = 13 bool has_changed =
14 base::i18n::AdjustStringForLocaleDirection(&converted_text); 14 base::i18n::AdjustStringForLocaleDirection(&converted_text);
15 if (has_changed) { 15 if (has_changed) {
16 return base::SysUTF16ToNSString(converted_text); 16 return base::SysUTF16ToNSString(converted_text);
17 } 17 }
18 return text; 18 return [[text copy] autorelease];
19 } 19 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698