[Resolved] Text in Hooks translation

Home Forums Support [Resolved] Text in Hooks translation

Home Forums Support Text in Hooks translation

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #253662
    Dani

    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!
    Dani

    #253711
    Tom
    Lead Developer
    Lead Developer

    Hi 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

    #253772
    Dani

    Hi 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!
    Dani

    #253898
    Tom
    Lead Developer
    Lead Developer

    I think you would need a plugin like WPML installed.

    All of the translation files for GP are done through WordPress.org.

    #254014
    Dani

    Hi 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!
    Dani

    #254077
    Tom
    Lead Developer
    Lead Developer

    Hmm, is this website multi language? So you can switch between two languages?

    #254134
    Dani

    Tom,

    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
    Dani

    #254143
    Tom
    Lead Developer
    Lead Developer

    I’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?

    #254148
    Dani

    Plugins 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.6

    Thanks

    #254157
    Tom
    Lead Developer
    Lead Developer

    Searching 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 translation

    I’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.

    #254161
    Dani

    Ok 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
    Dani

    #254162
    Tom
    Lead Developer
    Lead Developer

    They probably still will, but hopefully they’ll have some more info/instructions for us 🙂

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.