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/translation#13 Enable users to choose their own language for accessing CiviCRM #13240

Merged
merged 4 commits into from
Dec 12, 2018

Conversation

aydun
Copy link
Contributor

@aydun aydun commented Dec 6, 2018

Overview

Users on multilingual sites are able to select their language of choice from the available languages. Monolingual sites have only been able to set the language for all users.

This change enables users of monolingual sites to select their own language without affecting other users.

The background for this is https://lab.civicrm.org/dev/translation/issues/13 although this implementation has evolved from that suggested in the 'Approach' section. This replaces PR #12405

Before

In monolingual mode, /admin/setting/localization
screenshot from 2018-12-05 23-40-55

After

In monolingual mode, /admin/setting/localization
screenshot from 2018-12-06 12-17-18

Results in Language Switcher block being shown (same as in multilingual mode)
screenshot from 2018-12-06 12-19-23

Technical Details

This introduces a new localization setting 'uiLanguages'. The existing logic for determining the appropriate language in multilingual mode is extended to monolingual (looking at request url, session, uf_match etc). In line with that, the language switcher block is not shown if the setting 'Inherit CMS Language' is set. The UI Languages setting on the settings page is not shown in multilingual mode nor when 'Inherit CMS Language' is selected.

There are no (intentional!) changes to multilingual mode

Comments

A documentation PR will be provided.

@civibot
Copy link

civibot bot commented Dec 6, 2018

(Standard links)

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

Test Failure looks related @aydun

@aydun
Copy link
Contributor Author

aydun commented Dec 6, 2018

@seamuslee001 In the test environment, are the l10n files installed? So does CRM_Core_I18n::languages() return all the languages or just en_US ?

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

hmm test failure here https://test.civicrm.org/job/CiviCRM-Core-PR/23519/testReport/junit/(root)/CRM_Core_I18n_LocaleTest/testUiLanguages/ still looks to be an issue @aydun maybe FR_CA isn't in the default one

@seamuslee001
Copy link
Contributor

ping @mlutfy You might be into this one

@aydun
Copy link
Contributor Author

aydun commented Dec 10, 2018

ping @mlutfy You might be into this one

Yes - this is the thing we discussed at the Governance Summit

@aydun
Copy link
Contributor Author

aydun commented Dec 10, 2018

@seamuslee001 Thanks for tracking down the issue in #13246 The tests here are passing cleanly now.

@mlutfy
Copy link
Member

mlutfy commented Dec 12, 2018

Hi @aydun, this works great! I have only a small superficial request: can you change the string "UI Languages" to "Available Languages"?

When we are in multi-lingual mode, the interface looks like this:

capture d ecran de 2018-12-12 10-03-37

I think the wording should be imitated. "UI" is a geeky term, and "Available languages" does not imply multi-lingual data anyway.

(The "Languages available to users of this installation" doesn't mean anything useful, so I would ignore that string.)

Testing

  • Test backend, as an admin, used the language switcher to change languages (on a new install, added French)
  • Test front-end as anonymous user (event registration)
  • Test enabling multi-lingual (it does not auto-enable the languages, but I think that's OK)
  • Test on existing multi-lingual sites

Documentation

  • This should have a clear warning that many settings and option values will not be properly translated, but that this should not have a major impact on end-users. Ex: "individual prefix/suffix" will not be translated, gender options, etc.

@aydun
Copy link
Contributor Author

aydun commented Dec 12, 2018

Thanks @mlutfy - I've changed "UI Languages" to "Available Languages"

@mlutfy
Copy link
Member

mlutfy commented Dec 12, 2018

Great! Seems OK to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants