CRM-13584 Localising the CiviCRM installation

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.6
    • Component/s: None
    • Labels:
    • Documentation Required?:
      None

      Description

      It would be a "nice to have" to be able to install CiviCRM in another language, e.g. for the installer itself to be translatable.

      The topic came up in discussions during CiviCon/sprints, since a lot of people, while they have some understanding of English, will feel more comfortable in their language. It also makes CiviCRM look more professional and shows that we take localization seriously.

      (Yes, a lot of the documentation is still in English, but as the community grows, we can localize that too. Ex: Drupal can be installed in another language, has localized docs, special sub-sites for various languages, etc)

      The topic also came up some time ago in CRM-9003.

        Attachments

          Issue Links

            Activity

            [CRM-13584] Localising the CiviCRM installation
            Mathieu Lutfy added a comment -

            Here's a first proof of concept:
            https://github.com/mlutfy/civicrm-core/commit/62fbebae2d69f4503c11d80e9675d21e4fc87139

            Tested with both native gettext, and phpgettext.

            Mathieu Lutfy added a comment -

            screenshot

            NB: technically, nothing much more needs to be done to support a localized installer, except adding more ts() calls in the code, and modifying the string extractor to have a new component for the strings.

            Kurund Jalmi added a comment -

            Mathieu,

            Didn't we merge the changes mentioned in this issue?

            Kurund

            Mathieu Lutfy added a comment -

            @Kurund: yep, closing

            Monish Deb added a comment -

            The changes made in this issue causing drupal installation break ('dsn not found anywhere') for 4.5 using tarball as I confirmed it on reverting the changes made in https://github.com/civicrm/civicrm-core/commit/62fbebae2d69f4503c11d80e9675d21e4fc87139.

            I have taken a fair bit of time to investigate it, but couldn't find possible fix for 'dsn not found anywhere' break (while civi installation on d7)

            So submitting the revert of the above commit : https://github.com/civicrm/civicrm-core/pull/3392 (now the installation break 'dsn not found anywhere' doesn't occur for drupal)

            Mathieu Lutfy added a comment -

            I have tried a new attempt at this:
            https://github.com/mlutfy/civicrm-core/tree/civi46-crm13584

            More specifically:
            https://github.com/mlutfy/civicrm-core/commit/93974d6bd0d4b2ae7046f9ed1a99b3363179d415

            To fix the "DSN not found" issue, I added a "free()" function on CRM_Core_Config, so that it forces the next call to CRM_Core_Config::singleton() to re-initialize properly.

            I tried calling CRM_Core_Config::singleton(TRUE, TRUE); to force the re-initialization, but during the installer, the civicrm.settings.php is not sourced yet, and working around it was getting clumsy (manually sourcing the file, etc).

            If anyone could review before I do a PR, would be much appreciated.

            My next step would be to define some settings by default, such as the default language, default country, default currency, monetary format, etc. This would be fairly straight forward, but we can't call the API from the installer (the CMS if not yet bootstrapped in Wordpress?). To keep it simple, and modeled on the current way of doing things, I would add sql queries to the generated .sql files (ex: civicrm_data_fr_CA.sql). Any thoughts?

            Monish Deb added a comment -

            Mathieu, I tried to see the localization changes on CiviCRM installation but whatever the locale/language I choose it doesn't effect the page although the page refreshed with appended seedLaungue. Please check the screenshot http://snag.gy/WS5bH.jpg as you can see on selecting France nothing seems to change. Am I missing something on this ?

            Thanks

            Mathieu Lutfy added a comment -

            Hi Monish,

            Can you test with an updated version of the translation file for French?
            https://download.civicrm.org/civicrm-l10n-core/mo/fr_FR/civicrm.mo

            This file needs to be in l10n/fr_FR/LC_MESSAGES/civicrm.mo

            I did a few changes the other day, since the 'install.po' files was not being merged into the official .mo files.

            You can also check that the strings you are looking for are in the civicrm.mo file by doing "msgunfmt civicrm.mo -o civicrm.po", then search with grep/text editor. And obviously, the string has to be in ts(). In my new patch, I had only put a few strings in ts(), but I see that you are using my previous PR from before? (and presumably applied the other patch for the changes to CRM_Core_Config).

            I'm on IRC if you have any questions (bgm). Thanks!

            Mathieu

            Monish Deb added a comment - - edited

            Mathieu, as per our discussion in IRC I incorporated all the changes in my branch https://github.com/monishdeb/civicrm-core/compare/civicrm:master...monishdeb:CRM-13584?expand=1 . I have tested it in Drupal 7 and ensured that the changes don't cause any conflict with other CMS. I am not sending the PR yet, as I am not sure if there is any miss. Can you please review my changes?

            Thanks

            Mathieu Lutfy added a comment -
            David Greenberg added a comment -

            Can you verify the PR please.

            Tim Otten added a comment -

            There are still some non-localized strings in index.php. I think you can find them by searching for "<li>".

            Mathieu Lutfy added a comment -

            Did a few tests with the latest 'dist' tar.gz, seems pretty much OK, however, it seems that setting the language makes most other settings stay NULL, ex: currency, date format, etc.

            I would normally try to set the correct settings for most languages, but given the time frame, I won't be able for 4.6.

            The simplest solution I found was to force to revert the settings before setting the language. This way most settings are OK (although en_US, but still less wonky than NULL).

            PR: https://github.com/civicrm/civicrm-core/pull/5287

            Mathieu Lutfy added a comment -

            Final PR for the last strings:
            https://github.com/civicrm/civicrm-core/pull/5309

            There are only a few non-translated strings because they happen before ts() has been initialised.

              People

              • Assignee:
                Mathieu Lutfy
                Reporter:
                Mathieu Lutfy

                Dates

                • Created:
                  Updated:
                  Resolved: