improve translation test and fix error (#2998)

Co-authored-by: Kristoffer Grundström <swedishsailfishosuser@tutanota.com>
This commit is contained in:
Kevin Papst
2021-12-07 16:56:08 +01:00
committed by GitHub
parent 0861dbd75d
commit 9ec0280334
9 changed files with 81 additions and 15 deletions

View File

@@ -57,7 +57,7 @@ class TranslationsTest extends TestCase
$body = $english->file->body;
foreach ($body->children() as $transUnit) {
preg_match_all('/%.+%/Uu', (string) $transUnit->target, $matches);
preg_match_all('/%[a-zA-Z]{1,}%/Uu', (string) $transUnit->target, $matches);
if (!empty($matches) && !empty($matches[0])) {
asort($matches[0]);
$trans[(string) $transUnit->source] = array_values($matches[0]);
@@ -86,11 +86,9 @@ class TranslationsTest extends TestCase
$key = (string) $transUnit->source;
if (isset($transLang[$key])) {
// some special cases, which don't work properly - base translation should be changed
if (!\in_array($key, ['stats.percentUsed', 'stats.percentUsedLeft', 'stats.percentUsed_month', 'stats.percentUsedLeft_month'])) {
preg_match_all('/%.+%/Uu', (string) $transUnit->target, $matches);
asort($matches[0]);
self::assertEquals($transLang[$key], array_values($matches[0]), sprintf('Invalid replacer "%s" in "%s"', $key, basename($file)));
}
preg_match_all('/%[a-zA-Z]{1,}%/Uu', (string) $transUnit->target, $matches);
asort($matches[0]);
self::assertEquals($transLang[$key], array_values($matches[0]), sprintf('Invalid replacer "%s" in "%s"', $key, basename($file)));
$counter++;
unset($transLang[$key]);
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="sv" datatype="plaintext" original="actions.en.xlf">
<body>
@@ -98,6 +98,10 @@
<source>create-timesheet-multiuser</source>
<target>För flera användare</target>
</trans-unit>
<trans-unit id="SEyZupT" resname="invoice.cancel">
<source>invoice.cancel</source>
<target>Avbryt faktura</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="sv" datatype="plaintext" original="flashmessages.en.xlf">
<body>
@@ -54,6 +54,10 @@
<source>action.upload.error</source>
<target>Filen kunde inte laddas upp eller sparas: %reason%</target>
</trans-unit>
<trans-unit resname="action.csrf.error" id="bOE_q5R">
<source>action.csrf.error</source>
<target>Den här åtgärden kunde inte utföras: säkerhetssymbolen är ogiltig.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -1127,7 +1127,7 @@
</trans-unit>
<trans-unit id="xN7MfSA" resname="stats.percentUsed_month">
<source>stats.percentUsed_month</source>
<target>%percentaj%%% folosit în această lună</target>
<target>%percent%%% folosit în această lună</target>
</trans-unit>
<trans-unit id="zMY6gkY" resname="stats.userActiveFinancialYear">
<source>stats.userActiveFinancialYear</source>

View File

@@ -1259,6 +1259,54 @@
<source>default_value_new</source>
<target>Standardvärden för nya poster</target>
</trans-unit>
<trans-unit id="jdbtx6z" resname="action.add">
<source>action.add</source>
<target>Lägg till</target>
</trans-unit>
<trans-unit id="GzWKgBk" resname="error.directory_missing">
<source>error.directory_missing</source>
<target>Mappen "%dir%" existerar inte och kunde inte skapas.</target>
</trans-unit>
<trans-unit id="C2TGff0" resname="error.directory_protected">
<source>error.directory_protected</source>
<target>Mappen "%dir%" är skrivskyddad.</target>
</trans-unit>
<trans-unit id="HPhRbtc" resname="stats.workingTimeWeekShort">
<source>stats.workingTimeWeekShort</source>
<target>Vecka %week%</target>
</trans-unit>
<trans-unit id="gT9W2pZ" resname="status.canceled">
<source>status.canceled</source>
<target>Avbröts</target>
</trans-unit>
<trans-unit id="Wq.h4nD" resname="label.includeBudgetType_month">
<source>label.includeBudgetType_month</source>
<target>Visa post med "månatlig" budget</target>
</trans-unit>
<trans-unit id="nVulc7." resname="label.includeBudgetType_full">
<source>label.includeBudgetType_full</source>
<target>Visa poster med "livscykel"-budget</target>
</trans-unit>
<trans-unit id="61p_ckr" resname="label.hours_24">
<source>label.hours_24</source>
<target>24 timmar</target>
</trans-unit>
<trans-unit id="PCEFPeg" resname="updated_at">
<source>Updated at</source>
<target>Uppdaterades den</target>
</trans-unit>
<trans-unit id="nlwMf5w" resname="invoice_document.max_reached">
<source>invoice_document.max_reached</source>
<target>Nådde maximalt antal av %max% faktura-dokument. Du kan lägga till fler efter att en har tagits bort.</target>
</trans-unit>
<trans-unit id="9Rhadz6" resname="label.budgetType_full">
<source>label.budgetType_full</source>
<target>Livscykel</target>
</trans-unit>
<trans-unit id="f8oNzSP" resname="quick_entry.title">
<source>quick_entry.title</source>
<target>Arbetstimmar under veckan</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -6,7 +6,7 @@
<source>title</source>
<target>Nastavení</target>
</trans-unit>
<trans-unit id="lt2Y2LO" resname="timesheet">
<trans-unit id="ycErWZK" resname="timesheet">
<source>Time tracking</source>
<target>Sledování času</target>
</trans-unit>

View File

@@ -6,7 +6,7 @@
<source>title</source>
<target>Agordoj</target>
</trans-unit>
<trans-unit id="lt2Y2LO" resname="timesheet">
<trans-unit id="ycErWZK" resname="timesheet">
<source>Time tracking</source>
<target>Tempo-registrado</target>
</trans-unit>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="sv" datatype="plaintext" original="system-configuration.en.xlf">
<body>
@@ -7,8 +7,8 @@
<target state="translated">Inställningar</target>
</trans-unit>
<trans-unit id="lt2Y2LO" resname="timesheet">
<source>timesheet</source>
<target state="translated">Tidrapport</target>
<source>Time tracking</source>
<target state="translated">Tidsuppföljning</target>
</trans-unit>
<trans-unit id="PLggHn." resname="theme">
<source>theme</source>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="sv" datatype="plaintext" original="validators.en.xlf">
<body>
@@ -66,6 +66,18 @@
<source>At least one team leader must be assigned to the team.</source>
<target>Minst en teamledare måste tilldelas i teamet.</target>
</trans-unit>
<trans-unit id="rHd9_aA" resname="A project needs to be selected.">
<source>A project needs to be selected.</source>
<target>Ett projekt måste väljas.</target>
</trans-unit>
<trans-unit id="mjlH0la" resname="This timesheet is already exported.">
<source>This timesheet is already exported.</source>
<target>Den här tidsrapporten är redan exporterad.</target>
</trans-unit>
<trans-unit id="to1Q85W" resname="An activity needs to be selected.">
<source>An activity needs to be selected.</source>
<target>En aktivitet måste väljas.</target>
</trans-unit>
</body>
</file>
</xliff>