CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Default settings for installations in non-English
Pages: [1]

Author Topic: Default settings for installations in non-English  (Read 487 times)

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Default settings for installations in non-English
February 15, 2015, 05:38:58 pm
This is partially linked to my previous post about localizing the installer (http://forum.civicrm.org/index.php/topic,35749.0.html), but is a separate issue:

When we install CiviCRM, we can "pre-seed" the configurations for a given language. This localizes specific configurations such as individual prefixes, suffixes, location types, genders, phone types, various profiles, etc.

However, one great annoyance of installing CiviCRM repeatedly is that, while we have pre-seeded most of these configurations, CiviCRM still defaults some configurations such as:

- default language: English
- default currency: USD
- default currency format: %c %a ($ 123)
- default date/time formats, country, province, etc.

There are ways to go around this by using customs extensions, for example, based on https://github.com/eileenmcnaughton/eu.tttp.setting. However, there is no official or unofficial way at the moment. Extensions are great for people who are familiar with CiviCRM, but for new users, especially non-English native people, it is a huge barrier.

So I was thinking of this:

- currently the defaults are set in CRM/Core/Config/Variables.php
- we could have per-language files in CRM/Core/Config/Variables/xx_YY.php
- it would be a PHP file returning an array that can be used by civicrm_api3('Setting', 'create', $params).
- invite translators to send us their defaults (it shouldn't change often, so not a big deal?)

During installation, if there was a language selected, check if CRM/Core/Config/Variables/xx_YY.php exists, and execute civicrm_api3('Setting', 'create', $params).

There's a catch: to use the API (or DAO in general), the CMS needs to be initialized (bootstrapped). In my tests, I only managed to get it to work with Drupal.
« Last Edit: February 15, 2015, 05:44:40 pm by mathieu »
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Default settings for installations in non-English
February 15, 2015, 05:40:46 pm
Proof of concept for the civicrm_api3() part:
https://github.com/mlutfy/civicrm-core/commit/3d0de8e7ef14bda7b763371d0c52b201b961fc07
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Default settings for installations in non-English

This forum was archived on 2017-11-26.