Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for xgettext #116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

vhdirk
Copy link

@vhdirk vhdirk commented Mar 4, 2024

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",
]

log::error!(
target: "i18n_embed::assets",
"Filename {:?} is not valid UTF-8.",
match globwalk::GlobWalkerBuilder::new(&self.base_dir, "*").build() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can leave the walkdir dependency here because we aren't yet using any globwalk features from what I can tell, and it is already an internal dependency of globwalk?

@kellpossible
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants