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

XbBuilder could work without explicit xb_builder_add_locale() calls #41

Open
mwleeds opened this issue Jan 21, 2020 · 1 comment · May be fixed by #104
Open

XbBuilder could work without explicit xb_builder_add_locale() calls #41

mwleeds opened this issue Jan 21, 2020 · 1 comment · May be fixed by #104

Comments

@mwleeds
Copy link

mwleeds commented Jan 21, 2020

Currently one must call xb_builder_add_locale() on an XbBuilder object to add system locales before using xb_builder_compile(), at least if one is using XB_BUILDER_COMPILE_FLAG_SINGLE_LANG. @pwithnall proposed an alternative way for it to work here:

Seems a bit odd that most instances of XbBuilder have to have this loop called on them, using the results of g_get_language_names(), before they will work properly.
Looking at the implementation, it basically checks any node which has an xml:lang attribute set. If the attribute value is not in the set of locales, that node is ignored.
Seems like it would be faster and more convenient to have an XbBuilder:use-system-locales property, which tells XbBuilder to check for set inclusion against g_get_language_names() internally. Then you don’t need to set it up, or copy a list of strings.

@hughsie
Copy link
Owner

hughsie commented Jan 21, 2020

use-system-locales works for me.

hughsie added a commit that referenced this issue Nov 28, 2021
@hughsie hughsie linked a pull request Nov 28, 2021 that will close this issue
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 a pull request may close this issue.

2 participants