Tagged: x
-
AuthorPosts
-
August 2, 2016 at 12:18 am #1113248
jdiaz1302ParticipantHey there, I was trying to create a custom string like this one in the theme
<p><?php _e( 'Made with ♥ 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.moOn those files, you will see the string to translate the text above:
Made with ♥ in El SalvadorI’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.
August 2, 2016 at 4:19 am #1113453
LelyModeratorHello 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.
August 2, 2016 at 10:19 pm #1114847
jdiaz1302ParticipantThank 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
August 3, 2016 at 4:59 am #1115165
LelyModeratorHi 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.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1113248 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
