opensubtitles-uploader icon indicating copy to clipboard operation
opensubtitles-uploader copied to clipboard

Language detect

Open afigamli opened this issue 2 years ago • 1 comments

Hi. I want to point out a bug in language auto-detect. It seems to me that you only use iso639-1 to detect the language. In Iceland (where I live) we use the .srt ending .ice.srt because some application seems to only uses iso639-2. 639-1 uses "is" but 639-2 uses "ice" or "isl" for Iceland. Both versions seem to be available in the autodetect language (node_modules\detect-lang\iso-639.json) However, the module trims out the first two letters in the code and only uses 639-1 which is "is" So if I use the ending .ice.srt it does not find the language but if I change it to .isl.srt it does.

In the Wikipedia site: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes you can find out what happens if you try two endings who is listed there ".arm.srt" and ".hye.srt" which is the two 639-2 code for the Armenian language. But if you use ".arm.srt" it returns the result Arabic which has the 639-1 code "ar"

Java is not my primary programming language so I was not able to find out for myself.

Br afigamli

afigamli avatar Jan 25 '22 21:01 afigamli

Thanks I'll check that out when I get time

vankasteelj avatar May 10 '22 21:05 vankasteelj