Translations and various bugfixes

This commit is contained in:
Claude Brisson
2023-12-26 09:56:52 +01:00
parent 0b0e2539be
commit 013ee6f490
4 changed files with 174 additions and 30 deletions

View File

@@ -85,7 +85,7 @@ class Translator private constructor(private val iso: String) {
// See how it impacts the remaining. // See how it impacts the remaining.
var token: String = capture // StringEscapeUtils.unescapeHtml4(capture) var token: String = capture // StringEscapeUtils.unescapeHtml4(capture)
if (StringUtils.containsOnly(token, "\r\n\t -;:.'\"/<>\u00A00123456789€[]!")) output.print(capture) else { if (StringUtils.containsOnly(token, "\r\n\t -;:.'\"/<>\u00A00123456789€[]!?")) output.print(capture) else {
token = normalize(token) token = normalize(token)
token = translate(token) token = translate(token)
output.print(token) // (StringEscapeUtils.escapeHtml4(token)) output.print(token) // (StringEscapeUtils.escapeHtml4(token))
@@ -136,7 +136,7 @@ class Translator private constructor(private val iso: String) {
get() = textAccessor[this] as String get() = textAccessor[this] as String
set(value: String) { textAccessor[this] = value } set(value: String) { textAccessor[this] = value }
private val saveMissingTranslations = System.getProperty("pairgoth.webapp.env") == "dev" private val saveMissingTranslations = WebappManager.getProperty("env") == "dev"
private val missingTranslations: MutableSet<String> = ConcurrentSkipListSet() private val missingTranslations: MutableSet<String> = ConcurrentSkipListSet()
private fun reportMissingTranslation(enText: String) { private fun reportMissingTranslation(enText: String) {
@@ -148,8 +148,12 @@ class Translator private constructor(private val iso: String) {
private val textAccessor = ASTText::class.java.getDeclaredField("ctext").apply { isAccessible = true } private val textAccessor = ASTText::class.java.getDeclaredField("ctext").apply { isAccessible = true }
private val logger = LoggerFactory.getLogger("translation") private val logger = LoggerFactory.getLogger("translation")
private val translatedTemplates: MutableMap<Pair<String, String>, Template> = ConcurrentHashMap<Pair<String, String>, Template>() private val translatedTemplates: MutableMap<Pair<String, String>, Template> = ConcurrentHashMap<Pair<String, String>, Template>()
private val punctuation = "[ \\r\\n\\t /-]|&nbsp;|&dash;|&laquo;|&raquo;:,"
private val textExtractor = Pattern.compile( private val textExtractor = Pattern.compile(
"<[^>]+\\s(?:placeholder|title)=\"(?<placeholder>[^\"]*)\"[^>]*>|(?<=>)(?:[ \\r\\n\\t\u00A0/-]|&nbsp;|&dash;)*(?<text>[^<>]+?)(?:[ \\r\\n\\t\u00A0/-]|&nbsp;|&dash;)*(?=<|$)|(?<=>|^)(?:[ \\r\\n\\t\u00A0/-]|&nbsp;|&dash;)*(?<text2>[^<>]+?)(?:[ \\r\\n\\t\u00A0/-]|&nbsp;|&dash;)*(?=<)|^(?:[ \\r\\n\\t /-]|&nbsp;|&dash;)*(?<text3>[^<>]+?)(?:[ \\r\\n\\t /-]|&nbsp;|&dash;)*(?=$)", "<[^>]+\\s(?:placeholder|title)=\"(?<placeholder>[^\"]*)\"[^>]*>|" + // text inside placeholder or title attribute
"(?<=>)(?:${punctuation})*(?<text>[^<>]+?)(?:${punctuation})*(?=<|$)|" + // text between a tag and another tag or the end
"(?<=>|^)(?:${punctuation})*(?<text2>[^<>]+?)(?:${punctuation})*(?=<)|" + // text between a tag or the beginning and another tag
"^(?:${punctuation})*(?<text3>[^<>]+?)(?:${punctuation})*(?=$)", // text between beginning and end
Pattern.DOTALL Pattern.DOTALL
) )
private val ignoredTags = setOf("head", "script", "style") private val ignoredTags = setOf("head", "script", "style")

View File

@@ -34,7 +34,7 @@
div.field:not(.hidden) { div.field:not(.hidden) {
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: space-around; justify-content: space-between;
margin: 1px; margin: 1px;
background-color: #eeeeee; background-color: #eeeeee;
&.centered { &.centered {

View File

@@ -1,28 +1,168 @@
New tournament Nouveau tournoi (docker required) (docker requis)
Open Ouvrir (java required) (java requis)
(not yet available) (pas encore disponible)
, allowing you to tweak it in any possible way. Be sure to contribute back your enhancements! , vous permettant de complètement le modifier. Noubliez pas de partager vos améliorations !
, the well known pairing system software developed by , le logiciel dappariement très connu développé par
, your Go Pairing Engine! , votre logiciel dappariement de Go !
.ui.form input[type=checkbox][name=online] { vertical-align: initial; }
13x13
19x19
1st round seeding méthode 1è ronde
9x9
: If you prefer convenience, you can simply use the : Si vous préférez la commodité, vous pouvez simplement utiliser linstance
: This mode allows you to run : Ce mode vous permet de lancer
: This mode is the best suited for big Go events like congresses, it allows to register players, enter results and manage pairing from several workstations at once. : Ce mode est le plus adapté pour de grands événements de Go comme les congrès, il permet denregistrer les joueurs, dentrer les résultats et de gérer les appariements depuis plusieurs postes à la fois.
: the : le projet
?
AGA
Add player Ajouter
At its core, &nbsp;
BIP
Browse Parcourir les sources de
Byo-yomi periods Périodes de byo-yomi
Byo-yomi stones Pierres de byo-yomi
Byo-yomi time Durée du byo-yomi
Canadian byo-yomi Byo-yomi canadien
Cancel Annuler Cancel Annuler
Infos Infos Change Mettre à jour
Next Suivant Chinese rules Règles chinoises
Pairing Appariement Close Fermer
Type Type Club Club
(pairgo / rengo) (pairgo / rengo) Compile from the sources Compiler depuis les sources
(teams of individual players) (équipes de joueurs individuels) Country Pays
Create Créer
Crit Crit
Ctr Pays
Dates Dates
Download Télécharger
Download the standalone web interface module which suits your need, then follow Télécharger le module dinterface web qui correspond à vos besoins, puis suivez
EGF
Edit Éditer
Enter the magic word Entrer le mot magique
FFG
Family name Nom de famille
First name Prénom
Fischer timing Cadence Fisher
French rules Règles françaises
Given name Prénom
Goban Goban
Hd correction Correction hd
Hd treshold Seuil hd
How to use Comment utiliser
Import Importer
Import tournament Importer un tournoi
Increment Incrément
Individual players Joueurs individuels
Information Information
Invalid tournament id Identifiant de tournoi invalide
Japanese rules Règles japonaises
Komi Komi
Launch Lancer
Launch a pairing server Lancer un serveur dappariement
Launch a standalone instance Lancer une instance indépendante
Location Lieu
Log in Se connecter
Luc Vannier Luc Vannier
MM bar Barre MM
Mac Mahon Mac Mahon
MacMahon MacMahon MacMahon MacMahon
Number of rounds Nombre de rondes Main time Temps principal
Partner teams tournament of Tournoi d'équipes partenaires de Max time Temps max
Standard tournament of individual players Tournoi standard de joueurs individuels Name Nom
Nbw Nbv
New Tournament Nouveau Tournoi
New tournament Nouveau tournoi
Next rounds seeding Méthode rondes suivantes
Num Num
OpenGotha file Fichier OpenGotha
Pair Apparier
Pair-go tournament Tournoi de pair-go
Pairing Appariement
Pairings for round Appariement pour la ronde
Participation Participation
Plc Plc
R R
Rank Niveau
Rating Classement
Register Inscrire
Registration Inscriptions
Rengo with 2 players teams Rengo par équipes de 2
Rengo with 3 players team Rengo par équipes de 3
Required field Champs requis
Results Résultats
Results for round Résultats pour la ronde
Round-robin Toutes rondes
Rounds Rondes
Rules Règles
Search... Chercher…
Short name Nom de code
Since the project is still in alpha, the sources are only available to FFG actors. If that's your case, you can access the sources here: Comme le projet est encore en « alpha », les sources sont seulement accessibles aux acteurs FFG. Si cest votre cas, vous pouvez accéder aux sources ici :
Split and fold Couper-plier
Split and random Couper-aléatoire
Split and slip Couper-glisser
Standard byo-yomi Buo-yomi standard
Standings Classement
Standings after round Classement après la ronde
Stay in the browser Rester dans le navigateur
Sudden death Mort subite
Swiss Suisse Swiss Suisse
Teams tournament of Tournoi par équipes de Team of 2 individual players Équipe de 2 joueurs individuels
Tournament dates Dates du tournoi Team of 3 individual players Équipe de 3 joueurs individuels
Tournament name Nom du tournoi Team of 4 individual players Équipe de 4 joueurs individuels
Tournament pairing Appariement du tournoi Team of 5 individual players Équipe de 5 joueurs individuels
Tournament short name Nom abbrégé du tournoi That's the best option if you feel more comfortable when running locally or whenever you want to be able to do the pairing without internet. You can choose to use either the standard interface (which is meant to look a lot like opengotha) and the web interface (by launching the engine and connecting to it using a browser). Cest la meilleure option si vous préférer le faire tourner localement ou quand vous voulez être capable de faire lappariement sans internet. Vous pouvez choisir dutiliser soit linterface standard (qui est conçue pour beaucoup ressembler à OpenGotha) soit linterface web (en lançant le moteur et en sy connectant avec un navigateur).
Time system Temps
Tournament type Type de tournoi Tournament type Type de tournoi
end date date de fin Unpair Désapparier
from du Unregister Désinscrire
players joueurs Update Mettre à jour
rounds rondes We offer you the flexibility to use Nous vous offrons la flexibilité dutiliser
short_name nom_tournoi Welcome to Bienvenue sur
start date date de début What is Quest-ce que
to au Your feedback is most welcome! Vos retours sont les bienvenus !
and uses the same algorithm internally, as well as import and export features towards its format. et utilise le même algorithme en interne, ainsi que des fonctionnalités dimport et dexport vers et depuis son format.
apache licence licence Apache
black noir
checked
"class=""tab-content"""
club club
country pays
d d
edit
first name prénom
from de
h h
hidden
in a way that best suits your needs. Here are your options: de la manière qui répond le mieux à vos besoin. Voici vos options :
instance graciously hosted by the French Go Federation. gracieusement hébergée par la Fédération Française de Go
is a Go tournament pairing engine designed to make your tournament experience effortless. est un logiciel dappariement conçu pour faciliter lorganisation de tournoi.
is the successor of est le successeur d'
k k
last name nom de famille
looser perdant
on your local computer. sur votre ordinateur local.
online tournament tournoi en ligne
opengotha OpenGotha
or ou
pairable players joueurs disponibles
pairgoth pairgoth
pairing system, ideal for championships with no handicap games, as well as the , idéal pour les championnats sans handicap, ainsi que le système dappariement
pairing system, more suited for classical tournaments and cups. It is still in an alpha stage. Future versions will support more pairing systems and more features. , plus adapté pour les tournois classiques et les coupes. Il est encore à une phase « alpha ». Les versions futures comporteront plus de systèmes dappariements et de fonctionnalités.
project is fully open source, and under the very permissive est un logiciel libre, et sous la très permissive
result résultat
selected
sources sources
sources on FFG's gitlab sur le serveur gitab de la FFG
standalone, standard interface indépendant, interface standard
standalone, web interface indépendant, interface web
standalone, web interface, via docker indépendant, interface web, via docker
table table
the configuration guide le guide de configuration
to à
unpairable players joueurs non disponibles
"value="""
version 0.1 supports the version 0.1 supporte le système dappariement
white blanc
white vs. black blanc vs. Noir
winner gagnant
{

View File

@@ -1,7 +1,7 @@
<div id="landing" class="section"> <div id="landing" class="section">
<h1>Welcome to <span class="logo">pairgoth</span>, your Go Pairing Engine!</h1> <h1>Welcome to <span class="logo">pairgoth</span>, your Go Pairing Engine!</h1>
<h2>What is <span class="logo">pairgoth</span>?</h2> <h2>What is <span class="logo">pairgoth</span>?</h2>
<p>At its core, <span class="logo">pairgoth</span> is a versatile Go tournament pairing engine designed to make your tournament experience effortless. <span class="logo">pairgoth</span> is the successor of <a href="https://github.com/lucvannier/opengotha">opengotha</a>, the well known pairing system software developed by <a href="http://vannier.info/jeux/accueil.htm">Luc Vannier</a> and uses the same algorithm internally, as well as import and export features towards its format.</p> <p><span class="logo">pairgoth</span> is a Go tournament pairing engine designed to make your tournament experience effortless. <span class="logo">pairgoth</span> is the successor of <a href="https://github.com/lucvannier/opengotha">opengotha</a>, the well known pairing system software developed by <a href="http://vannier.info/jeux/accueil.htm">Luc Vannier</a> and uses the same algorithm internally, as well as import and export features towards its format.</p>
<p><span class="logo">pairgoth</span> version 0.1 supports the <b>Swiss</b></a> pairing system, ideal for championships with no handicap games, as well as the <b>MacMahon</b> pairing system, more suited for classical tournaments and cups. It is still in an alpha stage. Future versions will support more pairing systems and more features. <a href="mailto:pairgoth@jeudego.org">Your feedback is most welcome!</a></p> <p><span class="logo">pairgoth</span> version 0.1 supports the <b>Swiss</b></a> pairing system, ideal for championships with no handicap games, as well as the <b>MacMahon</b> pairing system, more suited for classical tournaments and cups. It is still in an alpha stage. Future versions will support more pairing systems and more features. <a href="mailto:pairgoth@jeudego.org">Your feedback is most welcome!</a></p>
<h2>How to use <span class="logo">pairgoth</span>?</h2> <h2>How to use <span class="logo">pairgoth</span>?</h2>
<p>We offer you the flexibility to use <span class="logo">pairgoth</span> in a way that best suits your needs. Here are your options:</p> <p>We offer you the flexibility to use <span class="logo">pairgoth</span> in a way that best suits your needs. Here are your options:</p>
@@ -24,7 +24,7 @@
<li> <li>
<p><b>Launch a pairing server</b>: This mode is the best suited for big Go events like congresses, it allows to register players, enter results and manage pairing from several workstations at once.</p> <p><b>Launch a pairing server</b>: This mode is the best suited for big Go events like congresses, it allows to register players, enter results and manage pairing from several workstations at once.</p>
<blockquote> <blockquote>
<div>Download the standalone web interface which suits your need, then follow <a class="disabled">the configuration guide</a> (not yet available)</div> <div>Download the standalone web interface module which suits your need, then follow <a class="disabled">the configuration guide</a> (not yet available)</div>
</blockquote> </blockquote>
</li> </li>
<li> <li>