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

New plugin translation does not work

After a heavy investigation, I understood what is happening. The solution to debug this was partially here but there were some php errors that´s why I got a blank page. So, after to test : Which language is called thanks with get_locale() Display WP_LANG_DIR to know where are language files are stored I tried to … Read more

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