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

Auto export translation keys #6662

Open
KDederichs opened this issue Dec 20, 2024 · 2 comments
Open

Auto export translation keys #6662

KDederichs opened this issue Dec 20, 2024 · 2 comments
Labels
feature help wanted Issues and PRs which are looking for volunteers to complete them.
Milestone

Comments

@KDederichs
Copy link
Contributor

Short description of what this feature will allow to do:
I don't know if it's even possible but it'd be awesome if EA could hook itself into the Translators extract command and export all the entity labels (either explicitly set or inferred by property name)

Example of how to use this feature
It would make translating the admin a lot easier since you don't have to go around and pick up all the translation keys.

@javiereguiluz
Copy link
Collaborator

Yes, this would be a nice idea. I think we need this:

(1) Symfony should provide a mechanism for third-party bundles to add translations to the catalogs. I don't know if this already exists or not and if it provides all the features we'd need or not.
(2) If this mechanism exists, let's use it in this bundle to ease translating backends.

@KDederichs could you please check if (1) already exists in Symfony? Thanks!

@javiereguiluz javiereguiluz added this to the 4.x milestone Dec 26, 2024
@javiereguiluz javiereguiluz added the help wanted Issues and PRs which are looking for volunteers to complete them. label Dec 26, 2024
@KDederichs
Copy link
Contributor Author

From the looks of it the way to go here would be to implement a custom Extractor (https://github.com/symfony/translation/blob/7.2/Extractor/ExtractorInterface.php) and then use that to push all the messages into.
Tested it locally and it seems pretty straight forward to set up, just implement the interface and tag it like this:

#[AutoconfigureTag(name: 'translation.extractor', attributes: ['alias' => 'test.extractor'])]

The main issue would be getting all the translatable things out of EA but maybe you'd have a better grasp on how to handle that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted Issues and PRs which are looking for volunteers to complete them.
Projects
None yet
Development

No branches or pull requests

2 participants