diff --git a/changelog.md b/changelog.md index aadc433d0..dca9755a8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ ##Changelog - Chrome Extension +#####v2.3.8.1 + +**Neu** +- Extension: + - Französische Übersetzung integriert [#96](https://github.com/dsiekiera/foe-helfer-extension/issues/96) + +--- + #####v2.3.8 **Neu** - Extension: diff --git a/js/inject.js b/js/inject.js index 8d0d2f342..39bdef7b3 100644 --- a/js/inject.js +++ b/js/inject.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 16.09.19, 14:37 Uhr + * zu letzt bearbeitet: 20.09.19, 11:01 Uhr * * Copyright © 2019 * @@ -15,7 +15,7 @@ let tid = setInterval(InjectCode, 5), manifestData = chrome.runtime.getManifest(), - PossibleLangs = ['de','en'], + PossibleLangs = ['de','en','fr'], v = manifestData.version; // muss sehr früh in den head-Tag diff --git a/js/popup.js b/js/popup.js index bc82fcd7f..12465a281 100644 --- a/js/popup.js +++ b/js/popup.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 19.09.19, 11:12 Uhr + * zu letzt bearbeitet: 20.09.19, 11:02 Uhr * * Copyright © 2019 * @@ -23,6 +23,11 @@ let i18n = { 'title' : 'FoE Helper', 'desc' : "You like this little free extension and you want to support it so that it stays that way?
Then every little donation for support is always welcome.", 'thanks' : 'Thank you so much!' + }, + 'fr' : { + 'title' : 'FoE Assistant', + 'desc' : "Vous aimez cette petite extension gratuite et vous voulez la soutenir pour continuer ainsi ?
Chaque petite donation pour le support est toujours la bienvenue.", + 'thanks' : 'Merci beaucoup !' } }; diff --git a/js/web/ant.js b/js/web/ant.js index 3dc92c755..d2eb27cdc 100644 --- a/js/web/ant.js +++ b/js/web/ant.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 18.09.19, 18:16 Uhr + * zu letzt bearbeitet: 20.09.19, 11:01 Uhr * * Copyright © 2019 * @@ -16,15 +16,13 @@ let ApiURL = 'https://api.foe-rechner.de/', ActiveMap = 'main', PlayerNames = [], FriendNames = [], - Language = 'de', ExtPlayerID = 0, ExtGuildID = 0, ExtWorld = '', BuildingNamesi18n = false, CityMapData = null, Conversations = [], - GoodsNames = [], - PossibleLangs = ['de','en']; + GoodsNames = []; document.addEventListener("DOMContentLoaded", function(){ @@ -446,6 +444,10 @@ document.addEventListener("DOMContentLoaded", function(){ */ let MainParser = { + Language: 'en', + + PossibleLangs: ['de','en', 'fr'], + BoostMapper: { 'supplies_boost': 'supply_production', 'happiness' : 'happiness_amount', @@ -474,10 +476,10 @@ let MainParser = { // gibt es eine Übersetzung? if(PossibleLangs.includes(lang) === false) { - lang = 'de'; + lang = 'en'; } - Language = lang; + MainParser.Language = lang; }, @@ -486,7 +488,7 @@ let MainParser = { * @returns {string} */ getLanguage: ()=>{ - return Language; + return MainParser.Language; }, diff --git a/js/web/i18n/de.js b/js/web/i18n/de.js index ca98217c4..6254acf9e 100644 --- a/js/web/i18n/de.js +++ b/js/web/i18n/de.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 19.09.19, 10:54 Uhr + * zu letzt bearbeitet: 19.09.19, 15:32 Uhr * * Copyright © 2019 * @@ -13,6 +13,9 @@ */ let i18n = { + "Local" : "de-DE", + "DateTime" : "DD.MM.YYYY HH:mm [Uhr]", + "Boxes" : { "OwnpartCalculator" : { "Title": "Eigenanteilsrechner", @@ -49,12 +52,14 @@ let i18n = { "StrategyPoints" : { "Title" : "FP - Produktionen", "TotalFPs": "Gesamt FP aus allen Gebäuden: ", - "Amount": "Anzahl" + "Amount": "Anzahl", + "FPBar" : "FP-Lager: " }, "Productions" : { "Title" : "Produktions Übersicht", "SearchInput": "Gebäude Suche...", + "Total" : "Gesamt: ", "ModeGroups": "Gruppiert", "ModeSingle": "Einzeln", "Headings" : { diff --git a/js/web/i18n/en.js b/js/web/i18n/en.js index 04d035173..4aadb75fa 100644 --- a/js/web/i18n/en.js +++ b/js/web/i18n/en.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 19.09.19, 10:56 Uhr + * zu letzt bearbeitet: 19.09.19, 15:32 Uhr * * Copyright © 2019 * @@ -13,6 +13,9 @@ */ let i18n = { + "Local" : "en-EN", + "DateTime" : "D/M/YY h:mm:ss a", + "Boxes" : { "OwnpartCalculator" : { "Title": "Co-payment calculator", @@ -49,12 +52,14 @@ let i18n = { "StrategyPoints" : { "Title" : "FP - Productions", "TotalFPs": "Total FPs from all buildings: ", - "Amount": "Number" + "Amount": "Number", + "FPBar" : "FP-Stock: " }, "Productions" : { "Title" : "Production overview", "SearchInput": "Search building...", + "Total" : "Total: ", "ModeGroups": "Groups", "ModeSingle": "Single", "Headings" : { diff --git a/js/web/i18n/fr.js b/js/web/i18n/fr.js new file mode 100644 index 000000000..c68982601 --- /dev/null +++ b/js/web/i18n/fr.js @@ -0,0 +1,181 @@ +/* + * ************************************************************************************** + * + * Dateiname: fr.js + * Projekt: foe + * + * erstellt von: Daniel Siekiera + * zu letzt bearbeitet: 20.09.19, 11:18 Uhr + * + * Copyright © 2019 + * + * ************************************************************************************** + */ + +let i18n = { + "Local" : "fr-FR", + "DateTime" : "DD.MM.YYYY HH:mm", + + "Boxes" : { + "OwnpartCalculator" : { + "Title": "Calculatrice de up à plusieurs", + "HelpLink": "https://foe-rechner.de/extension/index#Eigenanteilsrechner", + "Step": "Niveau", + "ArcBonus": "Bonus Arche", + "PatronPart": "Patron share: ", + "OwnPart": "Contribution personnelle", + "LGTotalFP": "Total PFs", + "ExternalFP": "PFs externes", + "Order": "Séquence", + "Deposit": "A poser", + "CopyValues": "Copier les valeurs", + "YourName": "Votre nom", + "IndividualName": "nom individuel", + "OutputScheme": "Schéma de sortie", + "Place": "Place", + "Levels": "niveaux" + }, + + "Calculator": { + "Title": "Calculatrice de coûts", + "HelpLink": "https://foe-rechner.de/extension/index#Kostenrechner", + "Step": "Niveau ", + "AvailableFP": "PFs disponibles", + "ArcBonus": "Bonus Arche", + "Earnings": "Gains", + "Save": "Sauver", + "Commitment": "PFs posés", + "Profit": "Gain", + "NoFPorMedsAvailable": "Pas de PFs ou plans disponible" + }, + + "StrategyPoints" : { + "Title" : "PFs - Productions", + "TotalFPs": "Total PFs pour tous les batiments: ", + "Amount": "Nombre", + "FPBar" : "PFs-Stock: " + }, + + "Productions" : { + "Title" : "Vue d'ensemble des productions", + "SearchInput": "Chercher un batiment...", + "Total" : "Totalement: ", + "ModeGroups": "Grouper", + "ModeSingle": "Individuel", + "Headings" : { + "number" : "Nombre", + "amount" : "Lot", + "earning" : "Récolte", + "greatbuilding" : "Grand monument", + "production" : "Bâtiment de production", + "random_production" : "Productions aléatoires", + "residential" : "Bâtiments événementiels", + "main_building" : "Hôtel de ville", + "all" : "Tout" + } + }, + + "Neighbors" : { + "Title" : "Production de ", + "ReadyProductions" : "Productions terminées", + "OngoingProductions" : "Productions en cours" + }, + + "Outpost" : { + "Title" : "Ressources de la colonie", + "TitleShort" : "Vue des ressources - ", + "TitleBuildings" : "Bâtiment", + "TitleFree" : "Gratuit", + "DescRequired" : "Requis", + "DescInStock" : "Disponible", + "DescStillMissing" : "Excès / Manquant", + }, + + "Settings" : { + "Title" : "Paramètres", + "Active" : "Actif", + "Inactive" : "Inactif", + } + }, + + "Menu" : { + "Productions" : { + "Title" : "Vue d'ensemble des productions", + "Desc" : "Affiche le nombre en cours de toutes les productions." + }, + "Calculator" : { + "Title" : "Calculatrice des coûts", + "Desc" : "Calcule toutes les places pour vous et les PFs pour sniper", + "Warning": "Désactivé: Ouvre d'abord un GM d'un autre joueur !" + }, + "OwnpartCalculator" : { + "Title" : "Calculatrice de up à plusieurs", + "Desc" : "Crée un plan de pose de PFs, calcul les coûts et copies les valeurs", + "Warning": "Désactivé: Ouvre d'abord un de tes GM !" + }, + "Settings" : { + "Title" : "Paramètres", + "Desc" : "Ici il y a quelques éléments à configurer" + }, + "Chat" : { + "Title" : "Chat de guilde", + "Desc" : "Discute en temps réel avec tout le monde" + }, + "Forum" : { + "Title" : "Forum", + "Desc" : "Vous avez une question? Quelque chose à proposer ? Ou juste pour parler..." + }, + "Ask" : { + "Title" : "Question / Réponse", + "Desc" : "Vous ne savez pas comment utiliser une fonctionnalité ?
Jetez un oeil ici !" + }, + "Bugs" : { + "Title" : "Erreurs / Envies", + "Desc" : "Quelque chose n'est pas comme il devrait où vous avez une idéée ?" + }, + "OutP" : { + "Title" : "Colonie", + "Desc" : "Vue d'ensemble des ressources nécessaires", + "DescWarning" : "Désactivé: Allez d'abord dans la colonie !
Vue d'ensemble des ressources nécessaires" + }, + "Info" : { + "Title" : "Info techniques", + "Desc" : "Affiche tous les éléments qui se déroulent en 'arrière plan'
Cela se remplit avec les infos ..." + } + }, + + "Settings" : { + "GlobalSend": { + "Title" : "Envoi à foe-rechner.de", + "Desc" : "Si vous voulez suivre les données avec votre guilde, activez cet élément.
Pour une utilisation personnelle, désactivez le." + }, + "SendTavernInfo": { + "Title" : "Activité PO/MO", + "Desc" : "Est-ce que les activités de PO/MO doivent être transférer quand les événements ont lieu ?" + }, + "SendGEXInfo": { + "Title" : "Evaluations des expéditions de guildes", + "Desc" : "Quand vous cliquez sur l'emplacement des expéditions de guildes ou sur le classement, les infos sont envoyées" + }, + "SendGildMemberLGInfo": { + "Title" : "Info GM des membres de la guilde", + "Desc" : "En visitant les autres membres de la guilde, les données des GM seront envoyées à foe-rechner.de quand l'option d'envoi est activé." + }, + "ShowNeighborsGoods": { + "Title" : "Récolte des voisins", + "Desc" : "Pendant la visite, montre ce qui est en cours de production" + }, + "SendInvestigations": { + "Title" : "Investissements des PFs", + "Desc" : "Ouvrir l'hôtel de ville> Nouvelles > Grand monuments ; cela enverra l'info des PFs investit" + }, + "ShowTavernBadge": { + "Title" : "Affiche un compteur sur la taverne", + "Desc" : "Dès qu'un placement dans la taverne est effectué, un compteur global apparaît." + }, + "ShowOutpost": { + "Title" : "Ressources de la colonie", + "Desc" : "Affiche un menu pour les ressources de la colonie
Note: Un rechargement du jeu est requis." + } + } +}; \ No newline at end of file diff --git a/js/web/part-calc.js b/js/web/part-calc.js index 5309174e2..193326221 100644 --- a/js/web/part-calc.js +++ b/js/web/part-calc.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 18.09.19, 18:08 Uhr + * zu letzt bearbeitet: 19.09.19, 15:30 Uhr * * Copyright © 2019 * @@ -355,7 +355,7 @@ let Parts = { h.push(''); h.push(''); - h.push('Mäzen Anteil: ' + total_maezen + (input_total > 0 ? ' +' + input_total + '' : '') + ''); + h.push('' + i18n['Boxes']['OwnpartCalculator']['PatronPart'] + ' ' + total_maezen + (input_total > 0 ? ' +' + input_total + '' : '') + ''); h.push('' + i18n['Boxes']['OwnpartCalculator']['OwnPart'] + ': ' + ownpart_total + ''); h.push(''); @@ -401,7 +401,7 @@ let Parts = { * Platz 1 */ h.push(''); - h.push('Platz 1'); + h.push('' + i18n['Boxes']['OwnpartCalculator']['Place'] + ' 1'); if(placesExt[0]['type'] === 'input'){ h.push('-'); @@ -422,7 +422,7 @@ let Parts = { if(own_parts[0] > 0 && placesExt[0]['type'] === 'input'){ h.push(''); - h.push('Eigenanteil'); + h.push('' + i18n['Boxes']['OwnpartCalculator']['OwnPart'] + ''); h.push('' + own_parts[0] + ''); h.push(''); h.push(''); @@ -435,7 +435,7 @@ let Parts = { * Platz 2 */ h.push(''); - h.push('Platz 2'); + h.push('' + i18n['Boxes']['OwnpartCalculator']['Place'] + ' 2'); if(placesExt[1]['type'] === 'input'){ h.push('-'); @@ -464,7 +464,7 @@ let Parts = { h.push(''); - h.push('Platz 3'); + h.push('' + i18n['Boxes']['OwnpartCalculator']['Place'] + ' 3'); if(placesExt[2]['type'] === 'input'){ h.push('-'); @@ -497,7 +497,7 @@ let Parts = { * Platz 4 */ h.push(''); - h.push('Platz 4'); + h.push('' + i18n['Boxes']['OwnpartCalculator']['Place'] + ' 4'); if(placesExt[3]['type'] === 'input'){ h.push('-'); @@ -529,7 +529,7 @@ let Parts = { * Platz 5 */ h.push(''); - h.push('Platz 5'); + h.push('' + i18n['Boxes']['OwnpartCalculator']['Place'] + ' 5'); if(placesExt[4]['type'] === 'input' && placesExt[4]['value'] > 0){ h.push('-'); diff --git a/js/web/productions.js b/js/web/productions.js index ca01dfc2b..0a261e28d 100644 --- a/js/web/productions.js +++ b/js/web/productions.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 19.09.19, 10:50 Uhr + * zu letzt bearbeitet: 19.09.19, 15:27 Uhr * * Copyright © 2019 * @@ -54,7 +54,7 @@ let Productions = { */ init: ()=> { - moment.locale(MainParser.getLanguage()); + moment.locale(MainParser.Language); Productions.Tabs = []; Productions.TabsContent = []; @@ -237,7 +237,6 @@ let Productions = { return ; } - HTML.Box({ 'id': 'Productions', 'title': i18n['Boxes']['Productions']['Title'], @@ -286,8 +285,8 @@ let Productions = { let tds = '' + '' + buildings[i]['name'] + '' + - '' + Number(buildings[i]['products'][type]).toLocaleString('de-DE') + '' + - '' + moment.unix(buildings[i]['at']).format('DD.MM.YYYY HH:mm') + ' Uhr' + + '' + Number(buildings[i]['products'][type]).toLocaleString(i18n['Local']) + '' + + '' + moment.unix(buildings[i]['at']).format(i18n['DateTime']) + '' + '' + moment.unix(buildings[i]['at']).fromNow() + '' + ''; @@ -313,12 +312,12 @@ let Productions = { countProducts[p] += buildings[i]['products'][p]; countAll += buildings[i]['products'][p]; - pA.push(Number(buildings[i]['products'][p]).toLocaleString('de-DE') + ' ' + GoodsNames[p]); + pA.push(Number(buildings[i]['products'][p]).toLocaleString(i18n['Local']) + ' ' + GoodsNames[p]); } } tds +='' + pA.join('
') + '' + - '' + moment.unix(buildings[i]['at']).format('DD.MM.YYYY HH:mm') + ' Uhr' + + '' + moment.unix(buildings[i]['at']).format(i18n['DateTime']) + '' + '' + moment.unix(buildings[i]['at']).fromNow() + '' + ''; @@ -358,13 +357,13 @@ let Productions = { { if(countProducts.hasOwnProperty(ca)) { - table.push('' + GoodsNames[ca] +' ' + Number(countProducts[ca]).toLocaleString('de-DE') + ''); + table.push('' + GoodsNames[ca] +' ' + Number(countProducts[ca]).toLocaleString(i18n['Local']) + ''); } } table.push(''); table.push(''); - table.push('Gesamt: ' + Number(countAll).toLocaleString('de-DE') + ''); + table.push('' + i18n['Boxes']['Productions']['Total'] + Number(countAll).toLocaleString(i18n['Local']) + ''); } else { diff --git a/js/web/strategy-points.js b/js/web/strategy-points.js index 122170b6d..71926a487 100644 --- a/js/web/strategy-points.js +++ b/js/web/strategy-points.js @@ -5,7 +5,7 @@ * Projekt: foe * * erstellt von: Daniel Siekiera - * zu letzt bearbeitet: 18.09.19, 15:28 Uhr + * zu letzt bearbeitet: 19.09.19, 15:32 Uhr * * Copyright © 2019 * @@ -57,7 +57,7 @@ let StrategyPoints = { // noch nicht im DOM? if( $('#fp-bar').length < 1 ){ - let div = $('
').attr('id', 'fp-bar').text('FP-Lager: ').append( $('').addClass('fp-storage') ); + let div = $('
').attr('id', 'fp-bar').text(i18n['Boxes']['StrategyPoints']['FPBar']).append( $('').addClass('fp-storage') ); $('body').append(div); } diff --git a/manifest.json b/manifest.json index 4e16abb66..464c9fa8c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "FoE - Helfer", - "version": "2.3.8", + "version": "2.3.8.1", "description": "Kleine Tools und Helfer für ein besseres Spieleerlebnis in Forge of Empires", "manifest_version": 2, "permissions": [