Skip to content

Commit

Permalink
libhb: update iso639 language codes (HandBrake#5978)
Browse files Browse the repository at this point in the history
* libhb: update iso639 language codes

* LinGui: fix crash when there is no iso639_1 code
  • Loading branch information
jstebbins authored Apr 21, 2024
1 parent 267fda4 commit 6b90700
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 10 additions & 1 deletion gtk/src/hb-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,16 @@ language_opts_set(signal_user_data_t *ud, const gchar *name,
for (iso639 = lang_get_next(NULL); iso639 != NULL;
iso639 = lang_get_next(iso639))
{
int index = lang_lookup_index(iso639->iso639_1);
int index;

if (iso639->iso639_1 != NULL && iso639->iso639_1[0] != 0)
{
index = lang_lookup_index(iso639->iso639_1);
}
else
{
index = lang_lookup_index(iso639->iso639_2);
}
gchar * lang;

if (iso639->native_name[0] != 0)
Expand Down
10 changes: 8 additions & 2 deletions libhb/lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ static const iso639_lang_t languages[] =
{ "Cornish", "kernewek", "kw", "cor" },
{ "Corsican", "Corsu", "co", "cos" },
{ "Cree", "", "cr", "cre" },
{ "Croatian", "hrvatski", "hr", "hrv", "scr" },
{ "Croatian", "hrvatski", "hr", "hrv" },
// Deprecated version of Croatian code 'scr'
// When used, HB will record the latest iso639_2 'hrv' as the code in titles
// and write the correct code to the output since the line above that has
// no 2b variant will be used when generating output.
{ "Croatian", "hrvatski", NULL, "hrv", "scr" },
{ "Czech", "čeština", "cs", "ces", "cze" },
{ "Danish", "dansk", "da", "dan" },
{ "Divehi", "ދިވެހިބަސް", "dv", "div" },
Expand All @@ -65,6 +70,7 @@ static const iso639_lang_t languages[] =
{ "Fijian", "Na Vosa Vakaviti", "fj", "fij" },
{ "Finnish", "suomi", "fi", "fin" },
{ "French", "Francais", "fr", "fra", "fre" },
{ "Filipino", "Wikang Filipino", NULL, "fil" },
{ "Western Frisian", "Frysk", "fy", "fry" },
{ "Fulah", "Fulah", "ff", "ful" },
{ "Georgian", "ქართული", "ka", "kat", "geo" },
Expand Down Expand Up @@ -122,7 +128,7 @@ static const iso639_lang_t languages[] =
{ "Malayalam", "മലയാളം", "ml", "mal" },
{ "Maori", "Reo Māori", "mi", "mri", "mao" },
{ "Marathi", "मराठी", "mr", "mar" },
{ "Malay", "Bahasa Melayu", "ms", "msa", "msa" },
{ "Malay", "Bahasa Melayu", "ms", "msa", "may" },
{ "Malagasy", "Malagasy", "mg", "mlg" },
{ "Maltese", "Malti", "mt", "mlt" },
{ "Moldavian", "limba moldovenească", "mo", "mol" },
Expand Down

0 comments on commit 6b90700

Please sign in to comment.