Community Forums › Forums › Internationalization and Translations › New Genesis sidebar in WordPress 5.x editor is not translated
Tagged: Genesis 3.1.0 translations
- This topic has 3 replies, 2 voices, and was last updated 2 years, 7 months ago by
BlogsPNTE.
-
AuthorPosts
-
August 22, 2019 at 1:32 am #493092
BlogsPNTE
MemberI use my own custom Genesis framework translation to Spanish, by means of .PO/.MO files. After downloading the recent 3.1.0 version of Genesis framework, making an updated .MO translation file with PoEdit and uploading it to /wp-content/themes/genesis/lib/languages, I have noticed that the text chains in the new Genesis sidebar (for example, "Hide Breadcrumbs", "Hide Title", "Layout", "Custom Class", etc.) remain in English.
I have read about the new translation system in WordPress 5.0, by means of JSON files, which allows to translate the new WordPress editor (see https://make.wordpress.org/core/2018/11/09/new-javascript-i18n-support-in-wordpress/), but I don't know hot to make the JSON translation file for Genesis sidebar.
By the way, this problem affects not only Genesis framwork, but also many other plugins which modify WordPress 5.x editor. Atomic Blocks plugin is an examplee, as it can be seen here: https://wordpress.org/support/topic/translations-does-not-go-to-the-blocks-panel/.
Any idea? Thanks in advance,
Eduardo Larequi.
August 22, 2019 at 6:54 am #493101Nick
ParticipantHi Eduardo
WordPress suggests generating the extra translation files for JavaScript features such as the new Genesis sidebar using the WP-CLI make-json command. This currently requires using an application on the command line.
If you would prefer not to do this yourself, an upcoming update to the Genesis Translations plugin will bundle the new Spanish translation files for you (using the Spanish translations from the Genesis community translation project). This plugin update should be out in the next week or two.
If you want to generate the files yourself with Genesis 3.1, you can create the extra translation files from your custom Spanish language files like this:
1. Install the WP-CLI application locally or on your web server: https://wp-cli.org/#installing. Installing on a production site requires SSH/command line access to the server. Not all web hosts provide this, so you may have to download Genesis to your own computer and generate the files locally.
2. Put your generated es_ES.mo and es_ES.po files in the genesis/lib/languages directory.
3. On the command line, change directory to the Genesis folder: cd /full/path/to/wordpress/wp-content/themes/genesis
4. On the command line, type wp i18n make-json lib/languages to generate the additional language files.
You will see a lot of new files in the genesis/lib/languages directory that look like this:
es_ES-1b2842785614509f830e0f0248f6ae0e.json
es_ES-33894816a3c53f8f3ea09f189fcf974e.json
es_ES-3efe3061bc0c159ec26a0ce5d7ed3aa7.json
es_ES-5d7d3bcd7be019bded372818f3f3b16e.json
es_ES-64f35610e8ac0134b0c2deb3f02c3140.json
es_ES-79dd439c690538ecd94ef8318a920d4f.json
es_ES-9122b2e85854443a5866323841eaed9e.json
es_ES-9bfe8d27585d1f0d45522660f5c452fe.json
es_ES-9c9d9cf90f1fff6210099a3a9fc68f0c.json
es_ES-a81a835585aa480b4ce1da8327dfa0f1.json
es_ES-b0a5690d606ec01a631f92909923e5dc.json
es_ES-e50cb84d4d0ac72d6d5cf1d2a3efedf5.json
es_ES-e9f83c28e273e4218ee08d9d2e9e252d.json
es_ES-ec05fc9d6aa7f97f415999731a8feaad.jsonYou will need to rename each of those files so they start with genesis- like this instead:
genesis-es_ES-1b2842785614509f830e0f0248f6ae0e.json
genesis-es_ES-33894816a3c53f8f3ea09f189fcf974e.json
genesis-es_ES-3efe3061bc0c159ec26a0ce5d7ed3aa7.json
genesis-es_ES-5d7d3bcd7be019bded372818f3f3b16e.json
genesis-es_ES-64f35610e8ac0134b0c2deb3f02c3140.json
genesis-es_ES-79dd439c690538ecd94ef8318a920d4f.json
genesis-es_ES-9122b2e85854443a5866323841eaed9e.json
genesis-es_ES-9bfe8d27585d1f0d45522660f5c452fe.json
genesis-es_ES-9c9d9cf90f1fff6210099a3a9fc68f0c.json
genesis-es_ES-a81a835585aa480b4ce1da8327dfa0f1.json
genesis-es_ES-b0a5690d606ec01a631f92909923e5dc.json
genesis-es_ES-e50cb84d4d0ac72d6d5cf1d2a3efedf5.json
genesis-es_ES-e9f83c28e273e4218ee08d9d2e9e252d.json
genesis-es_ES-ec05fc9d6aa7f97f415999731a8feaad.jsonYou should then find that Genesis picks up the translations in the sidebar:
The StudioPress team is looking at ways to reduce the amount of work to create and download translations in future versions of Genesis. I hope this information is helpful for now.
August 24, 2019 at 1:52 pm #493156BlogsPNTE
MemberThank you very much for your help, Nick.
As I don't have CLI access to any production server, I have installed WP-CLI in my PC (Windows 10) and in my home server (a Synology NAS DS718+). Then, following your instructions, I've tried to generate the JSON files in these two systems.
Apparently, everthing worked fine, but, instead of getting a bunch of 14 files, as you have pointed out in your instructions, I have just got 3 files. As you can see, their hashed names match the ones from your list:
-genesis-es_ES-33894816a3c53f8f3ea09f189fcf974e.json
-genesis-es_ES-79dd439c690538ecd94ef8318a920d4f.json
-genesis-es_ES-e9f83c28e273e4218ee08d9d2e9e252d.jsonI've checked carefully all the steps, and repeated the procedure many times, but I haven't been able to get all the necessary files. There must be some error in my work, but I can't find it.
Any idea? Thanks in advance,
Eduardo Larequi.
August 27, 2019 at 12:54 am #493206BlogsPNTE
MemberProblem solved, Nick.
I have been trying to generate the JSON files from a custom .PO file which in turn had not been generated from the official .POT file, but directly from the code, by means of PoEdit.
After generating the .JSON files from the correct .PO file (based in the original genesis.pot file), everything works as expected.
Thank you very much for your help, Nick, once more time.
-
AuthorPosts
- The topic ‘New Genesis sidebar in WordPress 5.x editor is not translated’ is closed to new replies.