kellpossible / cargo-i18n

A Rust Cargo sub-command and libraries to extract and build localization resources to embed in your application/library
MIT License
121 stars 25 forks source link

Support translation of Glade XML file #22

Open DBLouis opened 4 years ago

DBLouis commented 4 years ago

It is possible to extract strings to be translated from a Glade file with:

xgettext -L Glade -o ui.pot ui.xml

A simpler solution could be to include/merge .pot files from a given directory, defined in the configuration. In this case generating the .pot files from other sources can be done in the build script for example.

kellpossible commented 4 years ago

@DBLouis this seems like a sensible idea! I'll look into it, and if it can be made to work generically.

kellpossible commented 4 years ago

This project includes localization from YAML files, https://git.open-communication.net/spacekookie/traduki , perhaps when implementing this issue feature, could also consider how it would fit into including similar plain text key-value files, and even per-language assets used for localizing assets such as documentation and large chunks of text, in a similar style to Hugo/Zola.

kellpossible commented 4 years ago

It looks like Glade typically uses inltool to extract strings, and merge them again. This tool supports a number of different formats, it would be good to support them all via intltool.

kellpossible commented 4 years ago

Reading the original comment though it seems like I misunderstood the original feature request, which was to have a way to merge in pot files generated by other tools (and thus support glade with a little manual help).

kellpossible commented 3 years ago

I'm hopefully going to try making a glade gtk example to test supporting this use case. Help contributing on this would be welcomed.