• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7
Kodi skin localize VS Code extension
#1
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.

Image

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.
Image

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.
Image



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/r...0.2.9.vsix
Reply
#2
Version 0.1.2-alpha

Added text decoration to the editor window to show the localized string.

Image

Text decoration of a skinshortcuts file:-
Image
Reply
#3
I would like to check this out.  On my skin the 31000-31999 block is used up.  What happens in that case?

scott s.
.
Reply
#4
Umm... Isn't the 31000-31999 block the only block allowed for use by skins?

https://kodi.wiki/view/Language_support#...gs.po_file
Code:
These IDs are reserved by Kodi:
strings 30000 thru 30999 reserved for plugins and plugin settings
strings 31000 thru 31999 reserved for skins
strings 32000 thru 32999 reserved for scripts
strings 33000 thru 33999 reserved for common strings used in add-ons

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?
Reply
#5
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.
.
Reply
#6
(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.
Reply
#7
v0.1.4-alpha
Code restructure

Added settings for decoration color and initial localization type.
Image

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.
Image
Reply
#8
v0.1.5-alpha
Fix for decorator false positives.
Reply
#9
I need to update, but with the version I have installed it would show things like Container(510) with $LOCALIZE[510] definition

scott s.
.
Reply
#10
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
Reply
#11
v0.1.6-alpha
More decoration false positive fixes.
Reply
#12
(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.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
exactly.  <label>$INFO[Container(510).Listitem(5).Label] generates 2 decorators from Kodi master strings.po

scott s.
.
Reply
#13
Should be fixed in v0.1.7
Reply
#14
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... :/
Reply
#15
(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 Sad 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 Big Grin
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
Kodi skin localize VS Code extension0