-
Notifications
You must be signed in to change notification settings - Fork 144
Translations: wp i18n make-json produces no files #3298
Comments
@psealock It merges them vs concatenate. If you
The first 2 lines indicate locations where the string is found.
|
I see! Thank you. I will close this one then. |
Hello there, Yes the mappings for JavaScript files are present in woocommerce-admin.php and in woocommerce-admin.pot, there are mappings for woocommerce-admin.php. But still, I am not able to translate any JavaScript strings. Kindly mention the steps to translate them if you're able to translate. -- Thanks |
@rrennick yes, I have already checked that. In this doc, it is mentioned that to translate the WooCommerce Admin plugin, we need to download .pot file from https://translate.wordpress.org/projects/wp-plugins/woocommerce-admin/ and yes this .pot file is correct but my question is that how to create this .pot file. Kindly compare this .pot file from https://translate.wordpress.org/projects/wp-plugins/woocommerce-admin/ and the one which is generated by the command |
.po/.pot files have the generator in the header of the file. You can find that by opening the file in a text editor. The WordPress.Org generator is
Different tools may generate the file with strings in a different order. Eg. GlotPress first string is on line # 17
the result of |
Hello @rrennick Kindly provide me the steps to create a But if I run According to https://github.com/woocommerce/woocommerce-admin/blob/master/CONTRIBUTING.md#localizing-woocommerce-admin, i have to download the Yes, if i download But my question is that how this -- Thanks |
Yes, it does. See my explanation #3298 (comment) . |
I have seen your explanation and yes I know that there are JS mappings present in woocommerce-admin.php file and in woocommerce-admin.pot file, there are mappings of woocommerce-admin.php file but when you try to translate any JS string with this Let me give an example for the translation. Kindly try translating word Analytics, it will get translated successfully and changes will get reflected in the site. Then try to translate the word Gross Revenue, it will get translated successfully because it is present in the I have tested this with the @rrennick kindly test by yourself and let me know your views in this. -- Thanks |
@yash-webkul Could you try out #3433 to see if that works for you? |
@rrennick thanks, yes it works for me now. A little suggestion from side if you wish to apply, with command Kindly let me know your views about this. |
@yash-webkul Thanks for the followup. I explained the reason for delaying the mapping change with
Do translators use those source references? They are shown in the GlotPress edit screen |
Describe the bug
The command
npm run i18n
creates a.pot
file for translations. First, the js and then the php. The js gets overwritten by the php.First reported in https://wordpress.org/support/topic/wordpress-i18n-how-to-translate-js-strings/
To Reproduce
Steps to reproduce the behavior:
npm run i18n
languages/woocommerce-admin.pot
file for strings derived from js files, and see none exist.npm run -s i18n:js
and see the js strings available in the same file.Expected behavior
A clear and concise description of what you expected to happen.
I'm not an expert here, but it seems the js and php should be concatenated.
The text was updated successfully, but these errors were encountered: