Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Translations: `task_board.list.title` is now "Liste" (fr), `task_board.task.links` is now "Koppelingen" (nl) and "Link" (it), `task_board.member.stakeholder` is now "Parte interesada" (es) and "Parte interessata" (it), and `task_board.recurrence.skipped` is now "Ignorada: %date%" (pt, it was the Spanish "Saltada"). `TranslationCatalogueTest` also fails now on a non-es value identical to the Spanish one (longer than 12 characters) unless allow-listed per locale as genuinely shared, and on stale entries of that allow-list.

## [2.30.0] - 2026-11-22

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/translations/NowoTaskBoardBundle.es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ task_board.link.documentation: Documentación
task_board.link.other: Otro
task_board.member.assignee: Responsable
task_board.member.reviewer: Revisor
task_board.member.stakeholder: Stakeholder
task_board.member.stakeholder: Parte interesada
task_board.member.watcher: Observador
task_board.time.estimate: Estimación
task_board.time.logged: Registrado
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/translations/NowoTaskBoardBundle.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ nav:
task_board.index.title: "Tableaux de tâches"
task_board.index.subtitle: "Organisez le travail avec des tableaux kanban, des listes et le détail des tâches."
task_board.board.title: "Tableau"
task_board.list.title: List
task_board.list.title: Liste
task_board.task.title: "Tâche"
task_board.index.create_board: "Créer un tableau"
task_board.index.your_boards: "Vos tableaux"
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/translations/NowoTaskBoardBundle.it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ task_board.flash.task_moved_next: "Attività spostata nella colonna successiva."
task_board.flash.task_moved_done: "Attività contrassegnata come completata."
task_board.task.subtasks: "Sottoattività"
task_board.task.no_subtasks: "Nessuna sottoattività."
task_board.task.links: Links
task_board.task.links: Link
task_board.task.no_links: "Nessun link per ora."
task_board.task.dependencies: "Dipendenze"
task_board.task.no_dependencies: "Nessuna dipendenza."
Expand All @@ -86,7 +86,7 @@ task_board.link.documentation: "Documentazione"
task_board.link.other: "Altro"
task_board.member.assignee: "Assegnatario"
task_board.member.reviewer: "Revisore"
task_board.member.stakeholder: Stakeholder
task_board.member.stakeholder: Parte interessata
task_board.member.watcher: "Osservatore"
task_board.time.estimate: "Stima"
task_board.time.logged: "Registrato"
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/translations/NowoTaskBoardBundle.nl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ task_board.flash.task_moved_next: "Taak verplaatst naar de volgende kolom."
task_board.flash.task_moved_done: "Taak gemarkeerd als voltooid."
task_board.task.subtasks: "Subtaken"
task_board.task.no_subtasks: "Geen subtaken."
task_board.task.links: Links
task_board.task.links: Koppelingen
task_board.task.no_links: "Nog geen links."
task_board.task.dependencies: "Afhankelijkheden"
task_board.task.no_dependencies: "Geen afhankelijkheden."
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/translations/NowoTaskBoardBundle.pt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ task_board.recurrence.reason.plan: "bloqueada pelos limites do plano; volta a te
task_board.recurrence.skip: "Saltar"
task_board.recurrence.skip_next: "Saltar a seguinte"
task_board.recurrence.skip_next_set: "A seguinte é saltada"
task_board.recurrence.skipped: "Saltada: %date%"
task_board.recurrence.skipped: "Ignorada: %date%"
task_board.recurrence.unskip: "Anular salto"
task_board.recurrence.pause: "Pausar"
task_board.recurrence.resume: "Retomar"
Expand Down
100 changes: 94 additions & 6 deletions tests/Unit/Translation/TranslationCatalogueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use function glob;
use function in_array;
use function is_array;
use function mb_strlen;
use function preg_match;
use function preg_replace;
use function sort;
Expand All @@ -23,7 +24,8 @@
/**
* Guards against untranslated strings: in every non-en catalogue (all domains) a key must exist, and a value identical to
* the English one (any length, ignoring values without letters once placeholders are removed) must be listed in
* ALLOWED_IDENTICAL for that locale. An allow-list entry that is no longer identical to English is reported as stale.
* ALLOWED_IDENTICAL for that locale. A non-es value identical to the Spanish one (longer than 12 characters, not English)
* must be listed in ALLOWED_SAME_AS_SPANISH. An allow-list entry that no longer applies is reported as stale.
*/
final class TranslationCatalogueTest extends TestCase
{
Expand Down Expand Up @@ -87,7 +89,6 @@ final class TranslationCatalogueTest extends TestCase
'task_board.link.issue',
'task_board.link.pull_request',
'task_board.link.url',
'task_board.member.stakeholder',
'task_board.multi.export.no',
'task_board.priority.normal',
'task_board.sync.details.minutes',
Expand All @@ -114,7 +115,6 @@ final class TranslationCatalogueTest extends TestCase
'task_board.link.merge_request',
'task_board.link.pull_request',
'task_board.link.url',
'task_board.list.title',
'task_board.menu.column',
'task_board.question.form.option',
'task_board.question.form.options',
Expand Down Expand Up @@ -154,15 +154,13 @@ final class TranslationCatalogueTest extends TestCase
'task_board.link.merge_request',
'task_board.link.pull_request',
'task_board.link.url',
'task_board.member.stakeholder',
'task_board.multi.export.no',
'task_board.sync.connect.provider',
'task_board.sync.details.minutes',
'task_board.sync.fields.no',
'task_board.sync.provider.clickup',
'task_board.sync.provider.unknown',
'task_board.sync.trigger.console',
'task_board.task.links',
],
'nl' => [
'nav.brand',
Expand Down Expand Up @@ -210,7 +208,6 @@ final class TranslationCatalogueTest extends TestCase
'task_board.sync.provider.clickup',
'task_board.sync.provider.unknown',
'task_board.sync.trigger.console',
'task_board.task.links',
'task_board.task.status',
'task_board.task.workflow',
],
Expand Down Expand Up @@ -238,6 +235,40 @@ final class TranslationCatalogueTest extends TestCase
],
];

