-
Notifications
You must be signed in to change notification settings - Fork 66
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
translation extraction does not contain all strings #3117
Comments
I suspect the extractor is the problem. |
please explain the workflow which produced these files. Also - if you could find an example of a string that is NOT translated and provide the location/context of that compared to strings that ARE being translated, I think that would help. I am working on some tests for the extractor which will help this I hope. |
I followed zikula-modules/Pages@b9a5bcb...89ccb5c
This works: https://github.com/zikula-modules/Legal/blob/master/Form/Type/ConfigType.php#L82 |
This works for me if I do
it produces but if I do
it produces so not sure how to proceed here. |
ok - I did this:
A pot file includes comments to indicate where the original string is located. This confirms that when specifying the domain that ONLY the then I did So this issue is that when specifying the domain, it doesn't extract strings from the |
Can you give me an example line which is not extracted when a domain is used? |
ALL strings from php files in the requested bundle. e.g. https://github.com/zikula-modules/Legal/blob/master/Form/Type/ConfigType.php#L82 This could be different than the behavior a couple days ago (from the OP) because I just changed some of this in my recent review of translations. |
It is pretty clear to me why this string is not extracted. How shall the PHP Parser, which is used to extract the strings, know that the string is of the $this->translator->trans('fosdf', [], 'zikulalegalmodule') consistently. Another solution would be to try to tell the extractor that the default domain inside a module folder should be the module name. No idea how this could be done right now. |
this is done in the twig extractor: core/src/lib/Zikula/Bundle/CoreBundle/Translation/ZikulaTwigFileExtractor.php Lines 73 to 91 in 0d3a183
|
in the php file extractor, the namespace of the file is (supposed to be) used to determine the translation domain: core/src/lib/Zikula/Bundle/CoreBundle/Translation/ZikulaPhpFileExtractor.php Lines 116 to 135 in 0d3a183
|
quite sure I've fixed this, but can only test with core stuff atm. please test with legal and other bundle-type modules (@cmfcmf MediaModule) |
correct translation domain calculation. fixes #3117
The MediaModule can't really be used to test this, because it is (almost) Craig Heydenburg [email protected] schrieb am Di., 15. Nov. 2016,
|
a quick look at some of the php and twig files indicates otherwise. |
I am not shure if this is fixed already. I have to do further analysis. But not this week. |
Expected behavior
All strings should be contained in the translation catalog.
Actual behavior
While most strings are recognised, some are not. For example in a form type class, label texts are included, but help texts are not. See this screenshot from the Legal module:
Steps to reproduce
php app/console translation:extract en --bundle=ZikulaLegalModule --output-format=pot
The text was updated successfully, but these errors were encountered: