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) »
  • When adding new languages to CiviCRM, is example data translated?
Pages: [1]

Author Topic: When adding new languages to CiviCRM, is example data translated?  (Read 1494 times)

simkin

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: WordPress 3.x
  • MySQL version: 5.x
  • PHP version: 5.x
When adding new languages to CiviCRM, is example data translated?
June 27, 2012, 05:35:07 am
Hello,

I just want to make sure I didn't make it wrong. I've downloaded and installed CiviCRM as a plugin to WordPress.
I've followed the instructions to make it multilang by downloading the l10n package and uncompressing it to the right place.
Then, from Admin > Localization I've added some languages.

Now, the question: the newly created db fields called title_xx_XX,  description_xx_XX or  label_xx_XX, should be populated with the correct "example data" translations? In my case, all the fields added for the new languages --apparently-- were just copied from the english already existing fields, is this the right behavior?

If this is the case, that would mean the civicrm_localized.sql files are just used in the installation process. Then the fastest way to get those translations into place would be to update the language.sql file to UPDATE (instead of INSERT) on the right tables, correct?

Thank you very much for your attention and your huge effort.

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: When adding new languages to CiviCRM, is example data translated?
June 27, 2012, 06:30:04 am
Hi,

You are correct. It's a limitation in how the multi-lingual switch is done. When you add another language, untranslated values will fallback on the default language. CiviCRM does not import the sample/default translations for the new language.

It would be interesting to fix this in general (automate it when we switch to multi-lingual). I'm not sure if using the sql files to update instead of insert would work (because of IDs for the tables). We could probably get "option groups" and "option values" translated pretty quickly by doing a loop on the options to translate empty values.
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

simkin

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: WordPress 3.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: When adding new languages to CiviCRM, is example data translated?
June 28, 2012, 06:07:07 pm
Hi,

Thanks for your  answer. I made a modified version of the addLocale function to reuse the translated sql files.
This modification is done in CRM/Core/I18n/Schema.php; I'd like to share it here, but the forum software is saying somthing stupid like "Sorry, you are not allowed to post external links."  (Someone should take a look to the rule that is triggering that message :-X )

Those sql files are taking too much space. Wouldn't be it better to just have the translatable strings in separate files and generate the sql files on the fly?

Br,

simkin

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: WordPress 3.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: When adding new languages to CiviCRM, is example data translated?
June 29, 2012, 04:27:21 am
Here is the diff, It is just working fine here in my local installation.

http://pastebin.com/pP2tUyrr

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • When adding new languages to CiviCRM, is example data translated?

This forum was archived on 2017-11-26.