W3C home > Mailing lists > Public > www-validator-cvs@w3.org > July 2010

unicorn commit: ~ changed resolved 'zh' locales to 'zh-Hans'

From: Mercurial notifier <nobody@w3.org>
Date: Thu, 29 Jul 2010 22:18:31 +0000
To: Unicorn Updates <www-validator-cvs@w3.org>
Message-Id: <E1OebQt-0005wg-Nu@blinky.w3.org>
changeset:   1395:c1ec379ee303
user:        Thomas Gambet <tgambet@w3.org>
date:        Thu Jul 29 18:14:10 2010 -0400
files:       src/org/w3c/unicorn/util/Language.java
description:
~ changed resolved 'zh' locales to 'zh-Hans'


diff -r 6831a41fa49f -r c1ec379ee303 src/org/w3c/unicorn/util/Language.java
--- a/src/org/w3c/unicorn/util/Language.java	Thu Jul 29 18:12:50 2010 -0400
+++ b/src/org/w3c/unicorn/util/Language.java	Thu Jul 29 18:14:10 2010 -0400
@@ -92,6 +92,8 @@
 		if (languageCode == null)
 			return Language.defaultLocale;
 		ULocale resolved = installedLocaleMatcher.getBestMatch(languageCode);
+		if (resolved.getName().equals("zh"))
+			resolved = ULocale.SIMPLIFIED_CHINESE;
 		logger.debug("resolved installed locale: " + resolved.getBaseName());
 		return resolved;
 	}
@@ -101,6 +103,8 @@
 		if (languageCode == null)
 			return Language.defaultLocale;
 		ULocale resolved = uiLocaleMatcher.getBestMatch(languageCode);
+		if (resolved.getName().equals("zh"))
+			resolved = ULocale.SIMPLIFIED_CHINESE;
 		logger.debug("resolved UI locale: " + resolved.getBaseName());
 		return resolved;
 	}
@@ -110,9 +114,8 @@
 		if (languageCode == null)
 			return Language.defaultLocale;
 		ULocale resolved = availableLocaleMatcher.getBestMatch(languageCode);
-		// for some reason the LocaleMatcher will sometimes return zh_Hans instead of zh resulting in a wrong language resolving
-		if (resolved.getName().equals("zh_Hans"))
-			resolved = availableLocaleMatcher.getBestMatch(resolved.getName());
+		if (resolved.getName().equals("zh"))
+			resolved = ULocale.SIMPLIFIED_CHINESE;
 		logger.debug("resolved available locale: " + resolved.getBaseName());
 		return resolved;
 	}
Received on Thursday, 29 July 2010 22:18:33 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:43 UTC