Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
perceptron8 committed Jan 1, 2017
0 parents commit cbc7ffe
Show file tree
Hide file tree
Showing 23 changed files with 205 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .project
@@ -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>
46 changes: 46 additions & 0 deletions README.md
@@ -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.
5 changes: 5 additions & 0 deletions _locales/ar/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "ar-ae"
}
}
5 changes: 5 additions & 0 deletions _locales/cz/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "cz-cz"
}
}
5 changes: 5 additions & 0 deletions _locales/de/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "de-de"
}
}
5 changes: 5 additions & 0 deletions _locales/el/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "el-gr"
}
}
5 changes: 5 additions & 0 deletions _locales/en/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "en-au"
}
}
5 changes: 5 additions & 0 deletions _locales/en_GB/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "en-uk"
}
}
5 changes: 5 additions & 0 deletions _locales/en_US/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "en-us"
}
}
5 changes: 5 additions & 0 deletions _locales/es/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "es-es"
}
}
5 changes: 5 additions & 0 deletions _locales/es_419/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "es-mx"
}
}
5 changes: 5 additions & 0 deletions _locales/fr/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "fr-fr"
}
}
5 changes: 5 additions & 0 deletions _locales/it/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "it-it"
}
}
5 changes: 5 additions & 0 deletions _locales/nl/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "nl-nl"
}
}
5 changes: 5 additions & 0 deletions _locales/pl/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "pl-pl"
}
}
5 changes: 5 additions & 0 deletions _locales/pt_BR/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "pt-br"
}
}
5 changes: 5 additions & 0 deletions _locales/ro/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "ro-ro"
}
}
5 changes: 5 additions & 0 deletions _locales/ru/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "ru-ru"
}
}
5 changes: 5 additions & 0 deletions _locales/tr/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "tr-tr"
}
}
5 changes: 5 additions & 0 deletions _locales/zh_CN/messages.json
@@ -0,0 +1,5 @@
{
"lang": {
"message": "zh-cn"
}
}
Binary file added icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions manifest.json
@@ -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"
]
}]
}
11 changes: 11 additions & 0 deletions script.js
@@ -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);
}

0 comments on commit cbc7ffe

Please sign in to comment.