From cb10daba922583b59de288227fa71d7205f62b9c Mon Sep 17 00:00:00 2001 From: luccioman Date: Sat, 4 Nov 2017 11:06:05 +0100 Subject: [PATCH] Renamed Chinese & Greek lng files using ISO639-1 codes. Previously named with their ISO 3166-1 country code : this way, when setting language to "Browser" in ConfigBasic.html, it didn't work properly when browser preferred language was Chinese or Greek as their respective language codes are "zh" and "el" (not "cn" and "gr" which are their country codes) --- htroot/ConfigBasic.html | 6 ++++-- htroot/ConfigBasic.java | 9 ++++++--- locales/{gr.lng => el.lng} | 2 +- locales/{cn.lng => zh.lng} | 2 +- source/net/yacy/data/Translator.java | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) rename locales/{gr.lng => el.lng} (98%) rename locales/{cn.lng => zh.lng} (99%) diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html index b974dc33f..e8bd56d11 100644 --- a/htroot/ConfigBasic.html +++ b/htroot/ConfigBasic.html @@ -37,17 +37,19 @@       - + - + + #(setUseCase)#:: +
  • ok Use Case: what do you want to do with YaCy:
    diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index 3f292d795..414a47908 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -271,11 +271,12 @@ public class ConfigBasic { prop.put("lang_browser", "0"); // for client browser language dependent prop.put("lang_de", "0"); prop.put("lang_fr", "0"); - prop.put("lang_cn", "0"); + prop.put("lang_zh", "0"); prop.put("lang_ru", "0"); prop.put("lang_uk", "0"); prop.put("lang_en", "0"); prop.put("lang_ja", "0"); + prop.put("lang_el", "0"); if ("default".equals(lang)) { prop.put("lang_en", "1"); } else { @@ -284,11 +285,12 @@ public class ConfigBasic { // set label class (green background) for active translation if (lang.equals("browser")) { List l = Translator.activeTranslations(); - prop.put("active_cn", l.contains("cn") ? "2" : "1"); + prop.put("active_zh", l.contains("zh") ? "2" : "1"); prop.put("active_de", l.contains("de") ? "2" : "1"); prop.put("active_fr", l.contains("fr") ? "2" : "1"); prop.put("active_hi", l.contains("hi") ? "2" : "1"); prop.put("active_ja", l.contains("ja") ? "2" : "1"); + prop.put("active_el", l.contains("el") ? "2" : "1"); prop.put("active_ru", l.contains("ru") ? "2" : "1"); prop.put("active_uk", l.contains("uk") ? "2" : "1"); prop.put("active_en", "2"); @@ -297,11 +299,12 @@ public class ConfigBasic { prop.put("active_de", "0"); prop.put("active_fr", "0"); prop.put("active_hi", "0"); - prop.put("active_cn", "0"); + prop.put("active_zh", "0"); prop.put("active_ru", "0"); prop.put("active_uk", "0"); prop.put("active_en", "0"); prop.put("active_ja", "0"); + prop.put("active_el", "0"); } return prop; } diff --git a/locales/gr.lng b/locales/el.lng similarity index 98% rename from locales/gr.lng rename to locales/el.lng index bddbaefbc..bc699abe5 100644 --- a/locales/gr.lng +++ b/locales/el.lng @@ -1,4 +1,4 @@ -# gr.lng +# el.lng # English-->Greek # ----------------------- # part of YaCy diff --git a/locales/cn.lng b/locales/zh.lng similarity index 99% rename from locales/cn.lng rename to locales/zh.lng index 6999ff139..9f97c4e43 100644 --- a/locales/cn.lng +++ b/locales/zh.lng @@ -1,4 +1,4 @@ -# cn.lng +# zh.lng # English-->Chinese # ----------------------- # This is a part of YaCy, a peer-to-peer based web search engine diff --git a/source/net/yacy/data/Translator.java b/source/net/yacy/data/Translator.java index d4f5838d2..03e55c61b 100644 --- a/source/net/yacy/data/Translator.java +++ b/source/net/yacy/data/Translator.java @@ -272,7 +272,7 @@ public class Translator { final String[] ms = CommonPattern.COMMA.split( "browser/Browser Language," + "default/English,de/Deutsch,fr/Français,nl/Nederlands,it/Italiano,es/Español,pt/Portugês,fi/Suomi,se/Svenska,dk/Dansk," + - "gr/Eλληvικα,sk/Slovensky,cn/汉语/漢語," + + "el/Eλληvικα,sk/Slovensky,zh/汉语/漢語," + "ru/Русский,uk/Українська," + "hi/हिन्दी,ja/日本語" );