How to use get_option() without any filter?

I’m guessing that you are using language tags around ‘polish textdeutschland text’ i.e. <!–:pl–>polish text<!–:–><!–:de–>deutschland text<!–:–> but that they got ignored when you posted your answer. I’m pretty sure what you need to be doing is using the __() (which returns the translation for use in php code) and _e() (echo’s direct to screen) wordpress … Read more

Make changes to translation?

You can make changes to the translation, yes, but it’s not as simple as editing the text inside the fi.po file (or any PO file, for that matter). That’s because WordPress actually uses another file, with an .MO extension, to render the translations. That extension is not meant to be read by humans, so you … Read more

Transfer from English page to Arabic page

Try the following. This is given that the original page url has a .html in it (contact.html and info.html) <li><a href=”https://wordpress.stackexchange.com/questions/87146/<?php if (false !== strpos(strtolower($_SERVER[“REQUEST_URI’]), ‘.html’)) { $uri = str_replace(‘.html’, ‘-ar.html’, strtolower($_SERVER[‘REQUEST_URI’])); } else { $uri = ”; } echo home_url($uri); ?>”>arabic</a></li>

Automatically translating from existing .po and .mo files?

Solved by adding if ( isset( $_POST[‘language’] ) ) { // Input var okay. add_filter( ‘locale’, ‘mbd_set_my_locale’ ); /** * Set locale based on the $_POST choice. * * @param string $locale Locale code. * @return string Selected locale code. */ function mbd_set_my_locale( $locale ) { $language = sanitize_text_field( wp_unslash( $_POST[‘language’] ) ); // Input … Read more

POEdit with Custom mu-plugins code

I’m not 100% sure this is the only issue that was preventing POEdit from correctly parsing my code (I’m not sure it actually cares about the WordPress side of things), but fixing these (stupid) errors and re-running POEdit from the .pot file below seems to have generated the correct translation strings: define( ‘MY_TEXTDOMAIN’, ‘MY_TEXTDOMAIN’ ); … Read more

How WordPress knows where to find locale files?

Plugins and themes pull the translation files manually from (mostly) their directory. There are 2 different functions which handle this: For plugins : load_plugin_textdomain() For themes: load_theme_textdomain() The syntax would be something like this, mostly hooked into init or plugins_loaded action hook: load_plugin_textdomain( ‘text-domain’, get_template_directory() . ‘/some-directory’ ); OR: load_plugin_textdomain( ‘text-domain’, false, basename(dirname(__FILE__)).’/some-directory’); Look for … Read more