LexikTranslationBundle icon indicating copy to clipboard operation
LexikTranslationBundle copied to clipboard

[RFC][XliffExporter] Export to groups

Open rvanlaak opened this issue 8 years ago • 4 comments

We use .yml now, but really would like to migrate to .xlf. Everything related to importing it in Weblate works okay now, see https://github.com/nijel/weblate/issues/939 for the process to get that working.

Our .yml file used to be nested, in order to group translations per page. This nesting was removed because of the yml import / xlf export. The xlf just contains the "flat translation key".

What about exporting the yml nesting/grouping to xlf using the XLIFF Groups? It would be really great if that would work, and if Weblate would also support that type of grouping. See https://github.com/nijel/weblate/issues/1040.

Would it be able to easily import them afterwards? Does the database structure currently support these groups? Or this can be done by building a recursive array by splitting the translation keys?

rvanlaak avatar Mar 23 '16 11:03 rvanlaak

Maybe we can have a look at https://github.com/schmittjoh/JMSTranslationBundle/blob/master/Translation/Dumper/XliffDumper.php when we would choose to improve the XliffExporter a bit. They seem to add way more fields as this bundle's exporter does.

rvanlaak avatar Mar 23 '16 11:03 rvanlaak

The database structure does not currently support groups, to do that we would need a new group field in TransUnit or maybe a new Group entity. This would require to update the import task/process to manage this group for xlf, and for yml maybe we can image something like if the key is like menu.customers.list the group will be menu and the real key will be customers.list. And maybe the fact of using group would be an option (false by default) to be able to keep the current behavior.

cedric-g avatar Mar 31 '16 08:03 cedric-g

Basically I was thinking of the hierarchical structure .yml uses, so grouping would be based on the example you provide. It seems that Weblate does not take these xliff groups into account, but it would be great to group translations per page.

rvanlaak avatar Mar 31 '16 08:03 rvanlaak

Ping @cedric-g do you want me to do any other fixes?

I'm trying to test Symfony 3 compatibility, and given https://github.com/lexik/LexikTranslationBundle/pull/196#issuecomment-194724554 can we maybe release v4.0.0 after merging this one?

rvanlaak avatar Apr 15 '16 13:04 rvanlaak