kellpossible / cargo-i18n

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

add support for xgettext #116

Open vhdirk opened 6 months ago

vhdirk commented 6 months ago

I'm building a GTK application where lots of translation strings exist inside Gnome Builder *.ui files.

This PR adds support for running xgettext over non-rust files.

My i18n.toml file now looks like this:

fallback_language = "en"

[gettext]
target_languages = ["nl"]
xtr = true

xgettext = [
    "src/**/*.ui",
    "data/*.xml.in",
    "data/*.xml.in.in",
    "data/*.desktop.in.in",
]
kellpossible commented 6 months ago

Thanks for the contribution! It needs a cargo fmt and I left one comment, then hopefully soon good to merge!