Import translation files when adding a new langage
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | language system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Gábor Hojtsy |
| Status: | closed |
Jump to:
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.
| Attachment | Size |
|---|---|
| language_import_1.patch | 5.62 KB |

#1
Nothing to say. Just works :-) No issues with patching or notices
#2
Clean and simple -- can go straight in.
#3
Committed!
#4