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) »
  • Copying local translations from one language region to another
Pages: [1]

Author Topic: Copying local translations from one language region to another  (Read 2313 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Copying local translations from one language region to another
December 22, 2009, 01:39:09 pm
I'm trying to change from using en_US and fr_FR to using en_US and fr_CA. I have set up fr_CA, but noticed when I enabled it that it draws all of its values from the en_US value even though I would strongly prefer to take them from fr_FR instead.

I'd like to fix this up manually using SQL.

Is there a way to copy over all of the local translations that were made to a previous version of the same language for a different region, ie fr_FR, for things like field labels, etc.

To be more specific, is it safe to overwrite the values in some_table_name_fr_CA with those from some_table_name_fr_FR to replace the ones that are created from the default one some_table_name_en_US? Are there other places I should be looking to make changes besides these tables?
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Copying local translations from one language region to another
December 23, 2009, 01:00:33 am
Quote from: JoeMurray on December 22, 2009, 01:39:09 pm
I'm trying to change from using en_US and fr_FR to using en_US and fr_CA. I have set up fr_CA, but noticed when I enabled it that it draws all of its values from the en_US value even though I would strongly prefer to take them from fr_FR instead.

You mean upon creation? It draws from the default language. If you have a backup (and are willing to revert), you can try going to your en_US+fr_FR site, set fr_FR as the default and then add fr_CA – it should then clone the fr_FR columns for fr_CA (rather than en_US). If not, it’s a bug.

Quote
I'd like to fix this up manually using SQL.

If so, the best bet would be to run
Code: [Select]
UPDATE {table} SET {field}_fr_CA = {field}_fr_FR;
for all the table/field combinations found in CRM/Core/I18n/SchemaStructure.php.

Quote
To be more specific, is it safe to overwrite the values in some_table_name_fr_CA with those from some_table_name_fr_FR to replace the ones that are created from the default one some_table_name_en_US?

Yes, although to remember that the {table}_xx_YY things are just views, which expose {table}.{field}_xx_YY as {table}_xx_YY.{field} – so it’s probably sanest to do the above UPDATEs.

Quote
Are there other places I should be looking to make changes besides these tables?

Please take a look at CRM/Core/I18n/SchemaStructure.php and let me know if anything’s not clear.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: Copying local translations from one language region to another
December 23, 2009, 05:26:55 am
Thanks, Piotr.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Copying local translations from one language region to another

This forum was archived on 2017-11-26.