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;
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;
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
The localizing functions have two variaties, one that echos the string value and the other one that returns it’s string value. Because you would want to display the string (echo it), you would want the correct function for the specific string which will echo the output. For easy simple strings (__(‘PLAYER POINTS AT A GLANCE.’,’gogreensoccer’)) … Read more
Problem resolved. WordPress default translation were overriding my translation string. In locotranslate plugin go to settings and click on : Activate the main translation from wordpress. And than you can find and edit your specific string who is overrided.
Technically, and this is highly discouraged do to it’s unfriendly and unpredictable nature, you can do this: <?php _e( $data[‘hair’][‘type’] ); ?> However, you’ll need to have all the possible values for that (“brown hair”, “blond hair”, etc.), listed in a .POT file (a translation template) so that translators know what to translate. You’ll need … Read more
Your website looks working properly. If still, there are some strings not translating then you need to add appropriate Dutch strings for missing strings. For that you can use tool poedit. Further reference: Translating with poedit
You can use POedit to generate the PO file from source code: https://codex.wordpress.org/User:Skippy/Creating_POT_Files The problem for me is that my WordPress installation is running on an Amazon Linux server, which does not have a package in the repos for POedit and I couldn’t figure out how to install POedit on my server (only on my … Read more
I created a ltr.css file and put that on theme’s root folder. When checked the site in English, the ltr.css loads automatically. So as it seems WordPress do all needed things in the background and there’s no need to do in addition.
Luckily the plugin developer made two separate file sets, one for frontend and one for backend. So I was able to delete the it-IT backend files, copy the en-US ones and rename the copies as it-IT. So wordpress thinks it’s loading the Italian backend translation while instead the English one gets loaded. And being frontend … Read more
Don’t add links, no need for HTML in there: How about this: $anchor = esc_html_x( ‘Google’, ‘link text for google.com’, ‘txt-domain’ ); $domain = esc_url( __( ‘google.com’, ‘txt-domain’ ) ); $link = sprintf( ‘<a href=”https://%s”>%s</a>’, $domain, $anchor );