Skip to content

Commit

Permalink
Merge pull request #112 from DigiByte-Core/one_english
Browse files Browse the repository at this point in the history
Update: Remove superfluent English translations
  • Loading branch information
ycagel authored Apr 16, 2024
2 parents 3ecc0d0 + 0824afd commit 190981f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 11,811 deletions.
1,966 changes: 0 additions & 1,966 deletions en-au/index.html

This file was deleted.

1,944 changes: 0 additions & 1,944 deletions en-ca/index.html

This file was deleted.

1,944 changes: 0 additions & 1,944 deletions en-gb/index.html

This file was deleted.

1,966 changes: 0 additions & 1,966 deletions en-in/index.html

This file was deleted.

1,955 changes: 0 additions & 1,955 deletions en-ng/index.html

This file was deleted.

1,954 changes: 0 additions & 1,954 deletions en-nz/index.html

This file was deleted.

44 changes: 5 additions & 39 deletions en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,19 @@
})

.then((data) => {
if (data.country == "US")
let c = data.country.toLowerCase();
if (c === "us" || c === "gb" || c === "ca" || c === "au" || c === "nz" || c === "in" || c === "ng")
window.location.replace('../en-us/'+target)

else if (data.country == "GB")
window.location.replace('../en-gb/'+target)

else if (data.country == "CA")
window.location.replace('../en-ca/'+target)

else if (data.country == "AU")
window.location.replace('../en-au/'+target)

else if (data.country == "NZ")
window.location.replace('../en-nz/'+target)

else if (data.country == "IN")
window.location.replace('../en-in/'+target)

else if (data.country == "NG")
window.location.replace('../en-ng/'+target)

else
window.location.replace('../?lang=en'+target)
})

.catch((err) => {
if (langcode5 == "en-US")
let c = langcode5.toLowerCase();
if (c === "en-us" || c === "en-gb" || c === "en-ca" || c === "en-u" || c === "en-nz" || c === "en-in" || c === "en-ng")
window.location.replace('../en-us/'+target)

else if (langcode5 == "en-GB")
window.location.replace('../en-gb/'+target)

else if (langcode5 == "en-CA")
window.location.replace('../en-ca/'+target)

else if (langcode5 == "en-AU")
window.location.replace('../en-au/'+target)

else if (langcode5 == "en-NZ")
window.location.replace('../en-nz/'+target)

else if (langcode5 == "en-IN")
window.location.replace('../en-in/'+target)

else if (langcode5 == "en-NG")
window.location.replace('../en-NG/'+target)


else
window.location.replace('../?lang=en'+target)
})
Expand Down
58 changes: 15 additions & 43 deletions js/languagerouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
else
null

const isEnglish = (data, definitelyIsEnglish=false) => {
//Will set any of these locale detections to en-US translation
let c;
if (definitelyIsEnglish) c = data.toLowerCase()
else c = data.country.toLowerCase();

if (c === "us" || c === "gb" || c === "ca" || c === "au" || c === "nz" || c === "in" || c === "ng") window.location.replace(`en-us/${target}`);
if (c === "en-us" || c === "en-gb" || c === "en-ca" || c === "en-au" || c === "en-nz" || c === "en-in" || c === "en-ng") window.location.replace(`en-us/${target}`)
}

var langvalue = location.search.substring(1);
var browserlang = navigator.language || navigator.userLanguage;
var langcode5 = browserlang.substr(0,5);
Expand Down Expand Up @@ -52,30 +62,9 @@
})

.then((data) => {
if (data.country == "US")
window.location.replace('en-us/'+target)

else if (data.country == "GB")
window.location.replace('en-gb/'+target)

else if (data.country == "CA")
window.location.replace('en-ca/'+target)

else if (data.country == "AU")
window.location.replace('en-au/'+target)

else if (data.country == "NZ")
window.location.replace('en-nz/'+target)

else if (data.country == "BR")
if (data.country == "BR")
window.location.replace('pt-br/'+target)

else if (data.country == "IN")
window.location.replace('en-in/'+target)

else if (data.country == "NG")
window.location.replace('en-ng/'+target)

else if (['KE', 'TZ', 'CD', 'RW', 'UG'].indexOf(data.country) >= 0)
window.location.replace('sw/'+target)

Expand All @@ -87,31 +76,14 @@

else if (data.country == "ID")
window.location.replace('id/'+target)

else isEnglish(data)
})

.catch((err) => {
if (langcode5 == "en-US")
window.location.replace('en-us/'+target)

else if (langcode5 == "en-GB")
window.location.replace('en-gb/'+target)

else if (langcode5 == "en-CA")
window.location.replace('en-ca/'+target)

else if (langcode5 == "en-AU")
window.location.replace('en-au/'+target)

else if (langcode5 == "en-NZ")
window.location.replace('en-nz/'+target)

else if (langcode5 == "pt-BR")
if (langcode5 == "pt-BR")
window.location.replace('pt-br/'+target)

else if (langcode5 == "en-IN")
window.location.replace('en-in/'+target)

else if (langcode5 == "en-NG")
window.location.replace('en-ng/'+target)
else isEnglish(langcode5, true)
})
}

0 comments on commit 190981f

Please sign in to comment.