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

Add lint task for translations #255

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Aug 26, 2024

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes #issuenum
Related issues/PRs sulu/sulu#7578, sulu/sulu#7577
License MIT
Documentation PR sulu/sulu-docs#prnum

What's in this PR?

Add lint task for translations.

Why?

Add a lint task to show which translation where missed when run composer lint.

bin/console debug:translation en --only-missing

Todo

@alexander-schranz alexander-schranz marked this pull request as draft August 26, 2024 15:09
@@ -164,6 +166,10 @@
"lint-php-cs": "@php vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
"lint-composer": "@composer validate --no-check-publish --strict",
"lint-twig": "@php bin/console lint:twig templates/",
"lint-xliff": "@php bin/console lint:xliff translations/",
"lint-translations": [
"@php bin/console debug:translation en --only-missing"
Copy link
Member Author

@alexander-schranz alexander-schranz Aug 26, 2024

Choose a reason for hiding this comment

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

Additonal languages a project can add itself via:

-            "@php bin/console debug:translation en --only-missing"
+            "@php bin/console debug:translation en --only-missing",
+            "@php bin/console debug:translation de --only-missing"

In some cases it may be best to translate all via:

-            "@php bin/console debug:translation en --only-missing",
+            "@php bin/console debug:translation --all en --only-missing",

But specially if more bundles are added I want may only validate my own translations and not admin bundles.

@alexander-schranz alexander-schranz added the enhancement New feature or request label Aug 26, 2024
@@ -164,6 +166,10 @@
"lint-php-cs": "@php vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
"lint-composer": "@composer validate --no-check-publish --strict",
"lint-twig": "@php bin/console lint:twig templates/",
"lint-xliff": "@php bin/console lint:xliff translations/",
Copy link
Member Author

Choose a reason for hiding this comment

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

This may make sense if a project use xliff files. still if project not using it it can remove it.

@alexander-schranz alexander-schranz marked this pull request as ready for review August 29, 2024 08:22
@chirimoya chirimoya merged commit 038dbfe into sulu:2.6 Aug 29, 2024
4 checks passed
@alexander-schranz alexander-schranz deleted the feature/lint-translations branch August 29, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants