How do you install a .MO (language file) to use as part of a theme?

You need to load_theme_textdomain() in your theme. Place this in theme functions file: function theme_init(){ load_theme_textdomain(‘theme_name’, get_template_directory() . ‘/languages’); } add_action (‘init’, ‘theme_init’); Then you put you language files in you theme /languages folder you language files should be es_ES.mo and es_ES.po without the text domain at the front as the codex states File names … Read more

Redirect one of two domains on one WordPress installation

You could check the contents of the $_SERVER[‘REQUEST_URI’] array when the site is loaded, by placing the conditional checking logic in your header.php file of your site and then redirect the user to the appropriate language from there. For example in header.php add: $incomingUrl = $_SERVER[‘REQUEST_URI’]; if($incomingUrl == ‘mydomain.dk’) { wp_redirect(URL FOR THIS LANGUAGE); exit; … Read more

How to use both British and American English?

You can filter mu_dropdown_languages and re-add American English here. Sample code, not tested: add_filter( ‘mu_dropdown_languages’, function( $output, $lang_files, $current ) { array_unshift( $output, ‘<option value=””‘ . selected( $current, ‘en_US’, false ) . ‘>’ . __( ‘American English’ ) . “</option>” ); return $output; }, 10, 3 ); Filter sanitize_option_WPLANG or pre_update_option_WPLANG to jump into the … Read more

How to find a language direction?

The text_direction property of the WP_Locale class defaults to ‘ltr’ as per it’s declaration, then may be modified in the class’s init() initialization function in wp-includes/locale.php (near line #207 in WP 4.5) with the following logic: // Set text direction. if ( isset( $GLOBALS[‘text_direction’] ) ) $this->text_direction = $GLOBALS[‘text_direction’]; /* translators: ‘rtl’ or ‘ltr’. This … Read more

WordPress For Urdu Language

WordPress is community translated. For a good number of languages, the translation is relatively complete and follows high quality standards. The codex page on WordPress in your language reports: WordPress in Urdu – اردو is ongoing, but slow. Need more contributors. So in essence: No, WP is not entirely translated to Urdu yet. You could … Read more

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