-
-
Notifications
You must be signed in to change notification settings - Fork 829
CRM-21470 Add support for WordPress Polylang plugin #11312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ping @mlutfy @kcristiano @christianwach Your thoughts on this? seems fairly sensible to me |
This would be a same-shop-merge, but it seems OK to me (I haven't worked on this, and if I recall correctly, Samuel had added WPML support, back in the day). |
@samuelsov This looks very promising! I have a couple of questions about scope:
(Disclaimer: I have never used Polylang) |
I'm strongly inclined to merge this based on reading the code. It simply calls the Polylang function if available (so will have no impact on people who do not have the extension). I suspect the intersection between wordpress experts & i18N experts is fairly small? @KarinG or @nganivet might fall in the camp.. |
Agreed - I see no conflict with existing installs. What interests me is that activating the |
I've given this the merge-ready flag to indicate it is considered (by me) 'good to merge' - but there is still scope for some discussion so we should find a balance between rushing to merge & letting it drift off the radar |
I agree this is an improvement and I see no conflict with existing installs. |
@christianwach My knowledge of WordPress is somewhat limited, but CiviCRM language content should follow the website current language whatever context :
|
Merging based on the reviews. |
CRM-21470 Add support for WordPress Polylang plugin
Overview
For multilingual sites, CiviCRM has a useful setting to inherit the language from the CMS language.
Unfortunately, in WordPress, there is no unified way to deal with multilingual site so for each i18n plugins, we need to add some code in CiviCRM to support it.
This PR adds support for WordPress Polylang plugin => https://fr.wordpress.org/plugins/polylang/
To reproduce the problem :
Install Polylang and configure at least 2 languages

Configure CiviCRM in multiligual mode with 2 languages and set "Inherit CMS Language"

In civicrm.settings.php, uncomment as needed lines like :
define('CIVICRM_LANGUAGE_MAPPING_xx_XX')
(to resolve ambiguity between language short 'fr' and language long form 'fr_FR' or 'fr_CA')Create a contribution page and translate at least the title
Add a page with the shortcode to the contribution page and translate it to the second language

Before
When visiting the new page and switching language, the form is not translated (CiviCRM default language) - see title and submit button for example.
After
The form is properly translated.