Subtitle naming for language identification
#1
I understand that, in order for Kodi to correctly identify a subtitle's language, subtitle files must follow a naming convention, like
  moviename.id.srt,

I imagine that some identifiers are:
English - en;
French - fr;
Italian - it.

What are the correct identifiers for the following languages:
German - ge ou de?
Portuguese (Brazilian) - pb or pt-br?
Spanish - sp or es?
Reply
#2
Hi,

it should be the two-didget iso-code provided here: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.

So for your three languages in question it should be:

DE Germany 1974 .de
PT Portugal 1974 .pt
ES Spain 1974 .es

It's working for all languages I had come accross, maybe some developers can point to the correct code-list used, mostly those lists in question uses the same values.
Reply
#3
Thank you for sharing this, I've been looking for this information.
Reply
#4
I believe the internal format used is ISO 639-2B. There is a utility function that can take ISO-639-1 and convert it to 639-2B. Plus, there is the ability in advancedsettings.xml (languagecodes) to define your own language string, which should reference the desired 639-2B code.

For external subs, though, for some reason the gui converts the string to ISO631-1 first. Not sure the reason for that. From looking at LangCodeExpander.cpp for German I see:
Code:
{ "de", "ger", "deu", "deu" }
so it should be able to convert "ger" or "deu" to "de" without needing to define anything special in advancedsettings.

scott s.
.
Reply
#5
How to set the subtitle language for an online source?

I have the following json information from the source API:
Quote:[{u'Language': u'Danish', u'MimeType': u'text/vtt;charset=utf-8', u'Type': u'Foreign', u'Uri': u'https://www.dr.dk/mu-online/api/1.2/bar/5bc88ce6a11f9f146c8a5e23'}, {u'Language': u'Danish', u'MimeType': u'text/vtt;charset=utf-8', u'Type': u'Foreign_HardOfHearing', u'Uri': u'https://www.dr.dk/mu-online/api/1.2/bar/5bc88ce6a11f9f146c8a5e26'}]]

Where I now only give "Uri" url to the itemlist.SetSubtitles( [ url ] ), but this means that the language in the menu in kodi ui is unknown and the subtitle name is for instance "5bc88ce6a11f9f146c8a5e26".

How do I give it more sane language and name info?

I workaround is of course to download to local tmp/files.srt with proper names, but I would prefer just to set som itemlist property info Smile

Regards
Termo
Reply

Logout Mark Read Team Forum Stats Members Help
Subtitle naming for language identification0