/**
* Keys whose non-es value legitimately equals the Spanish one (longer than 12 characters, different from English):
* words and phrases that are genuinely the same in Spanish and the locale, per locale.
*
* @var array<string, list<string>>
*/
private const ALLOWED_SAME_AS_SPANISH = [
'it' => [
'task_board.copy.copy_title',
'task_board.import.help.col_priority',
],
'pt' => [
'task_board.board.show_less',
'task_board.calendar.sr_moved',
'task_board.dependency.relation.blocked_by',
'task_board.dependency.relation.duplicated_by',
'task_board.index.open_gantt',
'task_board.index.open_list',
'task_board.index.views_of',
'task_board.list.sort_title',
'task_board.list.total_shown',
'task_board.menu.flash.timer_started',
'task_board.menu.timer',
'task_board.multi.export.xlsx',
'task_board.number.copy_named',
'task_board.question.answered_by',
'task_board.question.form.context_help',
'task_board.question.mine.to_answer',
'task_board.question.withdrawn_by',
'task_board.recurrence.next',
'task_board.sync.fields.rating',
],
];

/** @return iterable<string, array{string, string}> */
public static function catalogues(): iterable
{
Expand Down Expand Up @@ -280,6 +311,36 @@ public function testNoUntranslatedEnglishValues(string $domain, string $locale):
self::assertSame([], $gaps, sprintf('Values identical to English in %s.%s.yaml (translate or allow-list)', $domain, $locale));
}

/** @return iterable<string, array{string, string}> */
public static function nonSpanishCatalogues(): iterable
{
foreach (self::catalogues() as $name => [$domain, $locale]) {
if ($locale !== 'es') {
yield $name => [$domain, $locale];
}
}
}

#[DataProvider('nonSpanishCatalogues')]
public function testNoSpanishLeftInOtherLocales(string $domain, string $locale): void
{
$english = $this->load($domain, 'en');
$spanish = $this->load($domain, 'es');
$target = $this->load($domain, $locale);
$allowed = self::ALLOWED_SAME_AS_SPANISH[$locale] ?? [];
$leaks = [];

foreach ($spanish as $key => $value) {
if (!isset($target[$key]) || $target[$key] !== $value || $value === ($english[$key] ?? null) || mb_strlen($value) <= 12 || in_array($key, $allowed, true)) {
continue;
}

$leaks[] = $key;
}

self::assertSame([], $leaks, sprintf('Values identical to Spanish in %s.%s.yaml (translate or allow-list)', $domain, $locale));
}

public function testAllowListHasNoStaleEntries(): void
{
$english = [];
Expand All @@ -303,6 +364,33 @@ public function testAllowListHasNoStaleEntries(): void
self::assertSame([], $stale, 'Allow-list entries that no longer exist or are no longer identical to English');
}

public function testSpanishAllowListHasNoStaleEntries(): void
{
$english = [];
$spanish = [];
$locales = [];

foreach (self::catalogues() as [$domain, $locale]) {
$english += $this->load($domain, 'en');
$spanish += $this->load($domain, 'es');
$locales[$locale] = ($locales[$locale] ?? []) + $this->load($domain, $locale);
}

$stale = [];

foreach (self::ALLOWED_SAME_AS_SPANISH as $locale => $keys) {
foreach ($keys as $key) {
$value = $spanish[$key] ?? null;

if ($value === null || ($locales[$locale][$key] ?? null) !== $value || $value === ($english[$key] ?? null) || mb_strlen($value) <= 12) {
$stale[] = $locale . ':' . $key;
}
}
}

self::assertSame([], $stale, 'Spanish allow-list entries that no longer exist or no longer equal the Spanish value');
}

/** @return array<string, string> */
private function load(string $domain, string $locale): array
{
Expand Down
Loading