Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1113248
    jdiaz1302
    Participant

    Hey there, I was trying to create a custom string like this one in the theme
    <p><?php _e( 'Made with &hearts; in El Salvador', '__x__' ) ?></p>

    Then I’ve added the text domain on my child theme style.css
    Text Domain: __x__

    Then I’ve added the following on my functions

    add_action( 'after_setup_theme', 'load_child_language' );
    	function load_child_language() {
    		load_child_theme_textdomain( '__x__', get_stylesheet_directory() . '/languages' );
    }

    and of course the folder “languages” on my child theme.

    And using the x.pot I’ve created the following files:
    __x__-es_ES.po and __x__-es_ES.mo

    On those files, you will see the string to translate the text above:
    Made with ♥ in El Salvador

    I’ve attached the files so you can check that are readable and working.

    And I’m using WPML, the page is in spanish as default, but when I enter to the spanish site, I always see the string in english.

    Screenshot: http://prntscr.com/c0ifc6

    Thanks in advance for any help that you could give.

    #1113453
    Lely
    Moderator

    Hello There,

    Please follow this link for translation:https://community.theme.co/kb/translation/

    Since you have uploaded your translation on your child theme, file should be es_ES.po es_ES.mo. I have open the pot file and the translation is not provided. The link above discuss this in detailed.

    Hope this helps.

    #1114847
    jdiaz1302
    Participant

    Thank you for your reply, actually I’ve added both files but got an error saying that I couldn’t upload those 2 files due to security issues.

    But in to .pot file, at the end you will find that line, because as test I’ve added just that one.

    Here’s a screenshot of the files and location: http://prntscr.com/c0xnko

    #1115165
    Lely
    Moderator

    Hi There,

    Please check the filename on the first screenshot. Without this: __x__-.

    I open your current X pot file. See POEDIT.PNG below. I did select the text you have added, then ADD the translated text -> Made with ♥ in El Salvador SPANISH TRANSLATION IS THIS. Then go to File > Compile to MO (POEDIT2.PNG). I did save it as es_ES.mo. (POEDIT3.PNG).

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1113248 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>