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

Feat: list translations command #15201

Closed
wants to merge 1 commit into from
Closed

Conversation

VasasA
Copy link
Contributor

@VasasA VasasA commented Dec 29, 2024

Description

This PR introduces a new command to list translations for Filament 4.x.
"You need to fix the translations where the string has changed. If you want to check the strings, you can show all translations."

Command Signature

kép

Functional changes

Example usage: list filament hungarian translations

php artisan filament:list-translations hu

Command output:
kép

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

Note: I used the code of 'check-translations' command. @saade Thank You!

@danharrin
Copy link
Member

I'm sorry I don't really understand what this command would be used for, can you explain please?

@VasasA
Copy link
Contributor Author

VasasA commented Dec 31, 2024

@danharrin The "check-translations" command helps to find missing and deleted translations. But it does not help to find typos and changed English strings. I need to see all translations (English and Hungarian string pairs) to find all errors.
Please check out this PR (which I created using the new 'list-translations' command.) The first and second fixes were typos. The third correction fixed an incomplete string: Two sentences were missing from the Hungarian translation because the English string had been changed earlier.
It is very difficult to check all translations because they are scattered in many language files. This new 'list-translations' command creates an easy-to-read list.
In the future, I will regularly check all Hungarian translations with this command and correct errors by submitting PR-s.

@danharrin
Copy link
Member

Are there ways we can improve the existing command instead of introducing a new one? I am just hesitant to introduce so much new code that very few people will ever use

@VasasA
Copy link
Contributor Author

VasasA commented Jan 1, 2025

@danharrin I like the idea. I will integrate the listing function into the "check-translations" command with --list option, and create a new PR.

@danharrin
Copy link
Member

Thanks. Maybe we can reuse some of the code?

Another piece of feedback - can we use a Laravel Prompts "table" to list instead of the -->?

@danharrin danharrin closed this Jan 2, 2025
@VasasA
Copy link
Contributor Author

VasasA commented Jan 2, 2025

I can reuse the code. The integration will be easy.
Using table() function with two columns is not practical because there are some long strings. Some of them can be multiple lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants