mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-02-17 17:24:54 +00:00
Added a list of common languages which will be put on top of the language drop downs.
This commit is contained in:
parent
a1edacd843
commit
e09d72b8a0
@ -93,6 +93,9 @@ extract_language_code(wxString source) {
|
||||
wxString copy;
|
||||
int pos;
|
||||
|
||||
if (source.Find("---") == 0)
|
||||
return "---";
|
||||
|
||||
copy = source;
|
||||
if ((pos = copy.Find(" (")) >= 0)
|
||||
copy.Remove(pos);
|
||||
@ -242,6 +245,24 @@ to_utf8_wx(wxString &src) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool
|
||||
is_popular_language(const char *lang) {
|
||||
return
|
||||
!strcmp(lang, "Chinese") ||
|
||||
!strcmp(lang, "Dutch") ||
|
||||
!strcmp(lang, "English") ||
|
||||
!strcmp(lang, "Finnish") ||
|
||||
!strcmp(lang, "French") ||
|
||||
!strcmp(lang, "German") ||
|
||||
!strcmp(lang, "Italian") ||
|
||||
!strcmp(lang, "Japanese") ||
|
||||
!strcmp(lang, "Norwegian") ||
|
||||
!strcmp(lang, "Portuguese") ||
|
||||
!strcmp(lang, "Russian") ||
|
||||
!strcmp(lang, "Spanish") ||
|
||||
!strcmp(lang, "Swedish");
|
||||
}
|
||||
|
||||
mmg_dialog::mmg_dialog(): wxFrame(NULL, -1, "mkvmerge GUI v" VERSION,
|
||||
wxPoint(0, 0),
|
||||
#ifdef SYS_WINDOWS
|
||||
|
@ -95,6 +95,7 @@ extern bool title_was_present;
|
||||
|
||||
wxString &break_line(wxString &line, int break_after = 80);
|
||||
wxString extract_language_code(wxString source);
|
||||
bool is_popular_language(const char *lang);
|
||||
wxString shell_escape(wxString source);
|
||||
vector<wxString> split(const wxString &src, const char *pattern = ",",
|
||||
int max_num = -1);
|
||||
|
@ -45,7 +45,7 @@ bool title_was_present = false;
|
||||
tab_input::tab_input(wxWindow *parent):
|
||||
wxPanel(parent, -1, wxDefaultPosition, wxSize(100, 400),
|
||||
wxTAB_TRAVERSAL) {
|
||||
uint32_t i;
|
||||
uint32_t i, insert_idx;
|
||||
wxString language;
|
||||
|
||||
new wxStaticText(this, wxID_STATIC, _("Input files:"), wxPoint(5, 5),
|
||||
@ -122,6 +122,17 @@ tab_input::tab_input(wxWindow *parent):
|
||||
sorted_iso_codes.Add(language);
|
||||
}
|
||||
sorted_iso_codes.Sort();
|
||||
sorted_iso_codes.Insert("---common---", 0);
|
||||
insert_idx = 1;
|
||||
for (i = 0; iso639_languages[i].iso639_2_code != NULL; i++) {
|
||||
if (!is_popular_language(iso639_languages[i].english_name))
|
||||
continue;
|
||||
language.Printf("%s (%s)", iso639_languages[i].iso639_2_code,
|
||||
iso639_languages[i].english_name);
|
||||
sorted_iso_codes.Insert(language, insert_idx);
|
||||
insert_idx++;
|
||||
}
|
||||
sorted_iso_codes.Insert("---all---", insert_idx);
|
||||
}
|
||||
|
||||
cob_language =
|
||||
|
Loading…
Reference in New Issue
Block a user