Kodi skin localize VS Code extension - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12) +--- Thread: Kodi skin localize VS Code extension (/showthread.php?tid=367861) |
Kodi skin localize VS Code extension - roidy - 2022-04-13 Alpha release of a VS Code extension to help with skin localization. Adds a context menu item to replace selected text with a localization from either the main Kodi language po or the skins language po. Works in three steps:- 1. Check the current main Kodi strings.po file from GitHub for the string and if found replace the string with $LOCALIZE[xxxxx] 2. Check the skins own strings.po file for the string and if found replace the string with $LOCALIZE[xxxxx] 3. If no match is found in steps 1 or 2 then create a new translation entry in the skins strings.po file at the first free id and re-save the file. Currently only localizes from "your_skin_directory\language\resource.language.en_gb\strings.po" If there's enough interest I can make it localize from other language directories. v0.1.4-alpha Code restructure Added settings for decoration color and initial localization type. Unified the $LOCALIZE[] and ID commands into one. First run of Localize will use the operation type defined in the settings. Following operations will toggle the type. WARNING:- This is an alpha release, PLEASE, PLEASE backup your skin files before using. The extension creates a back up of your current strings.po file before writing any changes, however that's no guarantee and things my go wrong, and if they do I wont be held responsible for loss of data. V0.2.9 https://github.com/roidy/kodi-localize/releases/download/v0.2.9/kodi-localize-0.2.9.vsix RE: Kodi skin localize VS Code extension - roidy - 2022-04-15 Version 0.1.2-alpha Added text decoration to the editor window to show the localized string. Text decoration of a skinshortcuts file:- RE: Kodi skin localize VS Code extension - scott967 - 2022-04-16 I would like to check this out. On my skin the 31000-31999 block is used up. What happens in that case? scott s. . RE: Kodi skin localize VS Code extension - roidy - 2022-04-16 Umm... Isn't the 31000-31999 block the only block allowed for use by skins? https://kodi.wiki/view/Language_support#Layout_of_the_strings.po_file Code: These IDs are reserved by Kodi: If you needed to add a new string to your skin what id would you use if you've already used up the 31000-31999 range? If there is another range that can be used I can add it to the extension. ---------------------------------------------------------------------------- So after looking through some other skins it looks like the Amber skin uses id's in the 32000 range. So are we allowed to use the 32000 range even though the wiki says that range is reserved for scripts? RE: Kodi skin localize VS Code extension - scott967 - 2022-04-17 Right that's the thing. What does the extension do or try to do in that case (or maybe I'm mis-reading it)? Meanwhile, on existing skin code I have a label with a Kodi id in it. I select it and try Kodi: $LOCALIZE[] but nothing happens? scott s. . RE: Kodi skin localize VS Code extension - roidy - 2022-04-17 (2022-04-17, 03:09)scott967 Wrote: Right that's the thing. What does the extension do or try to do in that case (or maybe I'm mis-reading it)? If the 31000-31999 range is full then the extension will do nothing, it currently only adds strings in that range and if it's already full then it can't add a string. That's why I asked you what ID you would use after filling up the 31000-31999 range so I could add the extra range. Quote:Meanwhile, on existing skin code I have a label with a Kodi id in it. I select it and try Kodi: $LOCALIZE[] but nothing happens? Could you post the a section of the file with the problem label so I can test please. RE: Kodi skin localize VS Code extension - roidy - 2022-04-17 v0.1.4-alpha Code restructure Added settings for decoration color and initial localization type. Unified the $LOCALIZE[] and ID commands into one. First run of Localize will use the operation type defined in the settings. Following operations will toggle the type. RE: Kodi skin localize VS Code extension - roidy - 2022-04-18 v0.1.5-alpha Fix for decorator false positives. RE: Kodi skin localize VS Code extension - scott967 - 2022-04-29 I need to update, but with the version I have installed it would show things like Container(510) with $LOCALIZE[510] definition scott s. . RE: Kodi skin localize VS Code extension - roidy - 2022-04-30 Yep the decoration is a bit flaky, is your Container(510) inside an $INFO[] by any chance? I need to improve number detection inside $INFO[] should be fixed in 0.1.6 At the moment the following gets decorated Any number inside $LOCALIZE[] Any number inside <label></label> but not if it's an actual $NUMBER[] Any number inside label="" - used inside skinshortcuts overrides.xml RE: Kodi skin localize VS Code extension - roidy - 2022-04-30 v0.1.6-alpha More decoration false positive fixes. RE: Kodi skin localize VS Code extension - scott967 - 2022-05-02 (2022-04-30, 08:55)roidy Wrote: Yep the decoration is a bit flaky, is your Container(510) inside an $INFO[] by any chance? I need to improve number detection inside $INFO[] should be fixed in 0.1.6exactly. <label>$INFO[Container(510).Listitem(5).Label] generates 2 decorators from Kodi master strings.po scott s. . RE: Kodi skin localize VS Code extension - roidy - 2022-05-02 Should be fixed in v0.1.7 RE: Kodi skin localize VS Code extension - realcopacetic - 2022-05-04 oh wow this is so cool, wish I had this when I decided it would be easier to write everything manually and worry about localising later... :/ RE: Kodi skin localize VS Code extension - roidy - 2022-05-04 (2022-05-04, 15:01)QuizKid Wrote: oh wow this is so cool, wish I had this when I decided it would be easier to write everything manually and worry about localising later... :/Lol....That's the situation I'm in. I'm well into writing my skin and hadn't given any thought to localization, just writing strings directly into the xml files, then it hit me... At some point I've got to localize every one of these strings So faced with the daunting task of localizing every string I thought it would be better to just write a VS Code extension to make it easier |