From 9009cc7a7b5bfb499c68262b210cfb3ab2c4e9c8 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Thu, 26 Jan 2023 03:30:07 +0000 Subject: [PATCH] Add langcodes 3.3.0 and language-data 1.1 (vendor'd from `pip install langcodes[data]`) Add a Select2 drop-down to `add-shows` and `edit-show`. The Select2 enables displaying inline language flag images, this feature deprecated by the native `select` drop-down element on some browsers. Change run existing TVInfo source language lists through validation (removes ~4 bad items), de-dupe list, get the native names, English names, and three letter abbr. Change remove marisa-trie requirement from language_data/names.py because nothing in SG calls a function that requires it. Change update some flags. --- HACKS.txt | 1 + gui/slick/css/style.css | 10 + gui/slick/images/flags/hy.png | Bin 0 -> 212 bytes gui/slick/images/flags/ka.png | Bin 0 -> 287 bytes gui/slick/images/flags/nb.png | Bin 0 -> 397 bytes gui/slick/images/flags/nn.png | Bin 0 -> 397 bytes gui/slick/images/flags/sq.png | Bin 0 -> 324 bytes gui/slick/images/flags/ua.png | Bin 303 -> 0 bytes gui/slick/images/flags/uk.png | Bin 545 -> 303 bytes gui/slick/interfaces/default/editShow.tmpl | 22 +- .../interfaces/default/home_newShow.tmpl | 17 + gui/slick/js/editShow.js | 72 +- gui/slick/js/newShow.js | 63 +- lib/langcodes/__init__.py | 1931 + lib/langcodes/build_data.py | 242 + .../data/language-subtag-registry.txt | 48462 ++++++++++++++++ lib/langcodes/data_dicts.py | 4377 ++ lib/langcodes/language_distance.py | 188 + lib/langcodes/language_lists.py | 517 + lib/langcodes/registry_parser.py | 59 + lib/langcodes/tag_parser.py | 422 + lib/langcodes/util.py | 8 + lib/language_data/__init__.py | 0 .../data/extra_language_names.csv | 68 + .../data/language-subtag-registry.txt | 48462 ++++++++++++++++ lib/language_data/data/languageInfo.xml | 442 + .../data/override_language_names.csv | 3 + lib/language_data/data/supplementalData.xml | 5645 ++ .../data/wiktionary/codes-en.csv | 7845 +++ lib/language_data/language_lists.py | 89 + lib/language_data/name_data.py | 9210 +++ lib/language_data/names.py | 112 + lib/language_data/population_data.py | 6140 ++ lib/language_data/registry_parser.py | 58 + lib/language_data/util.py | 15 + sickgear/webserve.py | 37 +- 36 files changed, 134485 insertions(+), 32 deletions(-) create mode 100644 gui/slick/images/flags/hy.png create mode 100644 gui/slick/images/flags/ka.png create mode 100644 gui/slick/images/flags/nb.png create mode 100644 gui/slick/images/flags/nn.png create mode 100644 gui/slick/images/flags/sq.png delete mode 100644 gui/slick/images/flags/ua.png create mode 100644 lib/langcodes/__init__.py create mode 100644 lib/langcodes/build_data.py create mode 100644 lib/langcodes/data/language-subtag-registry.txt create mode 100644 lib/langcodes/data_dicts.py create mode 100644 lib/langcodes/language_distance.py create mode 100644 lib/langcodes/language_lists.py create mode 100644 lib/langcodes/registry_parser.py create mode 100644 lib/langcodes/tag_parser.py create mode 100644 lib/langcodes/util.py create mode 100644 lib/language_data/__init__.py create mode 100644 lib/language_data/data/extra_language_names.csv create mode 100644 lib/language_data/data/language-subtag-registry.txt create mode 100644 lib/language_data/data/languageInfo.xml create mode 100644 lib/language_data/data/override_language_names.csv create mode 100644 lib/language_data/data/supplementalData.xml create mode 100644 lib/language_data/data/wiktionary/codes-en.csv create mode 100644 lib/language_data/language_lists.py create mode 100644 lib/language_data/name_data.py create mode 100644 lib/language_data/names.py create mode 100644 lib/language_data/population_data.py create mode 100644 lib/language_data/registry_parser.py create mode 100644 lib/language_data/util.py diff --git a/HACKS.txt b/HACKS.txt index 2de46cce..ebd909c2 100644 --- a/HACKS.txt +++ b/HACKS.txt @@ -17,6 +17,7 @@ Libs with customisations... /lib/hachoir_parser/guess.py /lib/hachoir_parser/misc/torrent.py /lib/imdbpie +/lib/language_data/names.py /lib/lockfile/mkdirlockfile.py /lib/rtorrent /lib/scandir/scandir.py diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css index 36caf58d..9b7fdebe 100644 --- a/gui/slick/css/style.css +++ b/gui/slick/css/style.css @@ -1312,6 +1312,9 @@ div.formpaginate{ width:480px; margin-top:0 } +#addShowForm #nameToSearch.select2{ + width:428px; +} #addShowForm #nameToSearch.wide{ width:591px; } @@ -3790,6 +3793,13 @@ option.flag{ background-position:10px 50% } +#select2-infosrc-lang-select-container .flag, +#select2-infosrc-lang-select-results .flag{ + padding-left:25px; + background-repeat:no-repeat; + background-position:0 50% +} + /* Anime section for editShow */ .anigrouplists-wrapper{ height:auto; diff --git a/gui/slick/images/flags/hy.png b/gui/slick/images/flags/hy.png new file mode 100644 index 0000000000000000000000000000000000000000..6b754cc5428e192b12ba4d3c35fa0643e106f67d GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~o!3-oFZT@ltDVqSF5Z9Ytk*7Vw1Km9mJ-lxO zC7!eQKVk28qpJZ0*-$;e@yp}oD0?LtG_n2pn| zf#w8zx;Tb#Tu(i5o3BBEhxvk^q=Lb^|NqzPooen@_q`=@=#1erbt_igr2>bRZVAc~ zXy;d#NZ~nidB%$N!2icTJu!93*B6msRb|d&E^_>SW{ctPI%e-WX5IPbTl;{DbuV^d~3I&d%oM=HA}k{r&ya)YQPhz};eR`T6CuMKyYOO|yFnHz)NNnMuT7 lmlq-C5ffE6Dd$w2rY{XK1;u8BLm2=7002ovPDHLkV1fpEh_3(u literal 0 HcmV?d00001 diff --git a/gui/slick/images/flags/nb.png b/gui/slick/images/flags/nb.png new file mode 100644 index 0000000000000000000000000000000000000000..74264c5866b6768e421e265c20b7fb4920a50f61 GIT binary patch literal 397 zcmV;80doF{P)uvT^z*GMerxw97J#v9TYe53l#hS7YA42(XS8+Dni|?6{_e^ z0>#DTCf9r3Yen=DPLjhp$+?MsQKOn;p4@!+yjt!V6P1buSuW@orovWFjs=sYFK~w>AL=Yy2 zQyrvGi^l;I?uvT^z*GMerxw97J#v9TYe53l#hS7YA42(XS8+Dni|?6{_e^ z0>#DTCf9r3Yen=DPLjhp$+?MsQKOn;p4@!+yjt!V6P1buSuW@orovWFjs=sYFK~w>AL=Yy2 zQyrvGi^l;I?5poq_N6peG4>`&g zr;RUlgya%wQm$gyS&p4I%A*|RC_tT|a!ZkN?tlNWXUZY?ptD>rk1t1kmz+|FltKzQ zN-0Ind3AEc`D3eBSl!q!X5h5L9{+NhuHK*4U7|Vc0eL7L*pPN6bcqFN2kfPP&Y+-3 zy2Rv!v)wizS_??nGH08TXq#swlr!1qZQyrA06$2FZs;mH{mK9U002ovPDHLkV1k3k BflvSd diff --git a/gui/slick/images/flags/uk.png b/gui/slick/images/flags/uk.png index 405e897c5298a4ef4b1e45a81e292b9fb43ccdfd..7182cb3878a9a92eb3dc193c6083be75d3f1176a 100644 GIT binary patch delta 277 zcmV+w0qXvt1g`>+BYyz)Nkl5poq_N6peG4>`&gr;RUlgya%wQm$gyS$~e5H_D?Nj)+ za_)csv1iI5_@J{~FOM%reV3e4h?GJKIZ7!-&3Scl#Q9^ZS6JQHFJ|Dh!yf-~ny%iT z)?K1G>;ZWw9oUd|CUl7fX$S13f6kzwNV>%2gtOf?AX*DZ*fM9El4zS}B$PAR=WXD3 bL;ycXhi>R9Iu8BH00000NkvXXu0mjf3?_c! delta 521 zcmV+k0`~o{0-*$uBYy$tNkl7tLGkNShC{O|Bb8u{ri9W;g>}lZqHwT2gv?ErRRTNE08g1 z;pN`B7fzmd{I9F#-`}4THeFyyYB{*)P}<;IuzsvG!Pp4-_H+C45;kPwU-QQ5^MiY?)aaQ@;^TQe`MtUkPwhkAD@4& zuD|Tp>y& zxv}m;S658QF(CVow(c)YZJ?{I?3euf|NqOZxi1o8nt!IAV-QSdn7sM&zkh$fw^tlJ zaJ#VKU|z#vpbP(oc>E4>{`dE9c-pqmxYgSa-}?LK$Lj>&?4l(MRr3x^aY=U0TqLM7 zheu;Fhw6m$*Iu+rTeOIqoWAmsLA;njw17c4SH!Tcch7ZK(>wq?OlYc5mkVeB0000< LMNUMnLIPldhNu{u diff --git a/gui/slick/interfaces/default/editShow.tmpl b/gui/slick/interfaces/default/editShow.tmpl index efc409a7..c9733cab 100644 --- a/gui/slick/interfaces/default/editShow.tmpl +++ b/gui/slick/interfaces/default/editShow.tmpl @@ -28,6 +28,24 @@ + + + + + #if $varExists('header')

Edit $header

#else @@ -244,10 +262,10 @@
-