* Daniel Cheng <j16sdiz+freenet at gmail.com> [2008-08-20 10:11:25]: > On Wed, Aug 20, 2008 at 3:11 AM, <nextgens at freenetproject.org> wrote: > > Author: nextgens > > Date: 2008-08-19 19:11:49 +0000 (Tue, 19 Aug 2008) > > New Revision: 22032 > > > > Modified: > > trunk/freenet/src/freenet/clients/http/PageMaker.java > > trunk/freenet/src/freenet/clients/http/TranslationToadlet.java > > trunk/freenet/src/freenet/l10n/L10n.java > > trunk/freenet/src/freenet/node/Node.java > > trunk/freenet/src/freenet/node/fcp/NodeHelloMessage.java > > Log: > > Use an enum in the L10n framework; needs testing. > > > > Modified: trunk/freenet/src/freenet/l10n/L10n.java > > =================================================================== > > --- trunk/freenet/src/freenet/l10n/L10n.java 2008-08-19 18:50:57 UTC > > (rev 22031) > > +++ trunk/freenet/src/freenet/l10n/L10n.java 2008-08-19 19:11:49 UTC > > (rev 22032) > > @@ -31,25 +31,83 @@ > > public static final String SUFFIX = ".properties"; > > public static final String OVERRIDE_SUFFIX = ".override" + SUFFIX; > > > > - public static final String FALLBACK_DEFAULT = "en"; > > + public static final LANGUAGE FALLBACK_DEFAULT = LANGUAGE.ENGLISH; > > + > > /** @see http://www.omniglot.com/language/names.htm */ > > - public static final String[][] AVAILABLE_LANGUAGES = { > > - new String[] { "en", "English", "eng" }, > > - new String[] { "es", "Espa?ol", "spa" }, > > - new String[] { "da", "Dansk", "dan" }, > > - new String[] { "de", "Deutsch", "deu" }, > > - new String[] { "fi", "Suomi", "fin" }, > > - new String[] { "fr", "Fran?ais", "fra" }, > > - new String[] { "it", "Italiano", "ita" }, > > - new String[] { "no", "Norsk", "nor" }, > > - new String[] { "pl", "Polski", "pol" }, > > - new String[] { "se", "Svenska", "svk" }, > > - new String[] { "zh-cn", "??????(??????)", "chn" }, > > - new String[] { "zh-tw", "??????(??????)", "zh-tw" }, > > - new String[] { "unlisted", "unlisted", "unlisted"}, > > - }; > > - private final String selectedLanguage; > > + public enum LANGUAGE { > > + ENGLISH("en", "English", "eng"), > > + SPANISH("es", "Espa?ol", "spa"), > > + DANISH("da", "Dansk", "dan"), > > + GERMAN("de", "Deutsch", "deu"), > > + FINNISH("fi", "Suomi", "fin"), > > + FRENCH("fr", "Fran?ais", "fra"), > > + ITALIAN("it", "Italiano", "ita"), > > + NORWEGIAN("no", "Norsk", "nor"), > > + POLISH("pl", "Polski", "pol"), > > + SWEDISH("se", "Svenska", "svk"), > > + CHINESE("zh-cn", "??????(??????)", "chn"), > > + CHINESE_TAIWAN("zh-tw", "??????(??????)", "zh-tw"), > > Why "chn" for zh-cn while keeping zh-tw intract? > What's the "short code" intended for? > > "chn" is the ISO-639 code for "Chinook jargon" > "chn" is the ISO 3166-1 code for China (the nation, not the language) > > The ISO-639-1 code for Chinese (PRC Mainland or Taiwan) is zho-* > (It's the code for *spoken* language, not *written* language, so there is no > exact mapping) > > The IANA standard is even messier: > zh-cmn Mandarin Chinese > zh-cmn-Hans Mandarin Chinese (Simplified) > zh-cmn-Hant Mandarin Chinese (Traditional) > zh-Hans Chinese, in simplified script > zh-Hans-CN PRC Mainland Chinese in simplified script ...[ this is > what our zh-cn use ] > zh-Hans-TW Taiwan Chinese in simplified script ...[which never exist] > [...] > zh-Hant Chinese, in traditional script > zh-Hant-CN PRC Mainland Chinese in traditional script ...[which never > exist] > zh-Hant-TW Taiwan Chinese in traditional script ...[ this is what > our zh-tw use ] > > The "zh-tw" / "zh-cn" are unix tradition, which is not in any standard > I am awared of. >
To sum up: the first parameter (what I call shortCode) is what we use internally (for file-naming), the second is what is displayed to the user and the third is what the installer uses (see bug #2424); as far as I remember it's the only use of this parameter. Right now the installer supports only CHN... hence the third parameter doesn't matter much: it will display the only Chinese translation it has. Whether they use CHINESE or CHINESE_TAIWAN, I don't know but you could probably tell me :) https://emu.freenetproject.org/svn/trunk/apps/new_installer/langpacks/chn.xml Here is the file I'm talking about ^ If yongjhen would like to translate the installer in CHINESE_TAIWAN too, I will be more than happy to assist him in forwarding the required patch upstream :) Their bug tracker is at http://jira.codehaus.org/browse/IZPACK NextGen$ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080820/2f701a85/attachment.pgp>
