kodi-game / kodi-game-scripting

Scripting for Kodi Game add-ons
GNU General Public License v2.0
5 stars 9 forks source link

[master] metadata sync action #91

Closed gade01 closed 3 years ago

gade01 commented 3 years ago

This action will automatically sync:

between addon.xml and language files.

When changes are done in either addon.xml or in the language files, the action will open a pull request with the synced changes.

Please merge any open Weblate pull request first.

garbear commented 3 years ago

Looks great! I don't think we need PRs on every single change (doesn't scale with 125 add-ons). Can you have the workflow push directly?

gade01 commented 3 years ago

I'll hear @anxdpanic if that's possible. He coded the script and workflow.

gade01 commented 3 years ago

@garbear Thanks to @anxdpanic this action will now push directly. We should probably change the actions for other repos to do the same.

Should we still keep if settings?

garbear commented 3 years ago

We should drop if settings. And we might need to modify the templates folder or even the code to always generate a language file.

Another concern is that we regex-replace the "Supported files" line in the generated description: {% if ("Supported files: " in xml.addon.extension[1].description.content) %}. The extra languages might mess with the parsing. Once we get this PR ready, let's test on an add-on.

gade01 commented 3 years ago

Exactly, I agree on always generate a language file for translations of addon.xml.

I removed if settings.

garbear commented 3 years ago

@gade01 I've been waiting to test the generator on multiple <description> tags. It parses for supported extensions to generate a new description (which would clear the translation), and multiple <description> tags for different languages in addon.xml might interfere.

Regrettably, I have no time to test. What do you think? I want to bump all add-ons for the language changes, and I'm eagerly willing to risk a few hundred extra builds on the mirrors. Give the word and I'll hit the button.

gade01 commented 3 years ago

@garbear Lets's try it out and see what happens. :) I have time right now to test and fix stuff if anything happens.

Another thing is that all descriptions in addon.xml containing line breaks, should have them replaced with [CR][CR] instead.

garbear commented 3 years ago

I'm doing a full run of add-ons. Let's see how this goes!