summaryrefslogtreecommitdiffstats
path: root/chrome/common/l10n_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Block Oriya locale on Windows XP.jungshik@google.com2009-03-261-0/+5
| | | | | | | | | | | | Add IsLocaleSupportedByOS to l10n_util_{win,posix}.cc. Posix version always returns true. Windows blocks Oriya on Windows XP. BUG=7325 TEST=1. L10n*.GetAppLocale 2. On Win XP, Oriya should not be shown in the UI language switch menu while it should be shown elsewhere. Review URL: http://codereview.chromium.org/45054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12557 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite GetTextDirection() to call GetTextDirectionForLocale(locale_name), whichjungshik@google.com2009-03-251-3/+6
| | | | | | | | | | | in turn calls uscript_getCode() to get the script code and compare it against Hebrew and Arabic scripts (as opposed to languages). TEST=L10n*.GetTextDirection Review URL: http://codereview.chromium.org/40125 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12435 0039d316-1c4b-4281-b951-d872f2087c98
* Switch some more ASCII locale code wstrings to strings.estade@chromium.org2009-03-241-2/+2
| | | | | | | | Also, don't alphabetize available spellchecker locale codes. Review URL: http://codereview.chromium.org/42531 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12388 0039d316-1c4b-4281-b951-d872f2087c98
* Change SpellChecker::Language to be an ASCII string.estade@chromium.org2009-03-111-0/+1
| | | | | | Review URL: http://codereview.chromium.org/41028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11407 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes CRLF and trailing white spaces.maruel@chromium.org2009-03-051-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
* Move windows specific functions from l10n_util.h to l10n_util_win.h.tc@google.com2009-02-241-22/+0
| | | | | | Review URL: http://codereview.chromium.org/27103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10307 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a method to sort the elements of a vector by invoking a method onsky@google.com2009-02-241-1/+69
| | | | | | | | | | | | | | each that returns a string. The strings are then compared using a collator, or operator < if no collator is found. I'm going to use this for sorting bookmarks. BUG=1750 TEST=none yet Review URL: http://codereview.chromium.org/20484 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10252 0039d316-1c4b-4281-b951-d872f2087c98
* This CL fixes issue 6099 -- bad display of multi-line English message in pop ↵xji@chromium.org2009-02-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ups. (http://crbug.com/6099) Currently, in RTL locales, a pure *multi-line* English message is displayed as right aligned and has RTL directionality (such as the ending punctuation appears at the very left). Single-line message works fine. I do not know why, but simply putting LRE-PDF around a multi-line English text which has the following flags DT_WORDBREAK | DT_RTLREADING wont render the English message as LTR. We have to remove the DT_RTLREADING to render multi-line English message correctly in LTR direction. The fix is that in RTL locales, for JavaScript message, if the message is pure English, the alignment is set to be left-aligned, and the directionality is set to be left-to-right. If the message is mixed BiDi text, the alignment and the directionality is determined by the directionality of the first character with strong directionality in the text. JavaScript message is a MessageBoxView, and the message is a view::Label. Both MessageBoxView and Label are used by Chrome's UI as well. If the message is one of Chrome UI's, the alignment and directionality of the message should be taken from that of the UI's. In order to distinguish where the message comes from, a new flag kFlagWebMessage is introduced in MessageBoxView, and a new argument is introduced in Label::SetHorizontalAlignment() to control whether the alignment need to be flipped or not for RTL locales. Consequently, quite a few files which calls Label::SetHorizontalAlignment() are changed. The main changes are in 5 areas. Other files are changed due to the signature change of Label::SetHorizontalAlignment(). 1. jsmessage_box_handler.cc: pass in extra flag kFlagWebPage when creating MessageBoxView to indicate the message box is one from a web page, not from Chrome UI. 2. l10n_util.h/.cc added function GetFirstStrongDirection() 3. label.h/.cc a new argument is introduced in Label::SetHorizontalAlignment() to control whether the alignment need to be flipped or not for RTL locales. 4. message_box_view.cc when init message box view, if the flag is kFlagWebPage, get the text directionality from the text itself (not Chrome UI's) and calls Label::SetHorizontalAlignment() to not resetting the flag for RTL locales. 5. chrome_canvas_win.cc 5.1 ComputeFormatFlags() only set flag DT_RTLREADING for RTL locales if the text contains strong RTL characters and the alignment is RIGHT aligned. All labels of Chrome's UI and other Chrome UI components in RTL locales have been set as (or flipped to) RIGHT aligned. 5.2 DoDrawText() Only adjust string for locale is the reading direction is DT_RTLREADING. Review URL: http://codereview.chromium.org/18863 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10178 0039d316-1c4b-4281-b951-d872f2087c98
* This CL fix the following 2 bugs:xji@chromium.org2009-02-201-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1.7324 -- RTL: Path contains Hebrew is wrong on "Download location" text box (http://crbug.com/7324) 2. 7326 -- RTL: Folder icon missing on "Download location" text box (http://crbug.com/7326) The fix are: 1. force path to have LTR directionality. 2. draw icon in mirrored position in RTL locales. Steps for test: 1. Create a folder with a Hebrew file name on Hebrew XP 2. Change the download location to the folder created in step 1 3. Observe the path displayed on "Google Chrome Options" --> "Minor Tweaks" --> "Download location" text box Without the fix: The path contains Hebrew folder name is wrong. It displayed as "cCBA\:" while the path is "c:\CBA" where "CBA" is a Hebrew folder name. And there is no folder icon in the "download location" text box. With the fix: The path displayed correctly as "c:\CBA" or "c:\CBA\FED" where "FED" is subfolder of "CBA". And the folder icon showed at the very right. Review URL: http://codereview.chromium.org/20038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10121 0039d316-1c4b-4281-b951-d872f2087c98
* I forgot to add #include <functional> to l10n_util.h for using binary_functionjnd@chromium.org2009-02-201-0/+1
| | | | | | | | BUG=7647 Review URL: http://codereview.chromium.org/21533 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10079 0039d316-1c4b-4281-b951-d872f2087c98
* We will sort the encoding menu items according to current used UI language ↵jnd@chromium.org2009-02-201-0/+73
| | | | | | | | | | | except the UTF-8 encoding and the recently selectd encodings. For details, see Fix bug http://code.google.com/p/chromium/issues/detail?id=7647 BUG=7647 Review URL: http://codereview.chromium.org/21414 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10077 0039d316-1c4b-4281-b951-d872f2087c98
* ===================================================xji@chromium.org2009-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change list fixes the following 2 chrome bugs: 2821 RTL: Ellipsis appeared at right for RTL locales on "Task Manager - Google Chrome" dialog (http://crbug.com/2821) 6132: Strings in tables are displayed LTR when they should be RTL (http://crbug.com/6132) =================================================== Background: The above 2 bugs are related to Chrome task manager. Task manager is a TableView, which is a subclass of NativeControl. Currently, TableView window is created by using WS_EX_LAYOUTRTL | WS_EX_RTLREADING flag, which is wrong. WS_EX_LAYOUTRTL | WS_EX_RTLREADING renders a RTL alignment but LTR reading order. Please see the following blog for detail: http://blogs.msdn.com/michkap/archive/2007/03/11/1857043.aspx We need to replace the above flag with WS_EX_LAYOUTRTL only. Consequently, we need to make sure that the various implementations of TableModel::GetText adjust the returned text appropriately if need be. For example, if the text in an URL, then the returned text should be explicitly marked as LTR text. Please note: there are several other places where we create RTL window using WS_EX_LAYOUTRTL | WS_EX_RTLREADING flag, such as AutoCompleteEditView (omnibox), MenuHostWindow, TextField (for example, text in bookmark dialog), and other NativeControl (including checkbox, combobox, native_button, radio_button, separator, tabbed_pane, and tree view). They all need to be fixed. And the following bug is filed for tracking. http://crbug.com/6573 =================================================== The fix is based on Idan's comments on bug 6132 1.create the table view with WS_EX_LAYOUTRTL (rather than WS_EX_LAYOUTRTL | WS_EX_RTLREADING) 2 Make sure that the various implementations of TableModel::GetText adjust the returned text appropriately if need be. If the text in an URL, then the returned text is explicitly marked as LTR text. Otherwise, the returned text is marked with LTR if it is RTL environment and there is no strong RTL character in the text. This is to avoid the wrong placement of (or wrong mirrored) ending-punctuation. =================================================== Since we have quite a few places creating window using WS_EX_LAYOUTRTL | WS_EX_RTLREADING style. We decided to migrate to the right style step to step. This is the first step, and there is unnecessary function introduced by this change list. 1. I am using l10n_util::GetExtendedTooltipStyles() for the right style for now. And I marked a TODO there to obsolete this function name, replace with GetExtendedStyles eventually. (the l10n_util.h is no longer in the change list since I've checked it in with another CL). 2. I introduced native_control::GetAdditionalRTLStyle() which should replace GetAdditionalExStyle() eventually. =================================================== When wrapping text with LTR format in GetText(), ideally, we should parse the text to check whether this is a n URL or not (for example, a webpage title could be an URL, or user could add URL as search engine's name or keyword). I did not do that and only added a TODO there because I think that might be rare case and parsing the text might cause performance degradation. Review URL: http://codereview.chromium.org/18076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8593 0039d316-1c4b-4281-b951-d872f2087c98
* This change list fix issues 6093 [settings] bad directionality for gears buttonxji@chromium.org2009-01-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | (http://crbug.com/6093). The directionality of gears button is already fixed. This CL fixes the wrong location of ":". It adds RLM at the end of string "Google Gears:" for Hebrew and Arabic Chrome, so that the ":" in "Google Gears:" in Hebrew is displayed leftmost instead of rightmost. Test: 1) open chrome, Hebrew UI 2) option -> under the hood -> google gears Without the fix, the name appears as "Google Gears:". With the fix, the name appears as ":Google Gears". Review URL: http://codereview.chromium.org/18279 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8205 0039d316-1c4b-4281-b951-d872f2087c98
* Port some files in chrome/browser/agl@chromium.org2008-11-141-0/+6
| | | | | | | | | | | | | | | #ifdef out windows-specific portion of chrome/common/l10n_util.h, which allows me to port some other files. I also extracted parts of chrome/views/tree_view.h to tree_model.h, so that ATL/WTL-specific parts stay in tree_view.h, but tree_model.h is platform-independent and can be included in files using it as base class. Review URL: http://codereview.chromium.org/8618 Patch from Paweł Hajdan jr. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5483 0039d316-1c4b-4281-b951-d872f2087c98
* Fix RTL issues in the About box (bug 3756).finnur@google.com2008-10-311-4/+31
| | | | | | | | I used the BiDiLineIterator, which I moved out of the AutocompletePopup and into the l10n_util file. I also added a wrapper function around ubidi_getLogicalRun. Review URL: http://codereview.chromium.org/8727 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4294 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Add chrome to the repository.initial.commit2008-07-261-0/+197
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15 0039d316-1c4b-4281-b951-d872f2087c98