Skip to content
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

(dev/drupal/17) Add Drupal8 support for getUFLocale() #12139

Merged
merged 1 commit into from
May 15, 2018

Conversation

monishdeb
Copy link
Member

Overview

This makes it possible to support multilingual Drupal8. For example, if a site is available in both French and English, using prefix-based language detection in Drupal8, CiviCRM will automatically select the correct locale as well (i.e. "inheritLocale").

Drupal7 used global variables for language, whereas Drupal8 uses more clearly defined functions. Hence this was not clearly failing before.

To reproduce:

  • Enable Drupal locale, bilingual site, enable multi-lingual in CiviCRM, add FR/EN.
  • Create a public profile in CiviCRM
  • Translate the profile field labels
  • Access in French/English.

https://lab.civicrm.org/dev/drupal/issues/17

Before

The forms were always in the default site language.

After

The forms are in the language of the user.

@monishdeb
Copy link
Member Author

ping @totten @mlutfy

@seamuslee001
Copy link
Contributor

Changes seem to make sense to me but will await confirmation from @mlutfy but it seems a reasonable re-submit of his PR with a number of tidy ups

@mlutfy
Copy link
Member

mlutfy commented May 15, 2018

Looks good. I tested it in production, using our main use-cases (including the CiviCRM REST API endpoint), and seems all OK. Thanks @monishdeb !

(CiviCRM Review Template WORD-1.0)

@mlutfy mlutfy merged commit 6a35be0 into civicrm:master May 15, 2018
@monishdeb monishdeb deleted the dev-drupal-17 branch January 21, 2019 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants