Commit c8db48eb authored by Thierry BUGEAT's avatar Thierry BUGEAT

Remove file locales.js. Use manifest and properties for dynamics translations.

parent 949cb2ca
......@@ -214,8 +214,6 @@
<script src="libs/l10n.js"></script>
<link rel="resource" type="application/l10n" href="locales/locales.ini" />
<script type="text/javascript" src="locales/locales.js"></script>
<!-- Libs -->
<script type="text/javascript" src="libs/myCore.js"></script>
......
......@@ -54,3 +54,5 @@ keyword-was-not-added=Keyword was not added.
feedly-get-subscriptions-error=Feedly error:
aolreader-get-subscriptions-error=Aol Reader error:
no-news=No news
by=by
nb-days-ago={{n}} days ago
......@@ -54,3 +54,5 @@ keyword-was-not-added=La palabra clave no ha sido añadida.
feedly-get-subscriptions-error=Feedly error:
aolreader-get-subscriptions-error=Aol Reader error:
no-news=No noticia
by=por
nb-days-ago=Hace {{n}} días
......@@ -54,3 +54,5 @@ keyword-was-not-added=Le mot clé n'a pas été ajouté.
feedly-get-subscriptions-error=Erreur Feedly:
aolreader-get-subscriptions-error=Erreur Aol Reader:
no-news=Pas d'actualité
by=par
nb-days-ago=Il y a {{n}} jours
var myDynamicsLocales = {
"en": {
"title": "English",
"nb-days-ago": "{{n}} days ago",
"by": "by"
},
"es": {
"title": "Español",
"nb-days-ago": "Hace {{n}} días",
"by": "por"
},
"fr": {
"title": "Français",
"nb-days-ago": "Il y a {{n}} jours",
"by": "par"
},
"pt": {
"title": "Português",
"nb-days-ago": "{{n}} dias atrás",
"by": "por"
},
"ru": {
"title": "Pусский",
"nb-days-ago": "{{n}} days ago",
"by": "by"
}
};
// Keep only user locale.
var userLocale = navigator.language || navigator.userLanguage;
var myExtraTranslations = {};
if (myDynamicsLocales[userLocale] !== undefined) {
myExtraTranslations = myDynamicsLocales[userLocale];
} else {
myExtraTranslations = myDynamicsLocales['en'];
}
......@@ -53,3 +53,5 @@ keyword-was-not-added=Keyword was not added.
feedly-get-subscriptions-error=Feedly erro:
aolreader-get-subscriptions-error=Aol Reader erro:
no-news=No notícia
by=por
nb-days-ago={{n}} dias atrás
......@@ -53,4 +53,6 @@ keyword-was-added = Ключевое слово было добавлено.
keyword-was-not-added = Ключевое слово не было добавлено.
feedly-get-subscriptions-error = Feedly ошибка:
aolreader-get-subscriptions-error = Aol Reader ошибка:
no-news = Нет новостей
\ No newline at end of file
no-news = Нет новостей
by = ###by###
nb-days-ago = ###{{n}} days ago###
......@@ -14,17 +14,30 @@
"orientation": "portrait-primary",
"default_locale": "en",
"locales": {
"en": {
"name": "my Feeds",
"description": "RSS & ATOM Reader.",
"my_title": "English"
},
"es": {
"name": "mis Noticias",
"description": "Lector de RSS y ATOM."
"description": "Lector de RSS y ATOM.",
"my_title": "Español"
},
"fr": {
"name": "mes Fluxs",
"description": "Lecteur de flux RSS & ATOM."
"description": "Lecteur de flux RSS & ATOM.",
"my_title": "Français"
},
"pt": {
"name" : "meus Fluxs",
"description": "RSS e Atom Reader."
"description": "RSS e Atom Reader.",
"my_title": "Português"
},
"ru": {
"name": "my Feeds",
"description": "RSS & ATOM Reader.",
"my_title": "Pусский"
}
},
"type": "privileged",
......
......@@ -759,13 +759,13 @@
_htmlLanguages = _htmlLanguages + '<select id="selectLanguage">';
for (var _locale in myDynamicsLocales) {
for (var _locale in myManifest['locales']) {
if (params.settings.ui.language == _locale) {
_selected = "selected";
} else {
_selected = "";
}
_htmlLanguages = _htmlLanguages + '<option value="' + _locale + '" ' + _selected + ' >' + myDynamicsLocales[_locale]['title'] + '</option>';
_htmlLanguages = _htmlLanguages + '<option value="' + _locale + '" ' + _selected + ' >' + myManifest['locales'][_locale]['my_title'] + '</option>';
}
_htmlLanguages = _htmlLanguages + '</select>';
......@@ -1346,7 +1346,7 @@
} else if (nbDaysAgo == 1) {
_daySeparator = document.webL10n.get('nb-days-ago-yesterday');
} else {
_daySeparator = myExtraTranslations['nb-days-ago'].replace('{{n}}', nbDaysAgo);
_daySeparator = document.webL10n.get('nb-days-ago').replace('{{n}}', nbDaysAgo);
}
ui.echo('feedsEntriesNbDaysAgo', _daySeparator, '');
......@@ -1506,7 +1506,7 @@
//my.log('mainEntryOpenInBrowser()', _entry.content);
if (_entry.author !== "") {
_author = '<div class="entrie-author">' + myExtraTranslations['by'] + ' ' + _entry.author + '</div>';
_author = '<div class="entrie-author"><my data-l10n-id="by">' + document.webL10n.get('by') + '</my> ' + _entry.author + '</div>';
}
_srcDoc = _srcDoc + _srcDocCss; // Inline CSS from file "style/inline.css.js"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment