Important addon devs: language file formatting (and more...)
#1
over the years, several language format related changes have been made in kodi.
but since none of those changes were mandatory, many addons haven't been adjusted to them.

we'd like to ask you to make those changes to your addon as well, so we can phase out the old formats in the future.
to aid you in converting some bits and to pieces to the new format, there's an addon available that will get the job done for you:
script.language-convert-0.0.4.zip

this addon will make the following changes:

- in your addon.xml it will update all 'lang' attributes
example: <description lang="en"> to <description lang="en_GB">

- if you are using strings.xml language files, they will be converted to strings.po files

- language folder names will be converted to the current format *
example: English to resource.language.en_gb


PLEASE MAKE A BACKUP OF YOUR ADDON BEFORE RUNNING THIS SCRIPT!


* some addons include languages which are not supported by kodi, those language files will be removed by the addon
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#2
Now all my addons don't display any text? kodi 17.6
Kodi addons: Lanik repo
Reply
#3
OK I think I found the reason - it generated lines like

msgctxt "

and it should be

msgctxt "#

D.
Kodi addons: Lanik repo
Reply
#4
thanx for the heads-up!
fixed in v0.0.2
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
In the gettext po file header, should the "language" entry conform to the ll_CC format?  It seems like just the two-letter ll is accepted.

scott s.
.
maintainer of skin  Aeon MQ5 mods for post-Gotham Kodi releases:
Krypton
Leia
Reply
#6
(2018-06-16, 01:28)scott967 Wrote: In the gettext po file header, should the "language" entry conform to the ll_CC format?  It seems like just the two-letter ll is accepted.

scott s.
.
 both should work afaik...

the Estuary skin uses ll_CC for instance: https://github.com/xbmc/xbmc/blob/master...ngs.po#L16
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#7
What's the oldest version of Kodi that supports the newer language file format?  I'm just trying to figure out to which of the repo-script branches I need to submit updates and what minimum version of xbmc.addon I should list in the dependencies.  I did some Google searching, and I *think* the new format works as far back as Frodo, but I want to make sure.
Providing a debug log: Log_file/Easy (wiki)
Leia Estuary mod: 333143 (thread)
Artist Slideshow: Add-on:Artist_Slideshow (wiki)
SpeedFan Information Display: Add-on:SpeedFan_Information_Display (wiki)
Reply
#8
New format supported since 15.x
My repository: repository.vlmaksime
Reply
#9
Hey,
this doesn't seem to work with the Keymap Editor Addon which gives me an error on running:
Quote:2019-06-14 20:41:09.783 T:1086993280 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
File "/storage/.kodi/addons/script.language-convert/default.py", line 160, in <module>
Main()
File "/storage/.kodi/addons/script.language-convert/default.py", line 32, in __init__
self.updateFiles(langpath, folders, name, addonid, author)
File "/storage/.kodi/addons/script.language-convert/default.py", line 118, in updateFiles
text = parse.unescape(string.text)
File "/usr/lib/python2.7/HTMLParser.py", line 448, in unescape
TypeError: argument of type 'NoneType' is not iterable
-->End of Python script error report<--
Any ideas?
Thanks
Reply
#10
thanx for the report!
should be fixed in this version: script.language-convert-0.0.4.zip
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#11
(2019-06-15, 12:48)thent Wrote: Hey,
this doesn't seem to work with the Keymap Editor Addon which gives me an error on running:
Any ideas?
Thanks 
I had a similar error trying to change one of my own addons.  Turned out to be down to me having an empty string which throws an error.
The offending line here is:
'<string id="30001"></string>'
in addons/script.keymap/resources/language/English/strings.xml
Change that to:
'<string id="30001"> </string>'
and the conversion will run.
Whether that affects the addon I've no idea (though I'd be surprised).
I guess this is a bug, but maybe there's good reason for the behaviour.

edit: already fixed, never mind.
Reply
#12
(2019-06-15, 13:04)ronie Wrote: thanx for the report!
should be fixed in this version: script.language-convert-0.0.4.zip

Works perfectly, thanks for your quick reply!
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
addon devs: language file formatting (and more...)00