Translation of theme using child theme

You are using weird quotes: load_child_theme_textdomain( ‘ifeaturepro5-child’, get_stylesheet_directory() . ‘/languages’ ); } add_action( ‘after_setup_theme’, ‘my_child_theme_setup’ ); use this: load_child_theme_textdomain( ‘ifeaturepro5-child’, get_stylesheet_directory() . ‘/languages’ ); } add_action( ‘after_setup_theme’, ‘my_child_theme_setup’ );

Translations not returning translated strings

Getting tired so mistakes creep in that I don’t see. I totally missed the fact that my sprintf strings are missing the domain name. I copied the code directly from the wordpress core files, and these code don’t include any domain name. So this is the fix: Change ‘must_log_in’ => ‘<p class=”must-log-in”>’ . sprintf( __( … Read more

Two text domains in one plugin

Yes, you can load multiple translation files for multiple text domains in one plugin. This is sometimes useful, for example when you need just one string in AJAX calls and many strings in the rest of the application: to make AJAX faster, load a separate translation. Be aware, automatic language updates for the plugin from … Read more

translate the_title() with .po & .mo

Since, ‘the_title()’ is not a static word, you can’t directly translate it. Its value can be dynamic and saved in the database. So, you can either use plugins like ‘WPML’, ‘qTranslate’ or just learn how to do translation for the values which are saved in database.

How to translate menu items?

You can create a menu use another language. Then you use conditional code to switch the menu. or you can use title attribute of menu. if($language==’us’): wp_nav_menu(menu1); else: wp_nav_menu(menu2); endif;

Translating publish dates to Arabic

Found it. Anyone with a similar problem can add this code to their site plugin or theme functions.php function convert_numbers_to_arabic( $string ) { $arabic_numbers = array(‘۰’, ‘۱’, ‘۲’, ‘۳’, ‘٤’, ‘۵’, ‘٦’, ‘۷’, ‘۸’, ‘۹’, ‘.’); $english_numbers = array(‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘.’); return str_replace($english_numbers, $arabic_numbers, $string); } add_filter( … Read more

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