I have created multiple modules in Drupal that each are creating some content types (using Features module).
I would like to be able to export the field translation of those content types on a per module basis instead of having one large .po file with all field translations.
This patch allows to export fields translations on a "per content type" basis (for the exception of the comments fields).
I have created a patch that adds an option as "Field per content type" to the "Export" form. It process all fields and assign them to an array based on their content type (taken from their context). For list key-values, I put those fields in a temporary array waiting to process the parent field, so we would know to which content type it belongs. After that, I create a file for each content type found and create a zip file under the temporary directory of the drupal.
Thank you !
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | export_per_contenttype-1407054-4.patch | 4.76 KB | emorency |
| #1 | export_per_contenttype-1407054-1.patch | 4.6 KB | emorency |
Comments
Comment #1
emorency commentedThis is my patch... Please review.
Comment #2
webflo commentedPlease reroll your patch with Drupal coding standards. (Use 2 Spaces, instead of Tabs).
Comment #3
webflo commentedI review later.
Comment #4
emorency commentedSorry. Here is the patch with spaces instead of tabs.
Comment #5
emorency commentedComment #7
jose reyero commentedThe idea doesn't look bad, though if we ever go for some string exports, this needs to be implemented into i18n_string, maybe per textgroup per language, because we don't want to be doing one implementation like this per object type.
Since the patch doesn't pass tests, it is not updated, closing this one, though if you want to keep working on it (reopen), it may find some place in this other i18n_contrib module as a stand alone module.