From 804f744fb33ce176f29e8e49d2289d177d9ef62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Jakse?= Date: Sun, 17 May 2020 09:03:05 +0200 Subject: [PATCH] Stop commiting built lang files --- .gitignore | 1 + Makefile | 10 ++++++---- bin/setup_prod.sh | 3 +++ l10n/makejs.js | 7 +++++-- public/l10n/js/br.js | 1 - public/l10n/js/en.js | 1 - public/l10n/js/fr.js | 1 - public/l10n/js/ro.js | 1 - 8 files changed, 15 insertions(+), 10 deletions(-) delete mode 100644 public/l10n/js/br.js delete mode 100644 public/l10n/js/en.js delete mode 100644 public/l10n/js/fr.js delete mode 100644 public/l10n/js/ro.js diff --git a/.gitignore b/.gitignore index cd8a3ea..baf3cdf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /server/games.backup.json /public/config.js +/public/l10n diff --git a/Makefile b/Makefile index 0fdac55..6e1aa29 100644 --- a/Makefile +++ b/Makefile @@ -13,15 +13,17 @@ endif all: lang help: - @echo make lang: build translation files - @echo make eslint: use ESLint to check code standard conformence + @echo make lang: build the translation files + @echo make eslint: use ESLint to check conformance against the coding style @echo make start-dev-server: start a development server -lang: +public/l10n/js/fr.js: $(wildcard l10n/po/*/*.po) cd l10n; make +lang: public/l10n/js/fr.js + eslint: -${ESLINT} **/*.js -start-dev-server: +start-dev-server: lang cd server && make start-dev-server diff --git a/bin/setup_prod.sh b/bin/setup_prod.sh index 01ec820..f4c1bf4 100755 --- a/bin/setup_prod.sh +++ b/bin/setup_prod.sh @@ -1,5 +1,8 @@ #!/usr/bin/env sh +cd .. +make + exec "$(dirname "$0")/disable-const-let.sh" if ! [ -f "$(dirname "$(dirname "$0")")/public/config.js" ]; then diff --git a/l10n/makejs.js b/l10n/makejs.js index e278d27..d15acd4 100755 --- a/l10n/makejs.js +++ b/l10n/makejs.js @@ -4,11 +4,12 @@ "use strict"; -const ROOT = "../public/l10n/"; +const ROOT = "../public/l10n/js"; /* Builds translation files. */ const fs = require("fs"); +const path = require("path"); let po; let i; @@ -60,8 +61,10 @@ function parseString() { let msgid; let msgstr; +fs.mkdirSync(ROOT, {recursive: true}); + for (const lang of fs.readdirSync("po")) { - const jsFile = fs.openSync(ROOT + "js/" + lang + ".js", "w"); + const jsFile = fs.openSync(path.join(ROOT, lang + ".js"), "w"); fs.writeSync(jsFile, "(function(){var "); let translationFunction = "translationFunction"; diff --git a/public/l10n/js/br.js b/public/l10n/js/br.js deleted file mode 100644 index e42e101..0000000 --- a/public/l10n/js/br.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var _=myAlert.l10n;_("br","OK","Mat eo");_("br","Yes","Ya");_("br","No","Ket");_("br","Cancel","Nullañ");_=trivabble.l10n;_("br","","Project-Id-Version: \nPOT-Creation-Date: \nPO-Revision-Date: \nLanguage-Team: \nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nX-Generator: Poedit 1.8.7\nLast-Translator: \nPlural-Forms: nplurals=2; plural=(n > 1);\nLanguage: br\n");_("br","Your game is not over. Are you sure you want to leave now?","N'eo ket echu ho c'hoariadenn. Sur oc'h e fell deoc'h kuitaat bremañ?");_("br","You are about to leave the current game. To recover it, please note its number: {0}","Emaoc'h o vont da guitaat ar c'hoariadenn. Evit hec'h adkavout e c'hallit notenniñ an niverenn da heul: {0}");_("br","Sorry, a problem just happened. The page must be reloaded. If the problem is not too serious, you should be able to keep playing normally. Otherwise, contact the person who is able to fix the problem. Click on “Yes” to reload the page.","Digarezit, ur gudenn a zo degouezhet. Ret eo adkargañ ar bajenn. Ma n'eo ket re bouezus ar gudenn e o tu deoc'h kenderc'hel da c'hoari. E mod all, kit e darempred gant drouizig@drouizig.org evit kempenn ar gudenn. Klikit war \"Ya\" evit adkargañ ar bajenn.");_("br","To join a game, please give the number which is displayed on your adversary(ies)' screen.\nIf you do not know it, ask them.\n\nWarning: your adversary must not take your number, (s)he must keep his/her own. If you whish to recover your current game, please not the following number: {0}.","Evit kevreañ d'ur c'hoariadenn, roit an niverenn diskouezet war skramm ho enebour(ien).\nMa n'anavezit ket anezhañ, goulennit ganto.\n\nDiwallit: ne rank ket hoc'h enebour kemer ho niverenn, ret eo dezhañ pe dezhi derc'hel (h)e hini. Ma fell deoc'h adkavout ho c'hoari bremanel, notennit an niverenn da heul: {0}.");_("br","It seems your did not give a correct number, or you clicked on “Cancel”. As a result, the current game continues, if any. To join a game, click on “Join a game” again.","War a seblant n'ho peus ket roet un niverenn dalvoudek, p ekliket ho peus war \"Nullañ\". Kendalc'het e vo gant ar c'hoari bremanel. Evit kevreañ d'ur c'hoari, klikit war \"Kevreañ d'ur c'hoari\" adarre.");_("br","To change your name, enter a new one. You can keep using your current name by cancelling. Please note that if you change your name and you have games in progress, you will not be able to keep playing them anymore unless you get back to your current name.","Evit kemmañ hoc'h anv, enankit unan nevez. Gallout a rit derc'hel hoc'h hini bremanel en ur glikañ war \"Nullañ\". Diwallit: ma kemmit hoc'h anv en ur c'hoari, ne vo ket tu deoc'h kenderc'hel da c'hoari estreget mar adlakit hoc'h anv bremanel en-dro.");_("br","You cannot take another tile: your rack is full.","N'hallit ket kement ur pezh all. Leun eo ho touger-pezhioù.");_("br","Are you sure you want to put all the tiles back in the bag (in order to play another game)?","Sur oc'h e fell deoc'h adlakaat an holl bezhioù er sac'h (evit c'hoari en-dro)?");_("br","Are you sure you want to put all your tiles back in the bag?","Sur oc'h e fell deoc'h adlakaat holl ho pezhio er sac'h?");_("br","It seems your did not give your name. You need to do it for the game to run properly.","War a-seblant n'ho peus ket roet hoc'h anv. et eo deoc'h en ober evit gellout c'hoari.");_("br","Hello! To begin, enter your name. Your adversaries will see this name when you play with them.","Demat! Evit kregiñ da c'hoari, enankit hoc'h anv. Hoc'h enebourien a welo an anv pa viot o c'hoari gante.");_("br","Double\nLetter","Lizherenn\nZoubl");_("br","Double\nWord","Ger\nDoubl");_("br","Triple\nLetter","Lizherenn\nDripl");_("br","Triple\nWord","Ger\nTripl");_("br","Join adversaries","Kevreañ gant enebourien");_("br","You are:","Hoc'h anv:");_("br","Change","Kemmañ");_("br","(name to give)","(anv da reiñ)");_("br","Put back all the tiles\nin the bag","Adlakaat an holl pezhio er sac'h");_("br","Number of your game:","Niverenn ho c'hoari:");_("br","(pending)","(o c'hortoz)");_("br","Write a message to your adversaries here","Skrivit kemennadenno d'hoc'h enebourien aze");_("br","Send message","Kas ar gemennadenn");_("br","Sound of the tiles","Son ar pezhioù");_("br","Sound of messages","Son ar c'hemennadenoù");_("br","Number of tiles in the bag:","Niver a bezhioù er sac'h:");_("br","Click on it to take one.","Klikit warnañ evit kemer unan");_("br","Put back all the tiles in the bag","Adlakaat an holl pezhioù er sac'h");_("br","Participant","C'hoarier");_("br","Rack","Douger-pezhioù");_("br","Score","Poentoù");_("br","Waiting for other participants…","O c'hortoz c'hoarien all...");_("br","Click on someone's score\nto change it.","Klikit war poentoù unan bennak\nevit kemmañ.");_("br","Put back all the tiles of\nyour rack in the bag","Adlakaat holl pezhioù ho\ntouger-pezhoù er sac'h");_("br","Interface language:","Yezh ar c'hetal:");if(trivabble.applyL10n){trivabble.applyL10n();}})(); \ No newline at end of file diff --git a/public/l10n/js/en.js b/public/l10n/js/en.js deleted file mode 100644 index 7822114..0000000 --- a/public/l10n/js/en.js +++ /dev/null @@ -1 +0,0 @@ -trivabble.applyL10n(); diff --git a/public/l10n/js/fr.js b/public/l10n/js/fr.js deleted file mode 100644 index 3764204..0000000 --- a/public/l10n/js/fr.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var _=myAlert.l10n;_("fr","OK","OK");_("fr","Yes","Oui");_("fr","No","Non");_("fr","Cancel","Annuler");_=trivabble.l10n;_("fr","Your game is not over. Are you sure you want to leave now?","Votre partie n'est pas terminée. Êtes-vous sûr·e de vouloir la quitter ?");_("fr","You are about to leave the current game. To recover it, please note its number: {0}","Vous allez quitter la partie en cours. Pour la retrouver, notez bien son numéro : {0}");_("fr","Sorry, a problem just happened. The page must be reloaded. If the problem is not too serious, you should be able to keep playing normally. Otherwise, contact the person who is able to fix the problem. Click on “Yes” to reload the page.","Désolé, une erreur s'est produite. La page doit être chargée de nouveau et si le problème n'est pas très grave, vous devriez pouvoir continuer à jouer normalement. Sinon, contactez la personne qui devrait pouvoir régler le problème. Cliquez sur « Oui » pour recharger la page.");_("fr","Enter the new score of {0}:","Saisissez le nouveau score de {0} :");_("fr","Enter the score to add to {0}:","Saisissez le score à ajouter à {0} :");_("fr","To join a game, please give the number which is displayed on your adversary(ies)' screen.\nIf you do not know it, ask them.\n\nWarning: your adversary must not take your number, (s)he must keep his/her own. If you whish to recover your current game, please not the following number: {0}.","Pour rejoindre une partie, donnez le numéro qui s'affiche chez votre (vos) adversaire(s).\nSi vous ne le connaissez pas, demandez-lui (leur).\n\nAttention : votre adversaire ne doit pas prendre votre numéro, il doit garder le sien. Si vous souhaitez retrouver votre partie actuelle plus tard, gardez le numéro suivant : {0}.");_("fr","It seems your did not give a correct number, or you clicked on “Cancel”. As a result, the current game continues, if any. To join a game, click on “Join a game” again.","Il semblerait que vous n'avez pas donné un numéro correct, ou que vous avez cliqué sur « Annuler ». Par conséquent, la partie en cours continue, s'il y a une partie en cours. Pour rejoindre une partie, cliquez à nouveau sur « Rejoindre une partie ».");_("fr","To change your name, enter a new one. You can keep using your current name by cancelling. Please note that if you change your name and you have games in progress, you will not be able to keep playing them anymore unless you get back to your current name.","Pour changer de nom, saisissez-en un nouveau. Vous pouvez continuer à utiliser votre ancien nom en annulant. Veuillez noter que si vous changez de nom et que vous avez des parties en cours, vous ne pourrez plus jouer à celles-ci, sauf si vous reprenez votre ancien nom.");_("fr","You cannot take another tile: your rack is full.","Vous ne pouvez pas tirer de pièce : votre chevalet est complet.");_("fr","Are you sure you want to put all the tiles back in the bag (in order to play another game)?","Êtes-vous sûr·e de vouloir remettre toutes les lettres du jeu dans le sac (en vue de jouer une nouvelle partie) ?");_("fr","Are you sure you want to put all your tiles back in the bag?","Êtes-vous sûr·e de vouloir remettre toutes vos lettres dans le sac ?");_("fr","It seems your did not give your name. You need to do it for the game to run properly.","Il semblerait que vous n'avez pas renseigné votre nom. Il est nécessaire de le faire pour le bon déroulement du jeu.");_("fr","Hello! To begin, enter your name. Your adversaries will see this name when you play with them.","Bonjour ! Pour commencer, saisissez votre nom. Vos adversaires verront ce nom quand vous jouerez avec eux.");_("fr","Double\nLetter","Lettre\nDouble");_("fr","Double\nWord","Mot\nDouble");_("fr","Triple\nLetter","Lettre\nTriple");_("fr","Triple\nWord","Mot\nTriple");_("fr","Join adversaries","Rejoindre des adversaires");_("fr","You are:","Vous êtes :");_("fr","Change","Changer");_("fr","(name to give)","(nom à renseigner)");_("fr","Put back all the tiles\nin the bag","Remettre toutes les pièces\ndans le sac");_("fr","Number of your game:","Numéro de votre partie :");_("fr","(pending)","(en attente)");_("fr","Write a message to your adversaries here","Écrivez un message à vos adversaires ici");_("fr","Send message","Envoyer le message");_("fr","Sound of the tiles","Bruit des pièces");_("fr","Sound of messages","Bruit des messages");_("fr","Number of tiles in the bag:","Nombre de pièces dans le sac :");_("fr","Click on it to take one.","Cliquez dessus pour en prendre une.");_("fr","Put back all the tiles in the bag","Ranger toutes les pièces dans le sac");_("fr","Participant","Participant·e");_("fr","Rack","Chevalet");_("fr","Score","Score");_("fr","Waiting for other participants…","En attente des autres participants…");_("fr","Click on someone's score\nto change it.","Cliquez sur le score de quelqu'un\npour le changer.");_("fr","Put back all the tiles of\nyour rack in the bag","Remettre toutes les pièces du\nchevalet dans le sac");_("fr","Interface language:","Langue de l'interface :");_("fr","Sorry to disturb you, but we need to reload the game so you can continue playing. You will not lose anything except the messages in the chat. Are you ready?","Désolé pour le dérangement, mais nous avons besoin de recharger le jeu pour que vous poussiez continuer à jouer. Vous ne perdrez rien sauf les messages dans le chat. Êtes-vous prêt·e ?");_("fr","To continue playing, click here","Pour continuer à jouer, cliquez ici");_("fr","{0}: ","{0} : ");_("fr","Whoops, there is a problem. We are trying to fix it as soon as possible. Please wait a few seconds. If it persists, please contact the person who is able to fix the problem.","Oups, il y a un problème. Nous essayons de corriger cela le plus vite possible. Merci de bien vouloir patienter quelques secondes. Si cela persiste, n’hésitez pas à contacter la personne qui peut s’occuper de ce problème");_("fr","The problem is solved, sorry for the inconvenience!","Le problème est résolu. Désolé pour la gêne occasionnée !");_("fr","It seems your browser went offline. Please reconnect to continue playing.","On dirait que votre navigateur est hors ligne. Merci de bien vouloir vous reconnecter pour continuer à jouer.");_("fr","Turn","Tour");_("fr","Who's turn? Click on the Turn button!","À qui le tour ? Cliquez sur le bouton Tour !");_("fr","Show my rack to other players","Montrer mon jeu aux autres");_("fr","Are you sure you want to show your rack to everybody?","Êtes-vous sûr·e de vouloir montrer votre jeu à tout le monde ?");_("fr","jocker","jocker");_("fr","Here is my rack:","Voici mon jeu :");_("fr","{0} shows their rack:","{0} montre son jeu :");_("fr","You cannot take another tile: the bag is empty.","Vous ne pouvez pas tirer de pièce : le sac est vide.");_("fr","Are you sure you want to change board to '{0}'? This will put all the tiles back in the bag and start another game.","Êtes-vous sûr·e de vouloir de changer la langue du plateau à '{0}' ? Cela remettra toutes les lettres du jeu dans le sac et commencera une nouvelle partie.");_("fr","Board language:","Langue du plateau :");_("fr","English","Anglais");_("fr","French","Français");_("fr","German","Allemand");_("fr","Spanish","Espagnol");_("fr","You changed the language of the board to {0}","Vous avez changé la langue du plateau en {0}");_("fr","{0} changed the language of the board to {1}","{0} a changé la langue du plateau en {1}");if(trivabble.applyL10n){trivabble.applyL10n();}})(); \ No newline at end of file diff --git a/public/l10n/js/ro.js b/public/l10n/js/ro.js deleted file mode 100644 index 563eace..0000000 --- a/public/l10n/js/ro.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var _=myAlert.l10n;_("ro","OK","OK");_("ro","Yes","Da");_("ro","No","Nu");_("ro","Cancel","Anulează");_=trivabble.l10n;_("ro","Your game is not over. Are you sure you want to leave now?","Jocul tău nu s-a terminat. Sigur vrei să ieși acum?");_("ro","You are about to leave the current game. To recover it, please note its number: {0}","Ești pe cale să ieși din jocul curent. Pentru a reveni la el, notează-i numărul: {0}");_("ro","Sorry, a problem just happened. The page must be reloaded. If the problem is not too serious, you should be able to keep playing normally. Otherwise, contact the person who is able to fix the problem. Click on “Yes” to reload the page.","Ne pare rău, tocmai a apărut o problemă. Pagina trebuie reîncărcată. Dacă problema nu este prea serioasă, ar trebui să poți continua jocul în mod normal. Altfel, contactează persoana care poate să repare problema. Apasă \"Da\" pentru a reîncărca pagina.");_("ro","Enter the new score of {0}:","Introdu noul scor pentru {0}:");_("ro","Enter the score to add to {0}:","Introdu scorul de adăugat pentru {0}:");_("ro","To join a game, please give the number which is displayed on your adversary(ies)' screen.\nIf you do not know it, ask them.\n\nWarning: your adversary must not take your number, (s)he must keep his/her own. If you whish to recover your current game, please not the following number: {0}.","Pentru a te alătura unui joc, introdu numărul care este afișat pe ecranul adversarului (adversarilor).\nDacă nu îl știi, întreabă-i.\n\nAtenție: adversarii nu trebuie să preia numărul tău, trebuie să și-l păstreze pe al lor. Dacă vrei să revii mai târziul la jocul curent, notează numărul următor: {0}.");_("ro","It seems your did not give a correct number, or you clicked on “Cancel”. As a result, the current game continues, if any. To join a game, click on “Join a game” again.","Se pare că nu ai introdus un număr corect, sau ai apăsat pe \"Anulează\". În consecință, jocul curent continuă, dacă există. Pentru a te alătura unui joc, apasă pe \"Alătură-te unui joc\" din nou.");_("ro","To change your name, enter a new one. You can keep using your current name by cancelling. Please note that if you change your name and you have games in progress, you will not be able to keep playing them anymore unless you get back to your current name.","Pentru a-ți schimba numele, introdu unul nou. Poți continua să-ți folosești numele curent anulând. Atenție, dacă îți schimbi numele și ai jocuri începute, nu vei mai putea continua să le joci decât dacă revii la numele de acum.");_("ro","You cannot take another tile: your rack is full.","Nu poți lua încă un jeton: suportul tău este plin.");_("ro","Are you sure you want to put all the tiles back in the bag (in order to play another game)?","Sigur vrei să pui toate jetoanele înapoi în sac (ca să joci alt joc)?");_("ro","Are you sure you want to put all your tiles back in the bag?","Sigur vrei să-ți pui toate jetoanele înapoi în sac?");_("ro","It seems your did not give your name. You need to do it for the game to run properly.","Se pare că nu ți-ai dat numele. Trebuie s-o faci pentru ca jocul să poată rula.");_("ro","Hello! To begin, enter your name. Your adversaries will see this name when you play with them.","Salut! Pentru a începe, introdu-ți numele. Adversarii tăi vor vedea acest nume când joci cu ei.");_("ro","Double\nLetter","Literă\nDublă");_("ro","Double\nWord","Cuvânt\nDublu");_("ro","Triple\nLetter","Literă\nTriplă");_("ro","Triple\nWord","Cuvânt\nTriplu");_("ro","Join adversaries","Alătură-te unor adversari");_("ro","You are:","Tu ești:");_("ro","Change","Schimbă");_("ro","(name to give)","(numele de atribuit)");_("ro","Put back all the tiles\nin the bag","Pune toate jetoanele\nînapoi în sac");_("ro","Number of your game:","Numărul jocului tău:");_("ro","(pending)","(în așteptare)");_("ro","Write a message to your adversaries here","Scrie aici un mesaj către adversarii tăi");_("ro","Send message","Trimite mesaj");_("ro","Sound of the tiles","Sunet de la jetoane");_("ro","Sound of messages","Sunet de la mesaje");_("ro","Number of tiles in the bag:","Număr de jetoane în sac:");_("ro","Click on it to take one.","Apasă pe el ca să iei unul.");_("ro","Put back all the tiles in the bag","Pune toate jetoanele înapoi în sac");_("ro","Participant","Participant");_("ro","Rack","Suport");_("ro","Score","Scor");_("ro","Waiting for other participants…","În așteptarea altor participanți…");_("ro","Click on someone's score\nto change it.","Apasă pe scorul cuiva\npentru a-l schimba.");_("ro","Put back all the tiles of\nyour rack in the bag","Pune înapoi în sac toate\njetoanele de pe suportul tău");_("ro","Interface language:","Limba interfeței:");_("ro","Sorry to disturb you, but we need to reload the game so you can continue playing. You will not lose anything except the messages in the chat. Are you ready?","Scuze că te deranjăm, dar trebuie să reîncărcăm pagina ca să poți continua să joci. Nu vei pierde nimic în afară de mesajele din chat. Ești gata?");_("ro","To continue playing, click here","Pentru a continua să joci, apasă aici");_("ro","{0}: ","{0}: ");_("ro","Whoops, there is a problem. We are trying to fix it as soon as possible. Please wait a few seconds. If it persists, please contact the person who is able to fix the problem.","Hopa, avem o problemă. Încercăm să o reparăm cât se poate de repede. Te rugăm așteaptă câteva secunde. Dacă persistă, contactează persoana care poate repara problema.");_("ro","The problem is solved, sorry for the inconvenience!","Problema s-a rezolvat, scuze pentru inconveniență!");_("ro","It seems your browser went offline. Please reconnect to continue playing.","Se pare că browserul tău s-a deconectat. Reconectează-te pentru a continua jocul.");_("ro","Turn","Rând");_("ro","Who's turn? Click on the Turn button!","Al cui este rândul? Apasă pe butonul Rând!");_("ro","Show my rack to other players","Arată suportul meu celorlalți jucători");_("ro","Are you sure you want to show your rack to everybody?","Sigur vrei să-ți arăți suportul cu jetoane celorlalți jucători?");_("ro","jocker","joker");_("ro","Here is my rack:","Iată suportul meu:");_("ro","{0} shows their rack:","{0} își arată suportul:");_("ro","You cannot take another tile: the bag is empty.","Nu poți lua alt jeton: sacul este gol.");if(trivabble.applyL10n){trivabble.applyL10n();}})(); \ No newline at end of file