How to resolve the WPML translation issue on website? - php

I have one site in WordPress + DIVI + WooCommerce + WPML and other plugins.
I am facing one issue on site while WPML Translation.
Website is in 3 languages:
Dutch (Main)
Franch
English
I need to keep different string for different language for the button text in one module of the DIVI.
I selected English language from adminbar
When I go to Theme Builder -> Global Header and I change the button text to "XYZ", it is reflecting only on English page, that is fine.
Now when I change the language to Dutch
and When I go to Theme Builder -> Global Header and I change the button text to "ABC", then it is reflecting on Dutch and French pages (English page is fine with "XYZ"), this must reflect on Dutch page only If I change the button by selecting the Dutch language
Now when I change the language to French
and When I go to Theme Builder -> Global Header and I change the button text to "DEF", then it is reflecting on Dutch and French pages (English page is fine with "XYZ"), this must reflect on French page only If I change the button by selecting the French language
I checked for String Translation, and updated translation for Dutch and French but it is not reflecting on front side.

When you're switching languages and modifying it manually like this, you are messing up the WPML logic that's handling translations. Page builders are tricky to translate. That's why you need to follow the recommended process.
From documentation:
To translate the Divi site header or footer you created using the Divi
Theme Builder, follow these steps:
Go to WPML > Translation Management. Choose Header Layout, Footer Layout, or Body Layout from the Type dropdown, then click the Filter
button.
Choose which headers or footers you want to translate, the languages you want to translate them into, and click Translate
selected content.
Go to WPML > Translations to take and translate the global header using the Advanced Translation Editor.
Try this with a fresh site with a new global Divi header/footer from scratch.

Related

PolyLang plugin not displaying Language switcher in Appearance->Menu

I've been trying to implement multilanguage support for my new website and I want to be able to have a language switcher next to my menu, like every other normal website. I have the following plugins:
Ocean Extra, Elementor, Polylang and WPForms Lite.
I don't know If I screwed it up somehow or what happened, but when I go to
Appearance -> Menu -> Screen Options
nothing happens. It's just a blank white space that expands by 10 pixels when I click on it and I cannot change anything. Here's an image of what happens when I click on Screen Options:
When I click on "Help" that is next to "Screen Options", it expands normally. So my question is how can I add this to my OceanWP theme? I have already translated all of my stuff, so I just need to place the language switcher, and it being on the footer is a sore pain for my eyes.
Does everyone else have this option for free? Or what is going on? Should I try reinstalling my whole site?
You need to enable the language switcher
https://docs.themeisle.com/article/589-how-to-add-polylang-language-switcher-to-themes
You can add the language switcher by updating your theme files, just add the following to the header or menu where you want the language switcher to appear:
<ul><?php pll_the_languages();?></ul>
You can also add the language switcher by widget.
To customize the language switcher, you can read this documentation.
Reinstalled WordPress and then tried again, it worked. Although it didn't appear in the "Screen Options" menu, It appeared above "Pages" in the Appearance -> Menu

Wordpress theme with second language

I didn't find any learn for Multi-Lingual !
1.How to use function _e() ?
2.What's text_domain ? How can i set text_domain ?
e.g:
_e('Mine','text_domain')
in english returns "Mine"
in example language is "imja"
How to set "imja" ?
text_domain is a distinction inside WordPress that allows you to see which plugin or theme text comes from. The text domain can be any string that you want but as a best practice it should be a machine name of the theme or plugin you are building.
So if I had a plugin named MyPlugin I would translate text using any of the WordPress translation functions like:
print __("Translateable Text", "MyPlugin");
_e("Text that is translated then echoed", "MyPlugin");
For WordPress to render these strings in another language, in WordPress 4.0 and above, you can change the language at Settings > General > Site Language and your site will show the text in that language if available.
You will need language files for the language that you wish to change to, and if a plugin or theme doesn't offer a translation for your chosen language it will be rendered in the default language.
There are many tools and plugins for editing the .po/.mo files that hold the translations in WordPress. Some of those can be found in the WordPress translation handbook.

Magento URL translation for CMS pages names

I build the store with 2 views for two languages French and English and I have many CMS pages, like "about us" in English and the same page in French - "a propos".
In administration side the option "Add Store Code to Urls" is ON.
I have created 2 CMS pages "about-us" linked to English store view and another one "a-propos" linked to French store view.
When I’m in English store on "About us" page the URL is www.myurl.com/en/about-us/ but if I switch the language to French the language switcher brings me to www.myurl.com/fr/about-us/ instead of www.myurl.com/fr/a-propos/
So, the language switcher changes only the store code but not the page name.
Thank you,
Yes, this is how magento works. If you want to change to another static block on your about page in some language you have to change the reference to the block id "about-us" to "a-propos" on the french site.
This page explains this quite good I think.
http://anothermarketer.com/how-to-translate-a-magento-theme/
Just add a comment to my answer if you need more help.

Wordpress WPML how to print translation

I'm trying to translate texts in a WordPress template file:
_e('Sport Events Organizing', 'theme-text-domain');
I've setup the translation for spanish on WPML String Translation. Checked "Finished Translation" and clicked "Save". Then I browse my site and change the language to "Spanish". But the text still appears in english. URL shows the ?lang=es parameter.
To get WPML to make the translations for this text available I had to register it with:
icl_register_string('theme-text-domain', 'Sports', 'Sport Events Organizing')
Why is the spanish translation not showing? Is there a way to debug this?
First you have to translate the strings from the admin panel , the strings wrapped in __() or _e() will appear in the wpadmin panel under the String translation module if you haven't install this plugin then first install this wpml plugin below is the snapshot in which you can see the list of strings need to be translated and from there you can edit the translations from default language to other languages
When ever you add new strings in your theme you have to refresh the translation module to get the new strings in the translation module see below attached snaps
Under Theme and plugins localization menu
And in same module you will see the plugins and there strings you can rescan them and they appear in string translation module
Hope it makes a good sense for the cycle of translation

wordpress sidebar content in different languages

I am developing a site in wordpress.I want the particular page from the site in four different languages(English,spanish,french and Dutch).I have used a plugin called WP Native Dashboard.Using this I am able to get the page content in four different languages.I used the combobox to select the language and display the content.This works fine...
I am creating a new page,select the language ,and writing the content in it.For same content in different language i am just writing the page id besides the language name as follows :
Main problem is about the sidebars,footer and the header content.I have one set of sidebar,footer and header in English language.When I select the different language (for example french) the sidebar,footer and header content is displayed in English.
If i try to create another set of sidebar,footer and header in other language and try to create a diffrent page called French left sidebar .In french content if i select the page as shown below:
.and on the site when i select the language as english sidebar content displayed in french language .
so my question is how to get the sidebar content in different language when different language from the combobox are selected.
Create a new page template that loads a custom sidebar. Also checkout http://wpml.org/2011/06/how-to-build-different-sidebars-per-language/

Categories