CiviCamp Brussels 2018

CiviCRM Translation

Using CiviCRM in another language than US-English
(installing, configuring, challenges, improving translation, documentation, community, useful tricks, and more!)

 

 

 

 

 

Bonjour!

Empowering contributor Founding associate partner
  • CiviCRM developer (2007)
  • Core Team member (2017)
  • Translation / sysadmin
  • SymbioTIC.coop
@bgm @mlutfy

Plan

  • Translation?
  • Developer tips
  • Administrator tips
  • Q&A

Internationalisation (i18n)

 

Makes it possible to adapt software to different languages without changing code.

 

 

 

Привет!

 

 

 

ts('Hello!');

 

 

  • date formats (04/22/2018 vs 2018-04-22)
  • time formats (16:15 vs 4:15pm)
  • money/currency formats ($5.75 vs 5,75 $)
  • address formats
  • "left to right" vs "right to left"
  • first day of the week
  • taxes by state/province/country
  • taxes included, or displayed separately
  • invoicing format
  • membership expiration rules
  • legislation (GDPR, anti-spam, language)
  • formality and titles (Dr, Prof, Hon, Ms/Mrs/Mz)
  • gendered language, plural

Translator community

  • 70 language teams registered
  • 37 languages and variants > 20% completion
  • 1,362 contributors
  • 117,000 words
  • 2017 new/improved: Farsi, Serbian, Ukrainian, Russian, Chinese, Korean

Transifex.com

https://docs.civicrm.org

Translator community

  • Mattermost
    https://chat.civicrm.org/civicrm/channels/translation
  • Gitlab
    https://lab.civicrm.org/development-team/translations/
  • Stack Exchange
    tags: translation, i18n, localisation

Localised installer

Localised installer

Localised installer

Localised installer

Localisation (l10n)

Administer > Localisation > Languages

Multi-lingual

Using CiviCRM in many languages at once.

Extension translation

Translation for developers

Extension translation


  <?php

  use CRM_I18nexample_ExtensionUtil as E;

  class CRM_I18nexample_Page_Hello extends CRM_Core_Page {
    function run() {
      // New syntax (provided by the latest civix)
      $greeting = E::ts('Hello!');

      // Old syntax:
      $greeting = ts('Hello!', ['domain' => 'ca.bidon.i18nexample']);
    }
  }

https://github.com/mlutfy/ca.bidon.i18nexample
https://docs.civicrm.org/dev/en/latest/translation/

Working with the API


  civicrm_api3('Event', 'get', [
    'id' => 123,
    'return.title' => 1,
    'option.language' => 'fr_CA'
  ]);

l10n update extension

  • updates core + extensions
  • write access to l10n directory
  • [todo] 'ready for automatic distribution'

Practical tech stuff

  • Export to Excel extension
  • PDF export: wkhtmltopdf
  • Translation helper extension
  • Native gettext
Translation helper demo
Translation helper demo

"Native" gettext

  • hosting must support the language ("locale -a")
  • define('CIVICRM_GETTEXT_NATIVE', 1); in civicrm.settings.php

"Good" practices

  • Ask or assume the preferred language
  • Let people change their language on their profile
  • Work in the language of the user (offline contrib receipts)
  • Templates per-language
  • Scheduled reminders for each language
  • Mailings per language
CiviCRM translation roadmap

Get involved!

  • Stack Exchange: tag 'localisation'
  • Gitlab
  • Test new versions
  • Be bold and translate
  • Bug me

Questions?

~translation

mathieu@civicrm.org