Questions about $LOCALIZE and strings.xml
#1
Hi Guys,

I'm trying to tweak an existing skin and whilst looking through the Kodi wiki pages on skinning I've noticed mention of "$LOCALIZE" in a number of wiki pages e.g. on the label parsing page and the label formatting page. However, it's not clear to me what exactly $LOCALIZE[something] does/returns and what is represented by what goes in the brackets.

Also, there's mention of strings.xml. Where is this mysterious file located? I can't seem to find it anywhere :|

Would really appreciate it if someone could kindly explain what they do and how to use them or point me to a source which can help.

Thanks Wink
Reply
#2
strings.xml was the old xml-based format for translations, you now have to edit the strings.po file (located in language/xxx/ ).
$LOCALIZE[] basically explicitely tells kodi to translate that label id to the corresponding label. (have a look at the strings.po files and you will understand Smile )
be aware that there are also other labels available than the ones provided by the skin. Kodi for example has its own ones in Kodi-folder/language/)
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
(2015-02-09, 21:48)phil65 Wrote: strings.xml was the old xml-based format for translations, you now have to edit the strings.po file (located in language/xxx/ ).
$LOCALIZE[] basically explicitely tells kodi to translate that label id to the corresponding label. (have a look at the strings.po files and you will understand Smile )
be aware that there are also other labels available than the ones provided by the skin. Kodi for example has its own ones in Kodi-folder/language/)

Thanks Phil, it all makes sense now. The odd mentions of 'strings.xml' and $LOCALIZE without actually linking or mentioning languages in the wiki had me wondering what it was about. Tongue
Reply
#4
Sorry to be really stupid, but I can't find where the Kodi system labels are stored. I've searched the Kodi directory in my programs directory and my roaming appdata folder for a strings.po file but the only ones I find are in the specific addons. The following is a segment of Ronie's code for Album Information in Transparency. I can't work out where the localize[563] comes from. The addon's own strings.po file starts at 31000.

Code:
                            <item>
                                <label>[UPPERCASE][B]$LOCALIZE[563]:[/B][/UPPERCASE]</label>
                                <label2>$INFO[ListItem.Property(Album_Rating)]</label2>
                                <onclick>noop</onclick>
                            </item>

Also, while here I really prefer star ratings to numbers, but if I change the label to $INFO[ListItem.Property(Album_StarRating)] it doesn't work. Is there a list item property for star rating?
Reply
#5
https://github.com/xbmc/xbmc/blob/master...strings.po
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#6
Take a look at the KODI main string.po located in /Program files/KODI/addons/resource.language.en_gb/resources/
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply
#7
Brilliant - thanks guys - that saved me a few days of hunting.

So, 33067 is star rating. Just need to work out how to get the list item property.

BTW - the wiki still refers to strings.xml. http://kodi.wiki/view/Label_Parsing
Reply
#8
(2015-09-10, 12:28)WelshPaul Wrote: BTW - the wiki still refers to strings.xml. http://kodi.wiki/view/Label_Parsing

http://kodi.wiki/view/Language_support

This is the old strings management. Replaced by strings.po
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply

Logout Mark Read Team Forum Stats Members Help
Questions about $LOCALIZE and strings.xml0