Make sure to have WordPress and WPML installed
Get The Best WordPress Hosting and WPML Support for free here
1- Register your localized string name inside functions.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
if ( ! function_exists( 'wpex_icl_register_strings' ) ) { function wpex_icl_register_strings() { // Return if function doesn't exist if ( ! function_exists( 'icl_register_string' ) ) { return; } // Array of strings $strings = array( 'gbe_seach_descx' => "this is a text", ); // Register strings foreach( $strings as $string => $default ) { print_r( $strings ); icl_register_string ( 'greenbackend', $string, $default) ; //icl_unregister_string ( 'greenbackend', $string) ; } } } add_action( 'admin_init', 'wpex_icl_register_strings' ); |
2-you can see it here
3-translate its language content
4-call it
1 |
icl_t('greenbackend', 'gbe_seach_descx', 'this is a text') |
the first argument greenbackend: domain
the second argument is the key or the name
the last one is the original value in the defaul language and can be translated in step 3
Get The Best WordPress Hosting and WPML Support for free here