-
Notifications
You must be signed in to change notification settings - Fork 9
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
Provide translation completeness metadata #5
Comments
There's a few possible approaches: One way you could do it right now is, just grab the hashmap from the The I do it this way right now in the libintl vs. spirit_po validation tests here: https://github.com/cbeck88/spirit-po/blob/master/test_libintl/main.cpp#L242 That's a bit awkward for you though since at least in theory, I might change the data structure that is used to represent a message in the catalog... I think in reality, I'm not really going to do that, and you have my lib in your tree anyways. So its not like you are that vulnerable to compatibility problems if I change this, you just won't upgrade until you are ready. (I guess I can't really know what I might be forced to do in the future, but it seems really unlikely that I would be forced to make such a change at this point.) A better thing I could do is provide an "is_complete" member function of the message object, similarly to how I provide See and the related code comment. Another thing I could do is do that, and also collect completion stats, in the catalog metadata. It might also be cool if we can provide an accessor, beyond what libintl does, so that you can query if a particular string is actually translated, and give WML people a warning or something if an untranslated string actually appears in their campaign. (Wesnoth could make that that optional or something I guess?) Idk, what do you think is best? |
I'm afraid calculating translation% would be very CPU-intensive, no matter what approach is taken. While 99.99% of the times the user only needs 1 out of 58 translations. We might cache the results, of course... |
Is there any way to get the percentage complete of a given translation? Over in Wesnoth we're considering a build-time script that checks completeness and writes it to a metadata key in the repo (wesnoth/wesnoth#2466), but it occurs to me that Spirit Po might be able to do that itself at runtime. Is such a thing possible?
The text was updated successfully, but these errors were encountered: