Import translation files when adding a new langage

Gábor Hojtsy - May 21, 2007 - 14:47
Project:Drupal
Version:6.x-dev
Component:language system
Category:feature request
Priority:normal
Assigned:Gábor Hojtsy
Status:closed
Description

Here is a dead simple patch to import translation files for all enabled modules when adding a new language. To do this cleanly, I have done the following:

- renamed the _installer and _system batch functions to _by_language() and _by_component(), moved the finished callback to an optional parameter to facilitate reuse
- modified language addition, so a new language is made enabled automatically (this is logical in itself and is also more logical with the importing taking place - we only import for enabled stuff)
- added a little finished callback to inform the user about the results of language file imports when a new language is added.

Tested with the Czech language files posted by meba before (http://drupal.org/node/142869). Done the following to test:

- clean database install with Czech locale: install time importing still works
- deleted the Czech language on the admin interface
- added the Czech language on the admin interface: translations were imported for all enabled modules
- went to the module list and installed some modules: translation importing worked for the newly installed modules

This is a simple and straightforward patch to complete the language importing circle. Drupal and module update related functionality and the reimport functionality desired by Dries will come in a joint patch once this is in.

AttachmentSize
language_import_1.patch5.62 KB

#1

meba - May 21, 2007 - 19:29

Nothing to say. Just works :-) No issues with patching or notices

#2

Dries - May 22, 2007 - 07:41

Clean and simple -- can go straight in.

#3

Dries - May 22, 2007 - 07:41
Status:needs review» fixed

Committed!

#4

Anonymous - June 5, 2007 - 07:48
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.