Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cbc7ffe
Showing
23 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>babel.ext</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
</buildSpec> | ||
<natures> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Babel | ||
===== | ||
|
||
![](icon.png) | ||
|
||
Web extension forcing [The Settlers Online](http://www.thesettlersonline.com/) to use the same language as your browser! | ||
|
||
## How? | ||
|
||
By simply translating one lang to another... oh wait! Wasn't that string replacement? See the source code. | ||
|
||
## Where? | ||
|
||
You will be able to install Babel with just one click soon. | ||
|
||
- [Chrome Web Store]() | ||
- [Firefox add-ons]() | ||
- [Opera add-ons]() | ||
|
||
## Permissions | ||
|
||
Babel needs to read and change your data on a number of websites: | ||
|
||
- http://juego-thesettlersonline.com | ||
- http://www.diesiedleronline.de | ||
- http://www.thesettlersonline.com | ||
- http://www.thesettlersonline.com.br | ||
- http://www.thesettlersonline.cz | ||
- http://www.thesettlersonline.es | ||
- http://www.thesettlersonline.fr | ||
- http://www.thesettlersonline.gr | ||
- http://www.thesettlersonline.it | ||
- http://www.thesettlersonline.net | ||
- http://www.thesettlersonline.nl | ||
- http://www.thesettlersonline.pl | ||
- http://www.thesettlersonline.ro | ||
- http://www.thesettlersonline.ru | ||
- http://www.tsotesting.com | ||
|
||
It's dangerous to install this kind of extensions from untrusted sources. | ||
|
||
This one is safe, however. Really, really. | ||
|
||
## Credits | ||
|
||
"The Tower of Babel", Savery Roelant, 1602. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "ar-ae" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "cz-cz" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "de-de" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "el-gr" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "en-au" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "en-uk" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "en-us" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "es-es" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "es-mx" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "fr-fr" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "it-it" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "nl-nl" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "pl-pl" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "pt-br" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "ro-ro" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "ru-ru" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "tr-tr" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"lang": { | ||
"message": "zh-cn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"manifest_version": 2, | ||
"minimum_chrome_version": "50", | ||
|
||
"name": "Babel", | ||
"short_name": "Babel", | ||
"author": "perceptron8", | ||
"description": "Web Extension forcing 'The Settlers Online' to use the same language as your browser!", | ||
"homepage_url": "https://github.com/perceptron8/babel.ext", | ||
"version": "0.0.1", | ||
|
||
"default_locale": "en", | ||
|
||
"icons": { | ||
"192": "icon.png" | ||
}, | ||
|
||
"browser_action": { | ||
"default_icon": { | ||
"128": "icon.png" | ||
}, | ||
"default_title": "Babel" | ||
}, | ||
|
||
"content_scripts": [{ | ||
"matches": [ | ||
"http://juego-thesettlersonline.com/*", | ||
"http://www.diesiedleronline.de/*", | ||
"http://www.thesettlersonline.com/*", | ||
"http://www.thesettlersonline.com.br/*", | ||
"http://www.thesettlersonline.cz/*", | ||
"http://www.thesettlersonline.es/*", | ||
"http://www.thesettlersonline.fr/*", | ||
"http://www.thesettlersonline.gr/*", | ||
"http://www.thesettlersonline.it/*", | ||
"http://www.thesettlersonline.net/*", | ||
"http://www.thesettlersonline.nl/*", | ||
"http://www.thesettlersonline.pl/*", | ||
"http://www.thesettlersonline.ro/*", | ||
"http://www.thesettlersonline.ru/*", | ||
"http://www.tsotesting.com/*" | ||
], | ||
"js": [ | ||
"script.js" | ||
] | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
|
||
const swmmo = document.getElementById("SWMMO"); | ||
if (swmmo) { | ||
const clone = swmmo.cloneNode(); | ||
const lang = chrome.i18n.getMessage("lang"); | ||
clone.setAttribute("flashvars", swmmo.getAttribute("flashvars") | ||
.replace(/lang=[a-z]{2}[-][a-z]{2}/g, "lang=" + lang)); | ||
swmmo.parentNode.replaceChild(clone, swmmo); | ||
console.info(lang); | ||
} |