Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(transifex): Adjust check for translation of apps #50753

Merged
Merged
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
13 changes: 9 additions & 4 deletions build/translation-checker.php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but should we also check the lib translations?
Currently it is:

$directories = [
	__DIR__ . '/../core/l10n',
];

Should it not be:

$directories = [
	__DIR__ . '/../core/l10n',
	__DIR__ . '/../lib/l10n',
];

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
'testing',
];

$txConfigAppMap = [
'dashboard' => 'dashboard-shipped-with-server',
'encryption' => 'files_encryption',
'settings' => 'settings-1',
];

// Next line only looks messed up, but it works. Don't touch it!
$rtlCharacters = [
'\x{061C}', // ARABIC LETTER MARK
Expand Down Expand Up @@ -52,10 +58,9 @@
continue;
}

if (!file_exists($app->getPathname() . '/l10n')) {
if (!str_contains($txConfig, '[o:nextcloud:p:nextcloud:r:' . $app->getBasename() . ']')) {
$errors[] = $app->getBasename() . "\n" . ' App is not translation synced via transifex and also not marked as untranslated' . "\n";
}
$resourceName = $txConfigAppMap[$app->getBasename()] ?? $app->getBasename();
if (!file_exists($app->getPathname() . '/l10n') || !str_contains($txConfig, '[o:nextcloud:p:nextcloud:r:' . $resourceName . ']')) {
$errors[] = $app->getBasename() . "\n" . ' App is not correctly configured for translation sync via transifex and also not marked as untranslated' . "\n";
continue;
}

Expand Down
Loading