Fix parsing Windows sort order in wxLocaleIdent::FromTag()
Adjust the code to check for Windows sort order only after the last underscore (instead of the first one). This avoids misinterpreting locale tags like "zh_Hans_CN".
This commit is contained in:
parent
5a80bfb1e9
commit
9ada6cd2db
1 changed files with 5 additions and 2 deletions
|
|
@ -159,8 +159,11 @@ wxLocaleIdent wxLocaleIdent::FromTag(const wxString& tag)
|
|||
//
|
||||
// Make sure we don't extract the region identifier erroneously as a sortorder identifier
|
||||
{
|
||||
wxString tagTemp = tagMain.BeforeFirst('_', &tagRest);
|
||||
if (tagRest.length() > 4 && locId.m_modifier.empty() && locId.m_charset.empty())
|
||||
wxString tagTemp = tagMain.BeforeLast('_', &tagRest);
|
||||
if (!tagTemp.empty() &&
|
||||
tagRest.length() > 4 &&
|
||||
locId.m_modifier.empty() &&
|
||||
locId.m_charset.empty())
|
||||
{
|
||||
// Windows sortorder found
|
||||
locId.SortOrder(tagRest);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue