Subtitle language extensions: ISO 639-1 vs ISO 639-2

All your suggestions, requests and ideas for future development
Post Reply
Posts: 1
Joined: 29 Jan 2013, 12:13

Subtitle language extensions: ISO 639-1 vs ISO 639-2

Post by Faber »


Currently downloaded subtitles are automatically named <basename>.<ISO 639-2 language>.<ext>, i.e. "".

My mediaplayers (Popcorn Hour A-100 and A-110) does not recognize the language in ISO 639-2 format, but require it in ISO 639-1 format, i.e. "".

It also looks like ISO 639-1 is the standard elsewhere (I haven't been able to find anything but FileBot that uses ISO 639-2).

Does anyone else require ISO 639-2?

It is a simple fix to output ISO 639-1 instead:

Code: Select all

---	(revision 1432)
+++	(working copy)
@@ -206,7 +206,7 @@
 		StringBuilder sb = new StringBuilder(name);
 		if (languageName != null) {
-			String lang = Language.getISO3LanguageCodeByName(languageName);
+			String lang = Language.getLanguageByName(languageName).getCode();
 			if (lang == null) {
 				// we probably won't get here, but just in case

User avatar
The Source
Posts: 19004
Joined: 16 Nov 2011, 08:59
Location: Taipei

Re: Subtitle language extensions: ISO 639-1 vs ISO 639-2

Post by rednoah »

The 3-letter standard is better and has less issues (eg hi = hebrew or hearing-impaired) than the 2-letter one. Most HTPC software shouldn't have any issues with that anyway.

You can always fix things via renaming and using {lang.language} or using the "Filename Find & Replace script to fix things.


Code: Select all

filebot -script fn:replace --def "" "" /path/to/files
:idea: Please read the FAQ and How to Request Help.
Post Reply