From aa52e08521c2007ac109ebe90a9e4497ea175a0f Mon Sep 17 00:00:00 2001 From: adrienmalin <41926238+adrienmalin@users.noreply.github.com> Date: Sun, 11 Nov 2018 17:35:17 +0100 Subject: [PATCH] Update translation, correct tetroI --- src/main/python/game_gui.py | 65 +++----- src/main/python/main.py | 4 +- src/main/python/tetromino.py | 2 +- src/main/resources/base/locale/Tetris2000.ts | 135 ++++++++-------- src/main/resources/base/locale/fr.qm | Bin 6799 -> 4959 bytes src/main/resources/base/locale/fr.ts | 149 +++++++++++------- src/main/resources/base/locale/update_ts.bat | 2 +- .../base/locale/update_ts_noobsolete.bat | 2 +- 8 files changed, 195 insertions(+), 164 deletions(-) diff --git a/src/main/python/game_gui.py b/src/main/python/game_gui.py index 41ca5ec..d0066b4 100644 --- a/src/main/python/game_gui.py +++ b/src/main/python/game_gui.py @@ -7,6 +7,7 @@ import itertools import locale import os import time +import functools from PyQt5 import QtWidgets, QtCore, QtGui, QtMultimedia QtCore.Signal = QtCore.pyqtSignal @@ -588,6 +589,7 @@ class Stats(QtWidgets.QWidget): self.mini_t_spin_total = 0 self.nb_back_to_back = 0 self.back_to_back_scores = None + self.max_back_to_back_score = 0 self.combo = -1 self.combos_total = 0 self.max_combo = 0 @@ -691,6 +693,7 @@ class Stats(QtWidgets.QWidget): self.temporary_text.emit( self.tr("BACK TO BACK\n{:n}").format(b2b_score) ) + self.max_back_to_back_score = max(self.max_back_to_back_score, b2b_score) self.back_to_back_scores = None self.high_score = max(self.score_total, self.high_score) @@ -717,56 +720,38 @@ class Stats(QtWidgets.QWidget): painter.drawText( QtCore.QRectF(self.rect()), self.text(sep="\n\n"), self.text_options ) + + """ + Returns a strings representing number with the locale thousand separator + """ + thousand_separated = functools.partial(locale.format, "%i", grouping=True, monetary=True) def text(self, full_stats=False, sep="\n"): text = ( - self.tr("Score: ") - + locale.format("%i", self.score_total, grouping=True, monetary=True) - + sep - + self.tr("High score: ") - + locale.format("%i", self.high_score, grouping=True, monetary=True) - + sep + self.tr("Score: ") + self.thousand_separated(self.score_total) + sep + + self.tr("High score: ") + self.thousand_separated(self.high_score) + sep + self.tr("Time: {}\n").format( time.strftime("%H:%M:%S", time.gmtime(self.chronometer)) - ) - + sep - + self.tr("Level: ") - + locale.format("%i", self.level, grouping=True, monetary=True) - + sep - + self.tr("Goal: ") - + locale.format("%i", self.goal, grouping=True, monetary=True) - + sep - + self.tr("Lines: ") - + locale.format( - "%i", self.complete_lines_total, grouping=True, monetary=True - ) - + sep - + self.tr("Mini T-Spins: ") - + locale.format("%i", self.mini_t_spin_total, grouping=True, monetary=True) - + sep - + self.tr("T-Spins: ") - + locale.format("%i", self.t_spin_total, grouping=True, monetary=True) - + sep - + self.tr("Back-to-back: ") - + locale.format("%i", self.nb_back_to_back, grouping=True, monetary=True) - + sep - + self.tr("Max combo: ") - + locale.format("%i", self.max_combo, grouping=True, monetary=True) - + sep - + self.tr("Combos: ") - + locale.format("%i", self.combos_total, grouping=True, monetary=True) + ) + sep + + self.tr("Level: ") + self.thousand_separated(self.level) + sep + + self.tr("Goal: ") + self.thousand_separated(self.goal) + sep + + self.tr("Lines: ") + self.thousand_separated(self.complete_lines_total) + sep + + self.tr("Mini T-Spins: ") + self.thousand_separated(self.mini_t_spin_total) + sep + + self.tr("T-Spins: ") + self.thousand_separated(self.t_spin_total) + sep + + self.tr("Back-to-backs: ") + self.thousand_separated(self.nb_back_to_back) + sep + + self.tr("Max back-to-back score: ") + self.thousand_separated(self.max_back_to_back_score) + sep + + self.tr("Max combo: ") + self.thousand_separated(self.max_combo) + sep + + self.tr("Combos: ") + self.thousand_separated(self.combos_total) ) if full_stats: minutes = self.chronometer / 60 text += ( - "\n" - + sep + "\n" + sep + self.tr("Lines per minute: {:.1f}").format( self.complete_lines_total / minutes - ) - + sep + ) + sep + self.tr("Tetrominos locked down: ") - + locale.format("%i", self.nb_tetro, grouping=True, monetary=True) + + self.thousand_separated(self.nb_tetro) + sep + self.tr("Tetrominos per minute: {:.1f}").format( self.nb_tetro / minutes @@ -774,9 +759,7 @@ class Stats(QtWidgets.QWidget): + sep ) text += sep.join( - score_type["name"] - + self.tr(": ") - + locale.format("%i", nb, grouping=True, monetary=True) + score_type["name"] + self.tr(": ") + self.thousand_separated(nb) for score_type, nb in tuple(zip(consts.SCORES, self.lines_stats))[1:] ) return text diff --git a/src/main/python/main.py b/src/main/python/main.py index e8bff34..007a750 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -8,11 +8,11 @@ Parts of comments issued from 2009 Tetris Design Guideline """ +import sys + from fbs_runtime.application_context import ApplicationContext from game_gui import Window -import sys - class AppContext(ApplicationContext): # 1. Subclass ApplicationContext def run(self): # 2. Implement run() win = Window(self) diff --git a/src/main/python/tetromino.py b/src/main/python/tetromino.py index f70949c..4ac054e 100644 --- a/src/main/python/tetromino.py +++ b/src/main/python/tetromino.py @@ -162,7 +162,7 @@ class TetroI(Tetromino, metaclass=MetaTetro): four minoes in a straight line """ - COORDS = (L, 0), (0, 0), (R, 0), (2 * R, 0) + COORDS = (0, 0), (L, 0), (R, 0), (2 * R, 0) SUPER_ROTATION_SYSTEM = ( { COUNTERCLOCKWISE: ((0, D), (L, D), (2 * R, D), (L, U), (2 * R, 2 * D)), diff --git a/src/main/resources/base/locale/Tetris2000.ts b/src/main/resources/base/locale/Tetris2000.ts index 8d1486a..5dbd1b7 100644 --- a/src/main/resources/base/locale/Tetris2000.ts +++ b/src/main/resources/base/locale/Tetris2000.ts @@ -3,39 +3,39 @@ Frames - + New game - + A game is in progress. Do you want to abord it? - + Start level: - + High score - + Game over - + Congratulations! You have the high score: {} - + Score: {} High score: {} @@ -44,13 +44,13 @@ High score: {} Matrix - + Level - + PAUSE Press %s @@ -58,7 +58,7 @@ to resume - + GAME OVER @@ -67,97 +67,97 @@ OVER SettingStrings - + Keyboard settings - + Move left - + Move right - + Rotate clockwise - + Rotate counterclockwise - + Soft drop - + Hard drop - + Hold - + Pause - + Other settings - + Delays - + Auto-shift delay - + Auto-repeat rate - + Sound - + Music volume - + Effects volume - + Show ghost piece - + Show next queue - + Hold enabled @@ -165,7 +165,7 @@ OVER SettingsDialog - + Settings @@ -173,137 +173,148 @@ OVER Stats - + High score - + COMBO x{:n} {:n} - + BACK TO BACK {:n} - + Score: - + High score: - + Time: {} - + Level: - + Goal: - + Lines: - + Mini T-Spins: - + T-Spins: - - Back-to-back: - - - - + Max combo: - + Combos: - + Lines per minute: {:.1f} - + Tetrominos locked down: - + Tetrominos per minute: {:.1f} - + : + + + COMBO +{:n} + + + + + Back-to-backs: + + + + + Max back-to-back score: + + Window - + &New game - + &Settings - + &About - + Quit game? - + A game is in progress. Do you want to abord it? - + High score - - Tetris® clone by Adrien Malingrey + + Tetris® clone by Adrien Malingrey -Tetris Game Design by Alekseï Pajitnov +Tetris Game Design by Alekseï Pajitnov Graphism inspired by Tetris Effect Window style sheet: qdarkstyle by Colin Duquesnoy Fonts by Markus Koellmann, Peter Wiegel @@ -313,7 +324,7 @@ Pexels.com by Min An, Jaymantri, Felix Mittermeier Pixabay.com by LoganArt Pixnio.com by Adrian Pelletier Unsplash.com by Aron, Patrick Fore, Ilnur Kalimullin, Gabriel Garcia Marengo, Adnanta Raharja -StockSnap.io by Nathan Anderson, José Ignacio Pompé +StockSnap.io by Nathan Anderson, José Ignacio Pompé Musics from ocremix.org by: CheDDer Nardz, djpretzel, MkVaff, Sir_NutS, R3FORGED, Sir_NutS Sound effects made with voc-one by Simple-Media diff --git a/src/main/resources/base/locale/fr.qm b/src/main/resources/base/locale/fr.qm index 4077ed7ff8c290558a90237b629e7f1f4ddd9a68..101240791c2d00e36ee1db2883186f42da7cf8f7 100644 GIT binary patch delta 498 zcmX|*Pe>F|9LK-&X6Mg7r`eH|@#4BcyFw|1CFCAN#;e-~;&u~vrxhf1WoKojWwc9W zA*`|>D3)C|3qp+Tq*x-NQJuUgX@+&^AVLTA=ueh9y!U{+?yo9_4*DTTBA-DJ#wl09axR(;I*<&%S+{1hjs({mum{Zit>u+Fz2y>=g?T z?u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Npy6aGIb;^k3cd!nLP9d0VGjwa_{DKGFkmg#+cO1g5T0QT zxJi674A{0vP2iW0Tf-E}JpVF8#7TI1T_nARQdw~Ek-RnGeCh5UI|jpwxbQ9k%$=jg zV>t{s3b!Q_0ujUz4PY%Z=U}B+Ix-2;EMIhf`-se!j&^{clBQ6)(W@$TG zG7Xi+aMv^UjI(Iu`1kFPG?9W|6;YpR}8-%1XgC!kLUm2fn1dJ;Fm@}ASr-F z?^FDN%4dtwg>d(nVt{Ewa+Fb=jzfWrZrKp8P_tFm&eaaWd=FG|L9 zhpg$E(u_B4f&tHz8Ax6kr3VL7$ZdPtno@dpZ?%g!unrjc<%Hjo;cq{OIl>?Jq? z)NobPR>qpKmt!#YfO8xb@Uc0_;Yh#oUx4u#yhNEoRg8K@ zrNp?S>qbmMb+_(7ffVGD)qV diff --git a/src/main/resources/base/locale/fr.ts b/src/main/resources/base/locale/fr.ts index fff7efc..b26e59f 100644 --- a/src/main/resources/base/locale/fr.ts +++ b/src/main/resources/base/locale/fr.ts @@ -1,44 +1,44 @@ - + Frames - + New game Nouvelle partie - + A game is in progress. Do you want to abord it? Une partie est en cours. Voulez-vous l'abandonner ? - + Start level: Commencer au niveau : - + High score Meilleur score - + Game over Partie terminée - + Congratulations! You have the high score: {} Bravo ! Vous avez atteint le meilleur score : {} - + Score: {} High score: {} Score : {} @@ -48,14 +48,14 @@ Meilleur score : {} Matrix - + Level Niveau - + PAUSE Press %s @@ -67,7 +67,7 @@ Appuyez sur pour reprendre - + GAME OVER PARTIE @@ -77,97 +77,97 @@ TERMINÉE SettingStrings - + Keyboard settings Configuration du clavier - + Move left Déplacer à gauche - + Move right Déplacer à droite - + Rotate clockwise Tourner dans le sens horaire - + Rotate counterclockwise Tourner dans le sens anti-horaire - + Soft drop Chute lente - + Hard drop Chute rapide - + Hold Réserve - + Pause Pause - + Other settings Autres paramètres - + Delays Temporisation - + Auto-shift delay Délai avant répétition - + Auto-repeat rate Vitesse de répétition - + Sound Son - + Music volume Volume de la musique - + Effects volume Volume des effets sonores - + Show ghost piece Afficher la pièce fantôme - + Show next queue Afficher les 6 prochaines pièces - + Hold enabled Activer la réserve @@ -175,7 +175,7 @@ TERMINÉE SettingsDialog - + Settings Préférences @@ -183,133 +183,150 @@ TERMINÉE Stats - + High score Meilleur score - + COMBO x{:n} {:n} COMBO x{:n} {:n} - + BACK TO BACK {:n} BACK TO BACK {:n} - + Time: {} Temps : {} - + Lines per minute: {:.1f} Lignes par minute : {:.1f} - + Tetrominos per minute: {:.1f} Tétrominos par minute : {:.1f} - + Score: Score : - + High score: Meilleur score : - + Level: Niveau : - + Goal: Objectif : - + Lines: Lignes : - + Mini T-Spins: Mini T-Spins : - + T-Spins: T-Spins : Back-to-back: - Back-to-back : + Back-to-back : - + Max combo: Combo max : - + Combos: Combos : - + Tetrominos locked down: Tétrominos bloqués : - + : : + + + COMBO +{:n} + COMBO +{:n} + + + + Back-to-backs: + Back-to-backs : + + + + Max back-to-back score: + Score max back-to-back : + Window - + High score Meilleur score - + &New game &Nouvelle partie - + &Settings &Préférences - + &About &À propos - + A game is in progress. Do you want to abord it? Une partie est en cours. Voulez-vous l'abandonner ? - + Quit game? Quitter la partie ? @@ -331,7 +348,7 @@ StockSnap.io by Nathan Anderson, José Ignacio Pompé Musics from ocremix.org by: CheDDer Nardz, djpretzel, MkVaff, Sir_NutS, R3FORGED, Sir_NutS Sound effects made with voc-one by Simple-Media - Clone de Tetris® par Adrien Malingrey + Clone de Tetris® par Adrien Malingrey Conception du jeu : Alekseï Pajitnov Graphismes inspirés de Tetris Effect @@ -348,5 +365,25 @@ Musiques issues de ocremix.org par : CheDDer Nardz, djpretzel, MkVaff, Sir_NutS, R3FORGED, Sir_NutS Effets sonores réalisés avec voc-one de Simple-Media + + + Tetris® clone by Adrien Malingrey + +Tetris Game Design by Alekseï Pajitnov +Graphism inspired by Tetris Effect +Window style sheet: qdarkstyle by Colin Duquesnoy +Fonts by Markus Koellmann, Peter Wiegel +Images from: +OpenGameArt.org by beren77, Duion +Pexels.com by Min An, Jaymantri, Felix Mittermeier +Pixabay.com by LoganArt +Pixnio.com by Adrian Pelletier +Unsplash.com by Aron, Patrick Fore, Ilnur Kalimullin, Gabriel Garcia Marengo, Adnanta Raharja +StockSnap.io by Nathan Anderson, José Ignacio Pompé +Musics from ocremix.org by: +CheDDer Nardz, djpretzel, MkVaff, Sir_NutS, R3FORGED, Sir_NutS +Sound effects made with voc-one by Simple-Media + + diff --git a/src/main/resources/base/locale/update_ts.bat b/src/main/resources/base/locale/update_ts.bat index 3d63f31..d42e3f0 100644 --- a/src/main/resources/base/locale/update_ts.bat +++ b/src/main/resources/base/locale/update_ts.bat @@ -1,3 +1,3 @@ -for /F %%n in ('dir /B *.ts') do pylupdate5 -verbose ..\window.py ..\settings.py ..\stats.py ..\matrix.py ..\frames.py -ts %%n +for /F %%n in ('dir /B *.ts') do pylupdate5 -verbose ..\..\..\python\game_gui.py -ts %%n echo You may need to edit *.ts files with a text editor to correct special characters pause diff --git a/src/main/resources/base/locale/update_ts_noobsolete.bat b/src/main/resources/base/locale/update_ts_noobsolete.bat index ec5e66d..ccb9f3b 100644 --- a/src/main/resources/base/locale/update_ts_noobsolete.bat +++ b/src/main/resources/base/locale/update_ts_noobsolete.bat @@ -1,3 +1,3 @@ -for /F %%n in ('dir /B *.ts') do pylupdate5 -verbose ..\window.py ..\settings.py ..\stats.py ..\matrix.py ..\frames.py -ts -noobsolete %%n +for /F %%n in ('dir /B *.ts') do pylupdate5 -verbose ..\..\..\python\game_gui.py -ts -noobsolete %%n echo You may need to edit *.ts files with a text editor to correct special characters pause