- This topic has 11 replies, 2 voices, and was last updated 7 years, 4 months ago by Tom.
-
AuthorPosts
-
December 11, 2016 at 12:31 pm #253662Dani
Hi Tom,
Do you know if I can translate the plain text I’ve into a Hook with WPML Multilingual Blog version ?
Or with Multilingual CMS version is this posible?Thanks!
DaniDecember 11, 2016 at 6:42 pm #253711TomLead DeveloperLead DeveloperHi Dani,
You should just need to wrap your text in a translation function like this:
<?php _e('My custom text','generatepress'); ?>
More info here: https://wpml.org/forums/topic/custom-string-translating/#post-640164
December 12, 2016 at 1:51 am #253772DaniHi Tom,
I put the function into the Hook, and activate “Execute PHP”.
I try to do the translation trough .po archives ( I’ve not ” WPML String Translation” plugin installed)
But I search into .po files but don’t find my custom text… I search here (via FTP):
wp-content/lenguages/es_Es.po
wp-contebt/lenguages/themes/generatepress-es_Es.po
but nothing found.Where is the text?
What I am doing wrong?
Thanks!
DaniDecember 12, 2016 at 10:20 am #253898TomLead DeveloperLead DeveloperI think you would need a plugin like WPML installed.
All of the translation files for GP are done through WordPress.org.
December 12, 2016 at 3:22 pm #254014DaniHi Tom
I installed the WPML plugin.
I put the code
<?php _e('My custom text','generatepress'); ?>
into a Hook “Before Footer”.After I go to “WPML -> Theme and plugins localization” and click on “Scan the theme for strings” and after select GP Premium plugin and “Strings in the plugins”, and search news strings.
After I go to the section “WPML String Translation”, but don’t found nothing (my string). I search in this labels:
generatepress
generate-hooks
gp-premium
text_domain
..and others options but don’t found my string.How I can found my string?
Can you help me?
My site: http://bit.ly/1UQRoqL
My string: Comparte (Above social buttons)Thanks!
DaniDecember 12, 2016 at 7:33 pm #254077TomLead DeveloperLead DeveloperHmm, is this website multi language? So you can switch between two languages?
December 12, 2016 at 11:11 pm #254134DaniTom,
I’ve been doing translations for four days. I have translated everything (more than 5000 words, a lot of strings) except what I’ve told you.
It is still in test mode, yes , and excuse me, I gave you the domain but you can not see anything (Maybe I should not have given you the domain of the site, I think probably not necessary).
In the admin I can select between lenguages and do all I explain in the last comment.
I have been able to translate all the strings, except the ones I mentioned above.
Do you really need to see the Language Selector?
Thanks
DaniDecember 12, 2016 at 11:39 pm #254143TomLead DeveloperLead DeveloperI’m just trying to get an idea of what’s happening so we can come up with a solution.
Can you point me to the exact plugin you’re using to manage the translations?
December 12, 2016 at 11:50 pm #254148DaniPlugins I’m using:
WPML Sitepress Multilingual cms 3.6.1
WPML Media 2.1.23
WPML String Translation 2.5.1
WPML Transltaion Management 2.2.6Thanks
December 13, 2016 at 12:32 am #254157TomLead DeveloperLead DeveloperSearching through their forum, I keep seeing this as “the answer”:
1. Go to WPML->Theme and plugins localization make sure that “Translate the theme and plugins using WPML’s String Translation” option is selected
2. Scroll down and click on “Scan the theme for strings” button
3. After that you will be able to translate string from WPML->String translationI’m assuming that’s what you’ve tried and it isn’t working.
Have you tried asking in their support forum? They obviously know their plugin a lot better than me, so it might be something really easy that I’m not aware of.
Using GP Hooks, you’re basically hard coding text into your template files (GP Hooks is doing it for you).
From what I’ve seen, using a function like
_e
or__
(like I mentioned above) should make the text discover-able to WPML, however I could definitely be missing something as I’ve never made a multilingual site.December 13, 2016 at 12:53 am #254161DaniOk Tom, don’t worry.
I will ask in the forum of wpml.I was planning to contact them, but first I should know if I was putting the code inside the Hook and whether this should work.
If I had contacted them first, they would have told me to contact you.
Thanks
DaniDecember 13, 2016 at 12:54 am #254162TomLead DeveloperLead DeveloperThey probably still will, but hopefully they’ll have some more info/instructions for us 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.