Permalink
Browse files

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)
  • Loading branch information...
luccioman committed Nov 4, 2017
1 parent 4b61edf commit cb10daba922583b59de288227fa71d7205f62b9c
@@ -37,17 +37,19 @@ <h2>Basic Configuration</h2>
<input type="radio" name="language" value="default" id="lang_en" onchange="this.form.submit()" #(lang_en)#::checked="checked"#(/lang_en)# /><label for="lang_en" #(active_en)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_en)#>English</label>&nbsp;
<input type="radio" name="language" value="de" id="lang_de" onchange="this.form.submit()" #(lang_de)#::checked="checked"#(/lang_de)# /><label for="lang_de" #(active_de)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_de)#>Deutsch</label>&nbsp;
<input type="radio" name="language" value="fr" id="lang_fr" onchange="this.form.submit()" #(lang_fr)#::checked="checked"#(/lang_fr)# /><label for="lang_fr" #(active_fr)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_fr)#>Fran&ccedil;ais</label>&nbsp;
<input type="radio" name="language" value="cn" id="lang_cn" onchange="this.form.submit()" #(lang_cn)#::checked="checked"#(/lang_cn)# /><label for="lang_cn" #(active_cn)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_cn)#>&#27721;&#35821;/&#28450;&#35486</label>
<input type="radio" name="language" value="zh" id="lang_zh" onchange="this.form.submit()" #(lang_zh)#::checked="checked"#(/lang_zh)# /><label for="lang_zh" #(active_zh)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_zh)#>&#27721;&#35821;/&#28450;&#35486</label>
<input type="radio" name="language" value="ru" id="lang_ru" onchange="this.form.submit()" #(lang_ru)#::checked="checked"#(/lang_ru)# /><label for="lang_ru" #(active_ru)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_ru)#>&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;</label>
<input type="radio" name="language" value="uk" id="lang_uk" onchange="this.form.submit()" #(lang_uk)#::checked="checked"#(/lang_uk)# /><label for="lang_uk" #(active_uk)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_uk)#>&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;</label>
<input type="radio" name="language" value="hi" id="lang_hi" onchange="this.form.submit()" #(lang_hi)#::checked="checked"#(/lang_hi)# /><label for="lang_hi" #(active_hi)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_hi)#>&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;</label>
<input type="radio" name="language" value="ja" id="lang_ja" onchange="this.form.submit()" #(lang_ja)#::checked="checked"#(/lang_ja)# /><label for="lang_ja" #(active_ja)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_ja)#>&#26085;&#26412;&#35486;</label>
<input type="radio" name="language" value="ja" id="lang_ja" onchange="this.form.submit()" #(lang_ja)#::checked="checked"#(/lang_ja)# /><label for="lang_ja" #(active_ja)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_ja)#>&#26085;&#26412;&#35486;</label>
<input type="radio" name="language" value="el" id="lang_el" onchange="this.form.submit()" #(lang_el)#::checked="checked"#(/lang_el)# /><label for="lang_el" #(active_el)#::title="Click to generate translated pages"::class="label-success" title="Active : translated pages are available"#(/active_el)#>Greek</label>
</fieldset>
</li>
<!-- take care that no other items are changed, but also change the former if no js is enabled -->
<script type="text/javascript"> document.write('</form><form action="ConfigBasic.html" method="get">'); </script>
#(setUseCase)#::
<li>
<img src="env/grafics/ok.png" height="16" width="16" alt="ok" />&nbsp;Use Case: what do you want to do with YaCy:<br />
<fieldset>
@@ -271,11 +271,12 @@ public static serverObjects respond(final RequestHeader header, final serverObje
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 static serverObjects respond(final RequestHeader header, final serverObje
// set label class (green background) for active translation
if (lang.equals("browser")) {
List<String> 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 static serverObjects respond(final RequestHeader header, final serverObje
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;
}
@@ -1,4 +1,4 @@
# gr.lng
# el.lng
# English-->Greek
# -----------------------
# part of YaCy
@@ -1,4 +1,4 @@
# cn.lng
# zh.lng
# English-->Chinese
# -----------------------
# This is a part of YaCy, a peer-to-peer based web search engine
@@ -272,7 +272,7 @@ public boolean translateFilesRecursive(final File sourceDir, final File destDir,
final String[] ms = CommonPattern.COMMA.split(
"browser/Browser Language," +
"default/English,de/Deutsch,fr/Fran&ccedil;ais,nl/Nederlands,it/Italiano,es/Espa&ntilde;ol,pt/Portug&ecirc;s,fi/Suomi,se/Svenska,dk/Dansk," +
"gr/E&lambda;&lambda;&eta;v&iota;&kappa;&alpha;,sk/Slovensky,cn/&#27721;&#35821;/&#28450;&#35486;," +
"el/E&lambda;&lambda;&eta;v&iota;&kappa;&alpha;,sk/Slovensky,zh/&#27721;&#35821;/&#28450;&#35486;," +
"ru/&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;,uk/&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;," +
"hi/&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;,ja/&#26085;&#26412;&#35486;"
);

0 comments on commit cb10dab

Please sign in to comment.