-
Notifications
You must be signed in to change notification settings - Fork 52
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
i18n make-pot and minified js files #140
Comments
This will probably due to the way the build system for |
That's actually a good thing, because when translators want to see where strings are used, they can just check out the source.
What does the POT file have to do with this? As long as your JSON files are named |
Sorry to report the bug.
But maybe it would make more sense to go and try what i described and you
will find the same: if using boilerplates and/or if the js file is
minified, the strings simply won't get translated.
Am Di., 12. Feb. 2019, 10:55 hat Pascal Birchler <[email protected]>
geschrieben:
… However if i am using boilerplates like create-guten-block, then i18n
make-pot extracts strings from .js files located under /src/blocks (where
we just develop them)
That's actually a good thing, because when translators want to see where
strings are used, they can just check out the source.
Now that is a problem as WP uses this file in GB editor, but in the .pot
file there are no references to this .js file and as a consequense no
string located in the production .js file gets translated.
What does the POT file have to do with this?
As long as your JSON files are named textdomain-locale-scripthandle.json
then WP will use them for translations just fine.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFhCBz6U5kloQWQV1qAzd0zwStH7oSo9ks5vMo-egaJpZM4aiRQO>
.
|
All bug reports are welcome. Please do me the favor and keep a friendly and constructive attitude, though. @swissspidy is just making sure that your expectations are correct before we spend too much time on going through the code. That is standard procedure for maintaining a complex piece of code like WP-CLI. If your expectations are indeed the correct ones but you still don't get the result you should, then we will of course further investigate what the issue might be. Thanks! |
I really was not unfriendly.
I reported a phenomenon and just got a strange response instead of looking
into the problem.
That is why i responded it would make more sense trying to write a block
with minified js files and/or with boilerplates.
If i was a great js programmer i would have proposed a patch, but
unfortunately i am not so i just can report a bug.
Cheers!
Am Di., 12. Feb. 2019, 11:13 hat Alain Schlesser <[email protected]>
geschrieben:
… All bug reports are welcome.
Please do me the favor and keep a friendly and constructive attitude,
though. @swissspidy <https://github.com/swissspidy> is just making sure
that your expectations are correct before we spend too much time on going
through the code. That is standard procedure for maintaining a complex
piece of code like WP-CLI.
If your expectations are indeed the correct ones but you still don't get
the result you should, then we will of course further investigate what the
issue might be.
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFhCB8g8f_hrKYxT3NNroGGxN3boEmVmks5vMpO5gaJpZM4aiRQO>
.
|
It was definitely not my intention to offend you or anything. It would be really helpful if you could give us more information about your setup, i.e. file names, folder structure, text domain, etc. Because "it won't get translated" is very broad. https://pascalbirchler.com/internationalization-in-wordpress-5-0/ has a good tutorial of how to get things running. As I said before, it's probably just an issue of naming your JSON files properly. |
Thanks, will write a summary what exactly i was doing.
Am Di., 12. Feb. 2019, 11:35 hat Pascal Birchler <[email protected]>
geschrieben:
… It was definitely not my intention to offend you or anything.
It would be really helpful if you could give us more information about
your setup, i.e. file names, folder structure, text domain, etc. Because
"it won't get translated" is very broad.
https://pascalbirchler.com/internationalization-in-wordpress-5-0/ has a
good tutorial of how to get things running.
As I said before, it's probably just an issue of naming your JSON files
properly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFhCBxZJlFj38fzMWY6e11dH5WUwFNsLks5vMpj4gaJpZM4aiRQO>
.
|
This comment has been minimized.
This comment has been minimized.
@ataylorme That sounds really unrelated to the issue at hand here. Would you mind opening a separate one? Thanks in advance! Also note that this should actually work since at least #87. Please verify that you are using the latest version of the package. |
Hi there,
Developing my first block plugins for GB i noticed a strange behaviour i just can not figure out:
If i write a plugin out of scratch then with wp i18n make-pot all the translatable strings will get extracted from all the .js files and after finishing the conversion to .json file and using wp_set_script_translations() the strings originated from .js files get translated just as expected.
However if i am using boilerplates like create-guten-block, then i18n make-pot extracts strings from .js files located under /src/blocks (where we just develop them), but it simply does not extract any strings from the file /dist/block.build.js even after running npm run build. Now that is a problem as WP uses this file in GB editor, but in the .pot file there are no references to this .js file and as a consequense no string located in the production .js file gets translated.
I just wonder if it is because that file is minified.
Can anyone confirm if this is a bug or am i doing something not the right way?
Regards
The text was updated successfully, but these errors were encountered: