-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Extract locales from downloads #2760
Conversation
Feedback-wise I can only attest that this works with every mod I tested so far, and that it is a cool feature :D. For a later GUI implementation, I think we have to redo our search/filter structure soon. |
It's probably better to call the property
Comparing those two options, |
996994b
to
1790185
Compare
|
I imagine we would set up a separate module for each of those optional downloads and mark them as recommended or suggested. Has anyone taken that approach yet? Seems like it would be a big packaging hassle.
I think this would have to be handled as per below...
Yes, you could put a |
AirlockPlus has had localization cfgs for other languages in a separate zip file ever since localization became a thing in KSP -- it was one of the first to have support for all four languages at the time. The packaging is not that big of a hassle, really. OTOH the use case where localization involves replacing textures, kspedia, etc, would probably necessitate separate downloads. As far as I can imagine it'd be most aptly handled using the main install + patch approach. Instructions for manual installs would be straightforward: "drop main install into GameData, then drop desired language patch into GameData, accept if it asks about overwriting files". CKAN installs can be configured as needed (looks like a good fit for The alternatives I can think of are:
If language patches offered as separate installs are treated as separate modules, then it pretty much boils back down to one of the use cases I posted at #538 (comment) for auto-suggesting optional localization patches based on the end-user's installed KSP language. |
Heh, that file is less than 3 KB. We could already create an AirlockPlus-Localization module and make it a suggestion for AirlockPlus (mental note to self...), and then this pull request's code would mark it as containing the appropriate localizations. So that use case is covered.
This case would probably be handled by one module per locale, sharing downloads but with different install stanzas. And since this pull request inspects the files to be installed for the given module rather than all the files in the ZIP, each such module would be tagged with the appropriate locales automatically if it contains .cfg files, or manually in the netkan if it's just other resources. So I think this is covered as well.
Yeah, that's no problem. 👍 |
This is ready to merge, barring discovery of functional issues or discussion of the schema/spec changes. |
Motivation
#2113 suggested filtering mods by language. To achieve that, we would need to acquire metadata tracking modules' translations. That would be pretty tedious to do manually.
Changes
Now Netkan will examine the .cfg files in each download to see if they have translation data using some fancy regular expressions. If any translations are found, their locale names will be added to the module's
localizations
property. This is a list of strings that flows through to theCkanModules.localizations
property in the application and could be used to implement displays and filters in the future. No UI changes are made yet.I'm mainly seeking feedback on this at this point. Did I miss anything that would prevent this from working? Would we need additional data to implement filters?