Tag Info

New answers tagged

1

global $langOK; add_action( 'plugins_loaded', 'myplugin_load_textdomain' ); function myplugin_load_textdomain() { global $langOK; $langOK = load_plugin_textdomain( 'my-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); } Later you can check the value of $langOK ( TRUE = success, FALSE = failure ).


2

Take a closer look at next_post_link and previous_post_link. Specifically; how the function arguments are arranged. Next, take a closer look at translating strings; and how the function arguments are arranged. Now, when you put the two together; you should have something like this: <?php previous_post_link( '<span class="meta-nav"> %link ...


0

I think I found a solution, but before a little Premise load_theme_textdomain() and load_child_theme_textdomain() are basically equal, the only difference is the default path they use: they get the current language (using get_locale()) and add the relative .mo file to the path passed as argument; then they call load_textdomain() passing as argument both ...


0

You can use language files that are in your child theme folder. First you have to know which text domain the parent theme is using. Then create the .po and .mo files with only your language as the file name (e.g. de_DE.po/de_DE.mo or nl_NL.po/nl_NL.mo) and put them into a folder within your child theme directory, "languages" for example. You can then ...


1

You could use gettext filter: add_filter( 'gettext', 'cyb_filter_gettext', 10, 3 ); function cyb_filter_gettext( $translated, $original, $domain ) { // Use the text string exactly as it is in the translation file if ( $translated == "Categorie: %s" ) { $translated = "Sectie: %s"; } return $translated; }



Top 50 recent answers are included