Home › Forums › Trusted Pro › Translating "Recent" label
Tagged: Customizer, translating, wpml
- This topic has 11 replies, 2 voices, and was last updated 5 years, 6 months ago by Adri Oosterwijk.
November 8, 2017 at 1:44 pm #2653
I’m converting my site to the Trusted Pro theme. It looks great and it is working great. My thumbs up for this theme.
As you know we are able to add the most recent WooCommerce products to the home page through the Customizer. The standard heading for this section is “Recent”. There is an option to change this heading text in what ever I want. I have changed it to “Our newest additions”. The problem is when I try to find this string in WPML String Translation it never comes up. No matter what I try. Scanning for new strings, try to find it with a “search”. It simply is not found.
Your advice please..
November 8, 2017 at 2:03 pm #2656
- This topic was modified 5 years, 6 months ago by Andy. Reason: moved from Trusted to Trusted Pro
In WPML String Translation you can add it manually with the key name tab_label_recent
Key name: [theme_mods_trusted-pro]tab_label_recent
In case you need to translate the other tabs, the full list is:
Hope this helps.November 8, 2017 at 2:32 pm #2660
Thank you for your quick reply.
However, and excuse my ignorance I did not get it to work.
First, I’m not talking about the label (and IMHO you are) but about the value. Default the value is “Recent” also and this string is found by WPML String translation. Translating it in something Dutch like “Laatst toegevoegd” still shows me the string ‘Recent” on the front-end.
What I want to achieve is: on an English page -> “Our latest additions” and on a Dutch page “Laatst toegevoegd”. Sorry but it does not seems to work. As you can see on the screenshot below, the page is Dutch but the text above the recent products remain in English.
Can you please elaborate a bit more? Thanks.November 8, 2017 at 3:46 pm #2663
The theme has a language translation template /languages/trusted.pot which contains all the translatable strings – ‘Recent’ is one of these strings so it can be translated into any language.
But if you change the default ‘Recent’ to ‘Our latest additions’ then the translation plugin won’t automatically translate ‘Our latest additions’ to ‘Laatst toegevoegd’ because it cannot find ‘Our latest additions’.
It can only know to translate ‘Recent’ so the new string ‘Our latest additions’ needs to be added as a translatable string.
This can be done either by creating your own language template containing the string ‘Our latest additions’ or by adding the key value tab_label_recent as that is the key of the new value in the database, so WPML will know to translate whatever the value of tab_label_recent is into a different language.
Go to ‘WPML’ > ‘String Translation’
click ‘Translate texts in admin screens’
look down the list for ‘+ theme_mods_trusted-pro’ click it to open
look for key name ‘tab_label_recent’ and check the box next to it
(plus any others you may want to translate)
you should see message “The selected strings can now be translated using the string translation screen”
go back to the String translation screen and you should see the newly added string ready to be translatedNovember 8, 2017 at 5:32 pm #2666
Thank you again for your quick response.
I followed you steps but sadly no avail.
In the customizer my text is: Our new additions (see screenshot)
I went over to the String Translation -> Translate Admin texts (see screenshot)
Note that it is not in the theme_mods_trusted-pro section but in the theme_mods_trusted-pro-child section. As you can see I have ticked it.
I clicked “Apply” and got the message (see screenshot)
I went over to String Translation again and performd a search for “our newest additions”. No translatable strings were found. (See screenshot)
What did I miss? Or is it a flaw elsewhere?
AdriNovember 8, 2017 at 6:37 pm #2673
I tested the steps exactly the same as you did and the string is there right at the top (I think because it is the newest added) ready to be translated. See screenshot.
The only thing I can think of is the ‘select which strings to display’ filter, if you have ‘translation complete’ selected it won’t show in the list. I don’t know if this is applicable as I’m sure you would have thought of that.November 9, 2017 at 6:17 am #2680
What ever I do…. no avail. What strikes me also is that when you test it (as I see in your screenshot) a textdomain name is appearing. At my end not, not even in the pull down menu. Any suggestions?
I revert it back to the default text (Recent) as the word is in English and Dutch the same until we find a solution. I tried to post a support ticket over at WPML but their site is very wacky at this moment so I was unable to post one.
I hope you will keep me in the loop as I will keep you informed about my progress with WPML.
AdriNovember 9, 2017 at 11:06 am #2683
As I understand it, the domain admin_texts_theme_mods_trusted-pro-child should have been added but I am not an expert with WPML. I hope that you will be able to post a support ticket over at WPML as they are sure to have much more knowledge of their plugin than I do.
If I email you a WPML configuration file, do you have the ability to upload it to your site in this location:
.../wp-content/themes/trusted-pro-child/?November 9, 2017 at 11:21 am #2684
The textdomain should be added indeed but it’s not…..
When you send me the config file I’m able to put it in my child themes folder. So please do.
I have submitted a ticket to WPML but did not receive a response yet.
Please do send me the file and I keep you posted.
AdriNovember 9, 2017 at 12:01 pm #2686
OK, sent you the config file. Please put in the theme folder and that should let the WPML plugin know which customizable text strings are available for translation.November 9, 2017 at 1:10 pm #2687
Got it working. Thanks.
It is a bit in a weird way but still.
I had changed the text in the customizer from “Recent” to “Our latest additions.”
Next I went to the String Translation -> Translate text in admin screens and checked the correct field.
I applied it and went over to the String Translation table again.
To my surprise I saw a new string at the top of the table. The string was called “Recent” but with the correct domain and name. I decided to translate “Recent” to “Laatst toegevoegd” and now I see on an English page “Our latest additions” and on the translated Dutch page “Laatst toegevoegd. Just what I was aiming for.
A weird way but still it works. Thanks for now and I will mark it as resolved. When there are additional issues regarding this I will open a new ticket.
See the screenshot for the appearance on the String translation table and the other ones for the result.
AdriNovember 9, 2017 at 1:22 pm #2688
I applied the string to be translated again and guess what? Now the correct English string is showing just fine. See screenshot.
I absolutely don’t know what was causing it but it appears to be working fine.
- The topic ‘Translating "Recent" label’ is closed to new replies.