How to syntax Json output for translation?

Technically, and this is highly discouraged do to it’s unfriendly and unpredictable nature, you can do this: <?php _e( $data[‘hair’][‘type’] ); ?> However, you’ll need to have all the possible values for that (“brown hair”, “blond hair”, etc.), listed in a .POT file (a translation template) so that translators know what to translate. You’ll need … Read more

Implementing conditional gettext translation

WordPress provides the _x() function which is just like __(), but it adds the $context parameter which is used to differentiate between identical strings. In the example below, some output is generated in the footer. The translatable string is Message is used in both cases, but in the first instance, Message is given the context … Read more

loco translate plugin edits file in plugin folder

I thought (and hoped) that the translations were written in the folder wp-content/languages/loco/plugins/my-plugin. They are, but only when you create the file in that location. Any users wishing to customize your provided translations should create a new translations file and not edit yours. Opening your provided PO file and starting to edit will not automatically … Read more

Change template copy with po/mo files

i had a similar question posted some time ago: why is translation not working on theme? it might be the solution to put your translation files into the right location (languages directory in wp-content/languages/themes/) and prefix them with the theme name like themename-pt_PT.po

Replace text string on individual page

I can’t comment so I’ll answer and slightly adjust Bhagyashree’s which is exactly what you’ll need to do based on your question. Except you may want to know how to include the 2 pages rather than duplicating the function. And also passing in an array of strings to replace. function replace_some_text( $content ) { // … Read more

How to display get_post_type() translated?

Based on a previous Q&A, How to get current get_post_types name?, you could use get_post_type_object() to get the whole post type object, which will have the translated name in it. $post_type_object = get_post_type_object(get_post_type()); if ( $post_type_object ) { echo esc_html( $post_type_object->labels->singular_name ); }

Change / tweak existing wordpress translations

It is better to use a separate file to prevent an overwriting during an upgrade. Filter load_textdomain_mofile and replace the old file with your own: add_filter( ‘load_textdomain_mofile’, function( $mofile, $domain ) { if ( ‘name_of_the_textdomain’ === $domain ) return ‘path_to_your_file.mo’; return $mofile; });

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)