From d636e5859606e9ef2a7ffe538ab986a123116865 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Sat, 19 Nov 2022 15:41:36 +0100 Subject: [PATCH] (Grav GitSync) Automatic Commit from RealStickman --- plugins/language-selector/CHANGELOG.md | 23 +++ plugins/language-selector/LICENSE | 21 +++ plugins/language-selector/README.md | 134 ++++++++++++++++++ plugins/language-selector/assets/readme_1.jpg | Bin 0 -> 15117 bytes plugins/language-selector/blueprints.yaml | 68 +++++++++ .../css/language-selector.css | 87 ++++++++++++ plugins/language-selector/flags/af.png | Bin 0 -> 381 bytes plugins/language-selector/flags/ar.png | Bin 0 -> 274 bytes plugins/language-selector/flags/be.png | Bin 0 -> 569 bytes plugins/language-selector/flags/bg.png | Bin 0 -> 157 bytes plugins/language-selector/flags/bo.png | Bin 0 -> 851 bytes plugins/language-selector/flags/ca.png | Bin 0 -> 194 bytes plugins/language-selector/flags/cs.png | Bin 0 -> 233 bytes plugins/language-selector/flags/da.png | Bin 0 -> 180 bytes plugins/language-selector/flags/de.png | Bin 0 -> 155 bytes plugins/language-selector/flags/el.png | Bin 0 -> 243 bytes plugins/language-selector/flags/en.png | Bin 0 -> 210 bytes plugins/language-selector/flags/eo.png | Bin 0 -> 194 bytes plugins/language-selector/flags/es.png | Bin 0 -> 287 bytes plugins/language-selector/flags/et.png | Bin 0 -> 174 bytes plugins/language-selector/flags/eu.png | Bin 0 -> 388 bytes plugins/language-selector/flags/fa.png | Bin 0 -> 351 bytes plugins/language-selector/flags/fi.png | Bin 0 -> 186 bytes plugins/language-selector/flags/fil.png | Bin 0 -> 584 bytes plugins/language-selector/flags/fo.png | Bin 0 -> 222 bytes plugins/language-selector/flags/fr.png | Bin 0 -> 150 bytes plugins/language-selector/flags/ga.png | Bin 0 -> 117 bytes plugins/language-selector/flags/gl.png | Bin 0 -> 439 bytes plugins/language-selector/flags/he.png | Bin 0 -> 212 bytes plugins/language-selector/flags/hi.png | Bin 0 -> 207 bytes plugins/language-selector/flags/hr.png | Bin 0 -> 304 bytes plugins/language-selector/flags/hu.png | Bin 0 -> 119 bytes plugins/language-selector/flags/id.png | Bin 0 -> 147 bytes plugins/language-selector/flags/is.png | Bin 0 -> 208 bytes plugins/language-selector/flags/it.png | Bin 0 -> 150 bytes plugins/language-selector/flags/ja.png | Bin 0 -> 203 bytes plugins/language-selector/flags/km.png | Bin 0 -> 321 bytes plugins/language-selector/flags/ko.png | Bin 0 -> 591 bytes plugins/language-selector/flags/lb.png | Bin 0 -> 157 bytes plugins/language-selector/flags/lt.png | Bin 0 -> 194 bytes plugins/language-selector/flags/lv.png | Bin 0 -> 186 bytes plugins/language-selector/flags/mn.png | Bin 0 -> 238 bytes plugins/language-selector/flags/ms.png | Bin 0 -> 884 bytes plugins/language-selector/flags/nb.png | Bin 0 -> 174 bytes plugins/language-selector/flags/nl.png | Bin 0 -> 157 bytes plugins/language-selector/flags/nn.png | Bin 0 -> 174 bytes plugins/language-selector/flags/pl.png | Bin 0 -> 147 bytes plugins/language-selector/flags/pt-br.png | Bin 0 -> 364 bytes plugins/language-selector/flags/pt-pt.png | Bin 0 -> 311 bytes plugins/language-selector/flags/ro.png | Bin 0 -> 153 bytes plugins/language-selector/flags/ru.png | Bin 0 -> 151 bytes plugins/language-selector/flags/sco.png | Bin 0 -> 247 bytes plugins/language-selector/flags/se.png | Bin 0 -> 252 bytes plugins/language-selector/flags/sk.png | Bin 0 -> 305 bytes plugins/language-selector/flags/sl.png | Bin 0 -> 197 bytes plugins/language-selector/flags/so.png | Bin 0 -> 255 bytes plugins/language-selector/flags/sq.png | Bin 0 -> 296 bytes plugins/language-selector/flags/sr.png | Bin 0 -> 488 bytes plugins/language-selector/flags/sv.png | Bin 0 -> 190 bytes plugins/language-selector/flags/tg.png | Bin 0 -> 211 bytes plugins/language-selector/flags/th.png | Bin 0 -> 170 bytes plugins/language-selector/flags/tl.png | Bin 0 -> 347 bytes plugins/language-selector/flags/tr.png | Bin 0 -> 239 bytes plugins/language-selector/flags/uk.png | Bin 0 -> 150 bytes plugins/language-selector/flags/vi.png | Bin 0 -> 270 bytes plugins/language-selector/flags/zh-hans.png | Bin 0 -> 312 bytes plugins/language-selector/flags/zh-hant.png | Bin 0 -> 222 bytes .../language-selector/js/language-selector.js | 91 ++++++++++++ .../language-selector/language-selector.php | 109 ++++++++++++++ .../language-selector/language-selector.yaml | 5 + plugins/language-selector/languages.yaml | 87 ++++++++++++ .../language-selector.hreflang.html.twig | 9 ++ .../partials/language-selector.html.twig | 49 +++++++ 73 files changed, 683 insertions(+) create mode 100644 plugins/language-selector/CHANGELOG.md create mode 100644 plugins/language-selector/LICENSE create mode 100644 plugins/language-selector/README.md create mode 100644 plugins/language-selector/assets/readme_1.jpg create mode 100644 plugins/language-selector/blueprints.yaml create mode 100644 plugins/language-selector/css/language-selector.css create mode 100644 plugins/language-selector/flags/af.png create mode 100644 plugins/language-selector/flags/ar.png create mode 100644 plugins/language-selector/flags/be.png create mode 100644 plugins/language-selector/flags/bg.png create mode 100644 plugins/language-selector/flags/bo.png create mode 100644 plugins/language-selector/flags/ca.png create mode 100644 plugins/language-selector/flags/cs.png create mode 100644 plugins/language-selector/flags/da.png create mode 100644 plugins/language-selector/flags/de.png create mode 100644 plugins/language-selector/flags/el.png create mode 100644 plugins/language-selector/flags/en.png create mode 100644 plugins/language-selector/flags/eo.png create mode 100644 plugins/language-selector/flags/es.png create mode 100644 plugins/language-selector/flags/et.png create mode 100644 plugins/language-selector/flags/eu.png create mode 100644 plugins/language-selector/flags/fa.png create mode 100644 plugins/language-selector/flags/fi.png create mode 100644 plugins/language-selector/flags/fil.png create mode 100644 plugins/language-selector/flags/fo.png create mode 100644 plugins/language-selector/flags/fr.png create mode 100644 plugins/language-selector/flags/ga.png create mode 100644 plugins/language-selector/flags/gl.png create mode 100644 plugins/language-selector/flags/he.png create mode 100644 plugins/language-selector/flags/hi.png create mode 100644 plugins/language-selector/flags/hr.png create mode 100644 plugins/language-selector/flags/hu.png create mode 100644 plugins/language-selector/flags/id.png create mode 100644 plugins/language-selector/flags/is.png create mode 100644 plugins/language-selector/flags/it.png create mode 100644 plugins/language-selector/flags/ja.png create mode 100644 plugins/language-selector/flags/km.png create mode 100644 plugins/language-selector/flags/ko.png create mode 100644 plugins/language-selector/flags/lb.png create mode 100644 plugins/language-selector/flags/lt.png create mode 100644 plugins/language-selector/flags/lv.png create mode 100644 plugins/language-selector/flags/mn.png create mode 100644 plugins/language-selector/flags/ms.png create mode 100644 plugins/language-selector/flags/nb.png create mode 100644 plugins/language-selector/flags/nl.png create mode 100644 plugins/language-selector/flags/nn.png create mode 100644 plugins/language-selector/flags/pl.png create mode 100644 plugins/language-selector/flags/pt-br.png create mode 100644 plugins/language-selector/flags/pt-pt.png create mode 100644 plugins/language-selector/flags/ro.png create mode 100644 plugins/language-selector/flags/ru.png create mode 100644 plugins/language-selector/flags/sco.png create mode 100644 plugins/language-selector/flags/se.png create mode 100644 plugins/language-selector/flags/sk.png create mode 100644 plugins/language-selector/flags/sl.png create mode 100644 plugins/language-selector/flags/so.png create mode 100644 plugins/language-selector/flags/sq.png create mode 100644 plugins/language-selector/flags/sr.png create mode 100644 plugins/language-selector/flags/sv.png create mode 100644 plugins/language-selector/flags/tg.png create mode 100644 plugins/language-selector/flags/th.png create mode 100644 plugins/language-selector/flags/tl.png create mode 100644 plugins/language-selector/flags/tr.png create mode 100644 plugins/language-selector/flags/uk.png create mode 100644 plugins/language-selector/flags/vi.png create mode 100644 plugins/language-selector/flags/zh-hans.png create mode 100644 plugins/language-selector/flags/zh-hant.png create mode 100644 plugins/language-selector/js/language-selector.js create mode 100644 plugins/language-selector/language-selector.php create mode 100644 plugins/language-selector/language-selector.yaml create mode 100644 plugins/language-selector/languages.yaml create mode 100644 plugins/language-selector/templates/partials/language-selector.hreflang.html.twig create mode 100644 plugins/language-selector/templates/partials/language-selector.html.twig diff --git a/plugins/language-selector/CHANGELOG.md b/plugins/language-selector/CHANGELOG.md new file mode 100644 index 0000000..fd13313 --- /dev/null +++ b/plugins/language-selector/CHANGELOG.md @@ -0,0 +1,23 @@ + +# v1.1.0 +## 11/23/2018 + +1. [](#improved) + * Add pull-request [#7](https://github.com/clemdesign/grav-plugin-language-selector/pull/7): Need jQuery 1.8 or later. + + +# v1.0.1 +## 08/10/2018 + +1. [](#improved) + * Add pull-request [#1](https://github.com/clemdesign/grav-plugin-language-selector/pull/1) + +2. [](#bugfix) + * Fix issue [#2](https://github.com/clemdesign/grav-plugin-language-selector/issues/2) + -> Improve jQuery integration + +# v1.0.0 +## 07/22/2017 + +1. [](#new) + * ChangeLog started... diff --git a/plugins/language-selector/LICENSE b/plugins/language-selector/LICENSE new file mode 100644 index 0000000..b5be971 --- /dev/null +++ b/plugins/language-selector/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Clemdesign (http://www.clemdesign.fr) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/plugins/language-selector/README.md b/plugins/language-selector/README.md new file mode 100644 index 0000000..4263f25 --- /dev/null +++ b/plugins/language-selector/README.md @@ -0,0 +1,134 @@ +# Grav Language Selector Plugin + +![Language Selector](assets/readme_1.jpg) + +`Language Selector` is a [Grav](http://github.com/getgrav/grav) plugin that provides native language selector with flags to switch between [Multiple Languages](http://learn.getgrav.org/content/multi-language). + +# Installation + +Installing the Language Selector plugin can be done in one of two ways. GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file or GIT. + +## GPM Installation (Preferred) + +The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line). From the root of your Grav install type: + + bin/gpm install language-selector + +This will install the Language Selector plugin into your `/user/plugins` directory within Grav. Its files can be found under `/yoursite/user/plugins/language-selector`. + +## Manual Installation (Download) + +To install this plugin, just download the zip version of this repository and unzip it under `user/plugins`. Then, rename the folder to `language-selector`. You can find these files either on [GitHub](https://github.com/clemdesign/grav-plugin-language-selector). + +You should now have all the plugin files under + + /yoursite/user/plugins/language-selector + + +## Manual Installation (Using GIT) + +In `user/plugins` folder, apply the following command: +``` +git clone https://github.com/clemdesign/grav-plugin-language-selector language-selector +``` + +This will clone this repository into the _language-selector_ folder. + +# Usage + +## 1. Define the supported languages + +In `system.yaml`, add the supported languages in `languages.supported` parameter. + +Example: + + languages: + supported: + - fr + - en + +## 2. Integration + +You do need to add the included Twig partials template into your own theme somewhere you want the available languages to be displayed. + +``` +{% include 'partials/language-selector.html.twig' %} +``` + +Something you might want to do is to override the look and feel of the langswitcher, and with Grav it is super easy. + +Copy the template file [language-selector.html.twig](templates/partials/language-selector.html.twig) into the `templates` folder of your custom theme: + +``` +/yoursite/user/themes/custom-theme/templates/partials/language-selector.html.twig +``` + +You can now edit the override and tweak it however you prefer. + +`language-selector` need jQuery (1.8 -> later) to display dropdown language menu. + +## 3. Usage of the `hreflang` partial + +A second template is available for `hreflang` annotations in the header of the page. In order to emit language annotations for the available languages of a page you need to add the corrsponding Twig partial template into the `` section of your page, which can typically be found in `base.html.twig`: + +``` +{% include 'partials/language-selector.hreflang.html.twig' %} +``` + +This will generate something like: + +``` + + + +``` + +# Configuration + +## Plugin + +Simply copy the `user/plugins/language-selector/language-selector.yaml` into `user/config/plugins/language-selector.yaml` and make your modifications. + +``` +enabled: true +built_in_css: true +button_display: default +select_display: default +``` + +Options `enabled` and `built_in_css` are pretty self explanatory. + +For `button_display`, this one define how button of selected language will be displayed. There are 3 possibilities: +- `default`: Flag and Language name are displayed +- `flag`: Only flag is displayed +- `name`: Only language name is displayed + +For `select_display`, this one define how language selector will be displayed. There are 3 possibilities: +- `default`: Flag and Language name are displayed +- `flag`: Only flag is displayed +- `name`: Only language name is displayed + +## Redirecting after switching language + +To have Grav redirect to the default page route after switching language, you must add the following configuration to `user/config/system.yaml` +``` +pages: + redirect_default_route: true +``` + +# Contribute + +## Languages + +For Administration panel, `Language Selector` is available in English and French. You could contribute for another languages. + +For flags and language names, it is available for both match between flag images (content in `language-selector/flags`) and the list of language name in `Grav/Common/Language/LanguageCodes.php`. +You could contribute by adding new flags to match with list of language name, or the opposite. + +Flag images are sized 24 x 12 pixels in PNG. + + + +# Credits + +[Language Selector](https://github.com/clemdesign/grav-plugin-language-selector) is based on [Lang Switcher](https://github.com/getgrav/grav-plugin-langswitcher) plugin. diff --git a/plugins/language-selector/assets/readme_1.jpg b/plugins/language-selector/assets/readme_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1a4438d554794a1574ae404c1eeb6a92f7bd624d GIT binary patch literal 15117 zcmeHtbzD`=zwYdyK~lOyx*JqBA`ODHfFf>c)13;a2ucVdAR>YYf`CYeq<}O^OG-*f zE7I(J7jM76d(Qctd;Yqgd*9)+*LvnVv!>U~_jwk$5!^JO&{ES>127m2T!;PuZkE(c zQ$@u}-#|}IQ%4m_0Dx3O2jl7nrvSjk)!WlR{Q|q$6?1liPXG>x06q{0z#8r4u4|}f z1fZa)s>1FCWjeushMmsyCC{%Ib%JeNTy3B{CvA4Oaj`kUA0T|+*T)vZ z2ptHA`(kYUAUp_RZf74C421U}Oygo}?F9gm^u+FM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b4Gh+ObUaOp1a_#_^kisn96njU$T9d zRxQ(}shqTpjV3Zp6MbujzXk@}aux{w^p;`h`9{!KS7n!1&rQAD+Jj5^S>t;J(#X;n z`}qEIGIA7!sgVJOi5#Pv1~9p|S|jG$ONW}vY}#zPNpnTU9(_5)PGeVAy62rlYu247 zV>VnZjLQa&%u*5u)igxcgtvoy6A~27BoqY|7L{a(4<1>Z72$j$tf|QB;_-4h{G$3Io1}&F&Br+ za(jX+8`?Lw9%l+9WvcdTtEC4+S`WGrtzKH**O$5FY1KyK&~Y{}_nwsl^0f8*J%Zu+ z(~sKE4`{v9WxGUTD{-lwGij#5Q$>Km=6Gf@*vfJ`!2zAM2mBHSLgSMSXft<2IJr>yZLh&dRz7G44K?)VL;> zT^loJcL8~~J(`LjQi_uQ7qaSzu7e#r3^Gdc!@NeZ9-=OPCz{?n?ekS|UVC zyH^>Wx=r_xj1#F=hHsmN<(KG*H1SNnBfER=tF3a|Yt}>`flqn!xo3u-RlV-$eR7Vs z^RR$zS_un%P$RolI~CHTn0c$L-AdRe zqKqH#E49GVS)w`Z27E_Z>hbYcLv>B}QfOUjic={98X3;T8tP!4_w8+~A9Y#nD?!`e zQq{UFmTm^}6rFyPJLpIv{-%ytd*sY*{Usgdp)?bc{)Ze=_3kc~5kQV1^xgCq^&~1n zEMn(2BzvU)qKSC-z6-;F@HkHIaM$%v9j+007q6p*$4lh9BvP9eO z>WI=zhTbtT4(#in=qhINEl?Tva3B}j1O(WQ^V0deB95dWfhglQLlk-P_XeiDydSL! zhu@y`WvO3}l#BbSc9)wptv2548zxIIS?awO$~(IRmL1CJ{Sl!03}M+EC^GSrn+87p zYif!XRPw-SDFms19yMCWn-HyzBKy8XLAaa{+NNwmM^DqrAw{U7aVp`n3Zny53YX(` usb0hhZv`g`3N_.btn:first-child { + margin-left: 0; +} + +.language-selector .btn { + float: left; + position: relative; + display: inline-block; + margin-bottom: 0; + font-weight: 400; + text-align: center; + white-space: nowrap; + vertical-align: middle; + touch-action: manipulation; + cursor: pointer; + user-select: none; + background-image: none; + border: 1px solid transparent; + /* size */ + padding: 5px 10px; + font-size: 0.8rem; + line-height: 1.5; + border-radius: 3px; + /* Aspect */ + color: #333; + background-color: #fff; + border-color: #ccc; +} + +.language-selector .dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + padding: 5px 0; + margin: 2px 0 0; + font-size: 1rem; + text-align: left; + list-style: none; + background-color: #fff; + background-clip: padding-box; + border-radius: 4px; + box-shadow: 0 6px 12px rgba(0,0,0,.175); +} + +.language-selector .dropdown-menu img { + width: 24px; + height: 12px; + max-width: inherit; +} + +.language-selector .dropdown-menu li { + line-height: 1rem; + font-color: #c0c0c0; + display: list-item; + text-align: -webkit-match-parent; +} + +.language-selector .dropdown-menu li:hover { + background-color: #eee; +} + +.language-selector .dropdown-menu>li>a { + display: block; + padding: 3px 15px; + clear: both; + font-weight: 400; + line-height: 1.42857143; + color: #333; + white-space: nowrap; +} diff --git a/plugins/language-selector/flags/af.png b/plugins/language-selector/flags/af.png new file mode 100644 index 0000000000000000000000000000000000000000..37d9b6587845546e59a4707b695e5b1beacce5a7 GIT binary patch literal 381 zcmV-@0fPRCP)*}2Uk8Cwa#wcbYa~!+f|HCX%=_~ku^6{Pj zU$(6I|JcolIu?B0DDuB&j`4r?x^S>1EOjyeTMn%M|MT&K|1Z+QD7QdHgz5j~8G`>W zu9E+++vW@Rjm_+a{||sc_F?wK|Bvjo$+rLq{xdT%{BKX<{{MBe=>LMLR{t5HmT)&E z{;%1y^8fyOR|#Ug7QnEn8q5D@ONIXLSgQ74vMC7e8)ERlT0qkv!WYSRUcda`)OF-P zzkKh19+@7znB-)7``)|%_C8Ap8cfgvY#D9g@=O24)h7~dI9>~oi;71t-~EqF*+`PX b*en15gl4V0vtfYr00000NkvXXu0mjf?&r;B4q#jWH72exCz{~sUnsyqFE zcS_#Ret%w>$1D~m4Log)#@FNii){z@Yy7M|O)99bFkgx(uxR_Y@Xh0m^eOlkrlX`NGB_ zPoS|T(C+1v`o}Z278D9duRiawm7&GaQ&_g)$ci*ZoykkL${qT^X~)g*W$)f9Bgst- QK*ut8y85}Sb4q9e04`-@{{R30 literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/be.png b/plugins/language-selector/flags/be.png new file mode 100644 index 0000000000000000000000000000000000000000..d426c2ce17b468e22018ab82b23bc2a3f4f2964b GIT binary patch literal 569 zcmV-90>=G`P)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv|NsC0|NjYC_uK#g010qNS#tmY09pV509pWWBe;D400EszL_t(I%VYRswOnl5 z(!b2dBrYWWd>zb~ap3b3E_cB>pNlwG2yFUX!nsah4?RhSKg)LLANlb&^kV(Z#lJ%0 zT}yR7FX!?VTsm+Ly1D<|>BzrjS1;XF{MDKIv-;5I63D(F?l z(qD&iS2U~r5Y)b6Tk?4gSDfHpU`Cj;N^i!Ll6hqoJ#{b$Ra``Z_XD3 zE>^(}pTBat3QYL?ozq8P7ClK=l*Km6Pu=^|v1V_F!AoYr4xtY(UJ6zU-FWd%uwLjM zJxOSy{_T)y-=ueot)ksmU+>xO_v&ADb9Zh~6Vh$nxkXK$o+K>WpTBhZ&h$I;j+;!1 zlbUk1RwqGn`V~2?8p)McRJ8i(Nx}-o4d?uC^50Q7*wnp7y6=jD4v$pNr9)b#Qu8kz z*K(&P$pEc7QVu1Y-+aqw+q-%`>8>l>+CQXvFCEb`r@w;$3A0L_G|??300000NkvXX Hu0mjfdw}}H literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/bg.png b/plugins/language-selector/flags/bg.png new file mode 100644 index 0000000000000000000000000000000000000000..503758a385178cf6c34f776f8fe133161e4ab7c4 GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^53;|t&x?dBOif}2 uKBs^ChuUN@o)n7-7XIb$3uImtV_>*{yZOFNf|DRnAA_f>pUXO@geCy%NGFv5 literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/bo.png b/plugins/language-selector/flags/bo.png new file mode 100644 index 0000000000000000000000000000000000000000..627bc3f80c57a5173744028357c059db7edc75f1 GIT binary patch literal 851 zcmV-Z1FZasP)$_6oUii-vmk_;Mq? zrk5!zN!ix;g0vNW(_HI7)zaIv)X}Undp4RB%<@UI>~;$g{PA5$$2$am!Nc2bJo1U zTdJRg`jBRIgs*f5dCOwbG?UcFc*ktRjhm>l4mA)F{$ZMMg>*&mNW={5b@d6t8?mVD zs=@_P^P_HKK=-gqZ)MVMX0oe^^ev0ZdBwTZ>wIU{^QTmC&7?T4J6WgpMb%d;txHgu zP?6fau_9j(yf8KoMb%g`h4;6DAO@8fnPH1Btq!{NcG}cITGji4_gJe2Wj|P-;K^8= zHa$p-8j`y`6yY^>fbFV>UsCG{mbVc+`;4&oDfx+RF4-;2Nu^aW#Tp7V)FrqlO^&ON zNU9I$R(*VA z+%RHVS&~G@$TYMj34Z#XKt6mYd!M<5DazTql(IA2nY+%C^MZV_%;}@Qv&MWO!iMNk z@A9<_MqPqnLYizT{Dk~WXFrFs%R(u`!b*mmyUcuHp8V_ua+zB^{b!LvxybbL3?<(o zn|A5%9FZ|UgB3fq3c+tND*L)2yTmK21U@+@P1#?;3(9!Kv|LpIuj1l}Uv{4p%2Ty4 z47oS?oX)kwtBk25Q{ulVnR^BOf}JuoI|wUV#P`X5w_uN8;N?2#B@DK{%nf$d-r0p; d+W0?$e*t-S9rx<1rR4ws002ovPDHLkV1il`m*oHe literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/ca.png b/plugins/language-selector/flags/ca.png new file mode 100644 index 0000000000000000000000000000000000000000..613c289ff9edfb0c47a06db1613a79d347e98ece GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^5i7Jhp6g7rmMhKr-SDi? j;d6+~=NgCZIXnzS#a#E#`dl~wG@QZH)z4*}Q$iB}QN2WD literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/cs.png b/plugins/language-selector/flags/cs.png new file mode 100644 index 0000000000000000000000000000000000000000..0348b37ba1c0aa5447b39504b7bd3bb44f7293c3 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^5y25EI=X7 z0*}aI1_o|n5N2eUH3y`LCEd~2k%3`jKlh(RR*-g27srr_TgeFyOm?cD|Lw2(|I~hI z1EaV=$=cuRg)V)pKYUPo%Vvf);aTC6-bydhVMyG1!EaNI^A^@8zuHo`J-+frifLF+ z`!|18(%=8PIz$|OHnARDw()@+{B|44$rjF6*2UngG&cP)7g& literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/da.png b/plugins/language-selector/flags/da.png new file mode 100644 index 0000000000000000000000000000000000000000..7cee94923f94d3d5acc5257d7ea1080d3b7a6627 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^5&U>cv7h@-A}f&Z?CIhdQgJIe!GT%4qUZnO$M3`Q z{{R2{@pFAn(Tf?40uoyj9_aq4{C~2(;M1%|LgTe~DWM4f-U~b# literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/de.png b/plugins/language-selector/flags/de.png new file mode 100644 index 0000000000000000000000000000000000000000..93e02c33cb72e4fa5689bca467f13d6d4468c587 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^5Qy6M1ew_ z1s;*b3=G`DAk4@xYYs>gOS+@4BLl<6e(pbstU!K~r;B4q#jWH72PURZvHu+{78ks( z7ijqCd6Z`dgO8)vy)+SS8>eZ1Tb_=m;g|CjuHu1S|+qvMWc zsrIEhKl+*1+$-qa=E(9`nA>BU!|@_En;jg90S1$0*q0>i5t|^wH-$xTsl;;D1uAYi jMJn1eFWq5^Vi9DJ_3`|wSgy|wbPa>2tDnm{r-UW|H7ZRj literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/en.png b/plugins/language-selector/flags/en.png new file mode 100644 index 0000000000000000000000000000000000000000..84b934ab7fe2be9ca037571cedc41a340b757a57 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^5AlQG*?aJ+h8Ca=IP=X z!f`$MgU!MN2R7WC)!1lwb+V%95$2+XH^K={iJMJlFnQ0vk;9v~o~bdZ*x+bF4@-ch z#wm#zRm)m(x3LK^32Zx%mThp9L9Jn0Qw2{#=7iz~8-}mj3{^R`q>F(zFnGH9xvXQL70(Y)*O%~mUKs7M+SzC{oH>NS%LgOPZ!6Kid)GE4ov?G8QNy@EJ=)E zNPBSediuc`YGP;hTmIjFF-qBhZR5(kgZ2s`aqD=FDVSZ=t@!@d?#Bh lh*X)Jb72MRVzCAWhQ8^Gvb>#`1b~J!c)I$ztaD0e0sxvHJIw$9 literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/es.png b/plugins/language-selector/flags/es.png new file mode 100644 index 0000000000000000000000000000000000000000..27ac4622fb30147533ee79f2cef345ceff62646b GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^51P7+$JD&avW;TAn z-K#AfADAMfBiLv|Ndvoi|YQ^*81^(r_}8KXXR%7pDvQ}&)(KjNaL7`EB7|T z|MuH2{QQ3_W8wek!%P0npYiV7|I=Y0z^YuXR}KYshjzxunU j{bsT{+sj`##Kd56>Ptgw!p3tzmos>}`njxgN@xNANWp!< literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/et.png b/plugins/language-selector/flags/et.png new file mode 100644 index 0000000000000000000000000000000000000000..bb29aba69374be6c9ba3a52693af63d0b1763a83 GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^5c>21sKV%o<N%V+853dw!%fWiB#>5-}2G^QZ0vje?d N;OXk;vd$@?2>>+tE2#hg literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/eu.png b/plugins/language-selector/flags/eu.png new file mode 100644 index 0000000000000000000000000000000000000000..f2a1e5201860768d5cef2a0de1ea2361bbfda88d GIT binary patch literal 388 zcmV-~0ek+5P)7LCpT000SaNLh0L01FcU01FcV0GgZ_00004XF*Lt006O%3;baP0003KNklYIE1CbVhaGf!xW@HPH<-Cv_L9_)R+-!tu5X=H(u?jQP z_#kM(zv#&S|H{k$|8sNw|Ifwc|5rP!|DwgB|K%&>;TEV=tAP0@W8D7#ONjsfFCzT^ zzu1`n|5B0(TL3eJTuj&pfr0=3+1o)}mYnqeUq$)<_8sm28@DvV4T+o+3C0gwEC2ti ztoZ+T-rWCx=g<59FDQ_-I6z5$IN|`707!~tbOY*4FjLVsS?rb&v;d#$&@r}+*#h_wCIi*s4* z)ZMBs;Cg4o+Q5_ZqXz=Qa6W&d_y9%~8qw**h&E+|&He$@#|rPg;IXZA)BH z<7~gj?DM+&>>Wj-nLFDS-ExdtsknaIgh{W<#FmGqqzeg67UIg9{p^$S^ohZfrsdszr?2qpmjvrcL4WF`PgDb@NO+Y9-Zr^0UEwQ?cT64-L))aIhV}X}jA^$$*Jb votx>}M~kq753=XIt7n+@MKJDnJ%hRWfyMqWGYwt?ea_(N>gTe~DWM4fGun$< literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/fi.png b/plugins/language-selector/flags/fi.png new file mode 100644 index 0000000000000000000000000000000000000000..0914433752889bf898f9350f4711b41f03f1624f GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^5gOS+@4BLl<6e(pbstU$h}r;B4q#jWIohNk}!4!@fY|CjWU zJ`izk`+s}Q21ePQD2EG87rH|KU)-4Y#AF9+%(k`vH?BO`YN*p7>0;_r&YdCW;%qO< c8_CUJ^5Nm@l;Rm%frc`8y85}Sb4q9e0Lbz<=Kufz literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/fil.png b/plugins/language-selector/flags/fil.png new file mode 100644 index 0000000000000000000000000000000000000000..f220af2f4c3601dd4f5eb4c2a3cf04715066c9a6 GIT binary patch literal 584 zcmV-O0=NB%P)7q5Z+R~tG zVHrwh5@D##AJL*#M73hm1?_#+~(9C_`u77^ZlIXIfqw>MBf&vxp!a#>fh)(E}?5arpX>Ul*_PYF9HuRvRxW z8}k@e3|1aqWkhqi5naNJ_ox-sSZtmjS2~%jYiD%R4kowPF=eSQ$h0D0*;nF{4fSb$ z#z_1ja>K>+fu-Q_ZF_lR-M=aU#i+HR*fU+o=9_7QS+AeBO~+O6PR7gklngE{&|XTC z1H}B#2s%0#D^tN+cV{=OhY7`4Awl@bKqz?fv^KK2TE5;=D>J9q2r66~vDW|lRs02P WOGz7&n{_1s0000+Is(?y&grpZb!@9EtU;uiqZ}xA^hu zW8416zkc!mxLP|e{~Fe((Q^OXkL@eYKhW&4^Xnau(ux_&7b#{kGJNn@5+m<(N*ZV} NgQu&X%Q~loCIFy!Q@H>D literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/fr.png b/plugins/language-selector/flags/fr.png new file mode 100644 index 0000000000000000000000000000000000000000..21ac90f16067ebaa02f257f3607eaf79ac0fe55c GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^5EaktaVt5&fsO0)|K!6v4v6cz pubIK9F0nP?N>d=Wo9=-uMuuDwxBF@Vn!Z2{44$rjF6*2UngDSRBQO8} literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/ga.png b/plugins/language-selector/flags/ga.png new file mode 100644 index 0000000000000000000000000000000000000000..ab14e96cf5acab7f26a18fe15116bbbfd4c827ea GIT binary patch literal 117 zcmeAS@N?(olHy`uVBq!ia0vp^5=nv9&G>s literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/gl.png b/plugins/language-selector/flags/gl.png new file mode 100644 index 0000000000000000000000000000000000000000..1166f0fac87bacfa6e53503ec8766c5cbe25365c GIT binary patch literal 439 zcmV;o0Z9IdP)000SaNLh0L01FcU01FcV0GgZ_00004XF*Lt006O%3;baP0003-Nkl;I$AKj9kx{{2gt1y8>G z`tQB{Hi{*DKuc!>ee>bN^Z&<=t^0rV(!T#ce|{&=0+@n@H{bjhT!8AE`liDF+e!`p z?=80Ze`eQw$}9kZr(b{l_d)WFe}3Wr$w|il7iF6Mzkc>GZiw*R0tN4?34ExBlP%^pkQ6dN$tr?^RLsUo&IMf2(Q7Q4#>iH`A{o zd_$H6An@?zr~j`$d;_zW+HlN9^qVpT=C2YvbMx1q`jXFE z|Ci6NWxuTO@4}{rXO1pgJ(g7(EvgOS+@4BLl<6e(pbstU!L8r;B4q#jWH72d4k&Qva8;r5#{( z(^be}l>6}c`TYNz(_$GObtjnFIZR{y{5<~G{?ga73j6-nA8a~(WjjO4i)p&s|K;EF xQRa3yXjJ^nRbih?od9R)2B0}|TN_lk8Jb=P$z|=9vjEz};OXk;vd$@?2>`HqLI3~& literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/hr.png b/plugins/language-selector/flags/hr.png new file mode 100644 index 0000000000000000000000000000000000000000..24fa77a23b94eb90b934e1757786a2a61e4d7e72 GIT binary patch literal 304 zcmeAS@N?(olHy`uVBq!ia0vp^5QL70(Y)*O%~mUKs7M+SzC{oH>NS%G{dPZ!6Kid)GE4ouHkuKo*VHh#dg nSgePE`(H3;Pn5wS9R`Nwu^sYr9bbzARWo?H`njxgN@xNAt@$JE literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/is.png b/plugins/language-selector/flags/is.png new file mode 100644 index 0000000000000000000000000000000000000000..8bbf491e36bb31ab8554fc63e5619fccb9c70435 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^5VQI= z1s;*b3=DDyL74GyW=JqlkR{#G*O7r?V?XzwL{=a_-qXb~q~ca`f&-h_<^Rgbv%h@( zAOH2+zx~gjf8U>UtMmVhPZ5T323d@X+)k^@{<gOS+@4BLl<6e(pbstU$i1r;B4q#jWH72e!#~{v{vYalkUS qc+Ct(b&0JBSDFI3-EWk4a$ z0*}aI1_o|n5N2eUH3y`LCEd~2k%3`jKlh(RRvz t@jQCm8FDTr{V6;AGiLgDvX*RRVA!0@IjQ8%C2OE944$rjF6*2UngCXpJ-7e> literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/km.png b/plugins/language-selector/flags/km.png new file mode 100644 index 0000000000000000000000000000000000000000..8b16dcd5ed8eb089b339dbff444c18f611cba9a0 GIT binary patch literal 321 zcmV-H0lxl;P)4k-wO}_|LwvBFb1(dY})ky{knCOTksWR=*^q|f4zG3|MR(X z|GzzW@c-x2r~khI#ecngNtp$=TwMNtIeHX~KOR2(|I5jf|G!_k^8dqu1OGn*`CozJ z;NT<2f^%G4|DU(F|9`h|AsD}&I`#kCIdlHMTf7*|hKYmJfYcIY!O+hKw6FjGF@UJm Tp*D|_00000NkvXXu0mjf9^{b( literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/ko.png b/plugins/language-selector/flags/ko.png new file mode 100644 index 0000000000000000000000000000000000000000..e732d3d026817c87284e21565f53007e1c0f125e GIT binary patch literal 591 zcmV-V0wKY0000gbVXQnLvm$d zbZKvHAXI5>WdKBPATl69aB?6rFfchFFflqYH##*oAS*C2FffG!yh;E700(qQO+^Rc z2N((=4axW|ZvX%Q32;bRa{vGi!vFvd!vV){sAK>D00d`2O+f$vv5yPxYlT7-91t8x%a9~6DkyX@ zIv9c*HzJg}5D`HUwNd9Z@8!n~I+S#Vd0g(f_nvd#BSZnZpfSm0GVuHT=w}&25A)&G zpsdG;WCn>uVwlhjr6`xnh$wtE5Y!TOyB&|uQI@RLY6GG-E*uWS>-Dk%x!p#)(}Ba` z7?x1$H@_rslWQPLCpg`>811Ro&}y~NXf!lMu~=-l0e`?qJ65X|GW`_)6ugH=DwWc2 zNG6lWT;D(-^UD8|u2d@e4HUb^bDSBrK^BhbQu>zYB)8km$gP7*yu8Md&*%HsI#NM> zBNX*|9qsNuWE9lJk|ZG#iLe*eL$z9EkKIyP*B!1FpzBcUHk%FET#n^FZUcy~nDD;3 zj?eoCmMatr;5ZIWr&D9(R{_o1O$njpO~lC*#EC`NXHBq7oAGAc(Omji8&DLBMTnxv z;=5p2Y1#)d9D&SPlz0!JCxLN-AfQw#jV}<5M&WX~;Pd$)%kq#*`j|Y=!{hNFolcK0 d@E@pWeghF_2^s|Hf5!j-002ovPDHLkV1h`j^7sG% literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/lb.png b/plugins/language-selector/flags/lb.png new file mode 100644 index 0000000000000000000000000000000000000000..b3e420019470c2549b54c96a0e4c189e2c7278ef GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^5QL70(Y)*O%~mUKs7M+SzC{oH>NS%G{VPZ!6Kid)GE4Nc!~?fSp6Q}V*W y6|5|}Km1b-vKU{A8R+c$J%3fj6{aLz28M4Ld-ChUic^957(8A5T-G@yGywqI+AIVB literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/lt.png b/plugins/language-selector/flags/lt.png new file mode 100644 index 0000000000000000000000000000000000000000..15bdf91859c031990475c0e6eb7272b5855c2521 GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^5O>_%)r1c48n{Iv*v(|Wl4AR zb!1@J*w6hZkrl{S_jGX#skoJ#(9q--_wxUhLp(PQtYBr%KUlBT)VML>#qonHSa;|! ZF#O=Vq!D@l?Pj1B22WQ%mvv4FO#l#lHGTj9 literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/mn.png b/plugins/language-selector/flags/mn.png new file mode 100644 index 0000000000000000000000000000000000000000..355b43dae90e32b6c7d4f23f7817fd145dd99e7b GIT binary patch literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^5 z{S=Y+(?vdS6a0EW=*uAiZrgoIK$BV0J>AlQG*?aJ+h8E=?djqeB5^r6p@B(IBf)_w zC&xl%hs8#3gU&9aq^Sv_Vo3+p4(c5^tb3r(waK|@es~k}>Xs!Ie4KWUGD1m75vnt8 i&S>OV&AyS1lVSCG&i7LOD_elZGI+ZBxvX004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv|NsC0|NjYC_uK#g010qNS#tmY09pV509pWWBe;D400P)aL_t(I%VS^=VqkFL zVGw3ubpFQx1g`lEpBa|hsB*q$6H_r|+0HDj^MJvcLEgz1EZfb%2vmQDK@doafka$p zGg~msx8D5rHt%h5!(Z!#^Mq4=nG16Z&nAy#fI0|dnG912<2n=0`9cwwIJ%r`m5c@Q zS)G{kwdXO#F)lDkWi4jz);48a%BXC9he3jY)%g%em$NJLGR9kh^S&*ZdULbaKeK}` z532wDvVYcrX!1w~uwVH=M!S`y@Ed*Qc{xWRY$C^QuzT z?I0m|2+eg*S5e}Bw`pmnAG;SrHA8^?Lx!&mD{Z9wRWum*86O8OQ(=DVpRA$4_lr@V z;iA=KaFiWkUdnhqF!S4_DJmN;{4+d|xqs>3cl$*4-6oG@06S$ph;+|p_|5RhCMDyg zWdP4SzXe(w`7PN*SW>k-8O0dBTd!b}W87`}o?$k_GTpbq~q-Vhsp7^vkZA8!{6Rn$7ZvWO`e|3^|xbI)2xSob7tI~`Q&f< zjA=7>{LPp#d**KPNCrwY(}HC9{nH`Uaq{3H8UEdT^X0AT;2{BlIbE^MXe6Bg0000< KMNUMnLSTYT)S!?6 literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/nb.png b/plugins/language-selector/flags/nb.png new file mode 100644 index 0000000000000000000000000000000000000000..ed192bf590078b920a02a0ea0a56142b260cb3db GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^5gOS+@4BLl<6e(pbstU$i4r;B4q#jWH72j=%%OaCh;3nW}P z!H_KAFx~w)Ps@Q7tSq`e`dJmC9XJHGFr-P`tT>>%pi+SMZ-~hg9R>!m-M7{-Pdo%N Oh{4m<&t;ucLK6VU=qgOS+@4BLl<6e(pbstU$i4r;B4q#jWH72j=%%OaCh;3nW}P z!H_KAFx~w)Ps@Q7tSq`e`dJmC9XJHGFr-P`tT>>%pi+SMZ-~hg9R>!m-M7{-Pdo%N Oh{4m<&t;ucLK6Ts6)vd& literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/pl.png b/plugins/language-selector/flags/pl.png new file mode 100644 index 0000000000000000000000000000000000000000..c584d60cc41690474dc48775a430933e1aeb3011 GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^5!lvI6-^o-U3d6}OTT8k+uxu<+bCu!2?j nK$EqS+5eTT?z$3*VhjxH*X^wpNW5zcRL$V&>gTe~DWM4fCx0de literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/pt-br.png b/plugins/language-selector/flags/pt-br.png new file mode 100644 index 0000000000000000000000000000000000000000..e6971b496ece1532ca84f968c89ffb4a71e323c9 GIT binary patch literal 364 zcmV-y0h9iTP)I{txzS{U7Ah^}n!i?*G>I)&GP2JO8h0 z(t@i2sR!vJ%YxO-`u|OptNt6vmHjtYtpocYE_~AeEz`Wovj9DaKtbWGSM=XlvEsj( zO8I|l&4&NcZVmsRZRIB~hzLb;qI)cmFG+bM(1P8WTU;l4>XfJ+r u!=vJ+tO!G9KZC4;D_9qc^+YvXWn%aibi?EF#l}TIJq(_%elF{r5}E+NCoHP~ literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/ru.png b/plugins/language-selector/flags/ru.png new file mode 100644 index 0000000000000000000000000000000000000000..428811d44921826c0a35962cc87441bfb0061039 GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0vp^5QL70(Y)*O%~mUKs7M+SzC{oH>NS%G{tPZ!6Kid)GE4ov@7vPcv(26A&m rF>GqGs<^^bq`P3!%f(_7(ij=0RomXrRIJYh>R|A6^>bP0l+XkKOF<>! literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/sco.png b/plugins/language-selector/flags/sco.png new file mode 100644 index 0000000000000000000000000000000000000000..7c4c6d7c11ff7e4b984882b78f8bc9ed047ce156 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^51P5mGClUV_CqLtw z{eS&=k3ZKrX8f3cFp0I!hvUNCrjuD>|0VxM{hRMQ@t6I<6YuQ%f7ZN;3|RK^fBmFc zq8He=CCFP;UHhMZso=MMhS}^Q?rR#W|E|CIfBnwZ z|LrG*kF@Aa_L)MLz$!LjHBjhBwwtZ(@6%#PvO$yYBJ)4Nq3>d9`NmtK+wSow)Ps|NsBm#{VjS zhHw^mL>4nJa0`PlBg3pYAZv^~T^vIs!jlCKF-m;!`mlN9=ftTGo<4YTa6$qTlNh68 rn3@U0w1g**(vE30@;;ch0O+V6PV5!^PqIybx*0rO{an^LB{Ts5-~LJ# literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/so.png b/plugins/language-selector/flags/so.png new file mode 100644 index 0000000000000000000000000000000000000000..30c632d92ad616269421819596ebaed7d23d579a GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^5&U>cv7h@-A}f&J=jq}YQgJIe!GX!?a{d41Y-tBr z+qSbd1=syIzw?{D$1!JBl)~08-|KgV?*A|U_X9srWP(Jg&Wvxr_usu}|Ns8KKmY&V zujgRf=$NEnx$1{Q!K?TGO~3#9*Ul&)t>U&-fvL6f`{Moo`x% xKRk+kNxGxK4BO^gCrhOGzD+pE{v?WlA$p0|V)x&7z5`vx;OXk;vd$@?2>_4wV#fdg literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/sq.png b/plugins/language-selector/flags/sq.png new file mode 100644 index 0000000000000000000000000000000000000000..c0f755c8cb8470b54d17a97fd4a6d88de6fb537c GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^51P7+)ELZ;pcS(L| zWZak_xc<(6(;BY-%r}1i&wm`wbXmd9V~&=XNul?j?MYAn$sg1E5I?Q+YrVyUZET-r zH$Dp4sL&n!WWScNwTH6IYQ~>89ST=P7)*5kwV!JitHM8(1s0(?D;^5{pU+>ime(NS z$jpcXCLR1j%ez>MD^mZL7kdBme=P7%pSh>GM1l8F^O2QF2N@Zk{!efCVj?G5pwj%p pIG}LV^XAAsM$QI{1G5+zwn#M`{dxP#RiGCbJYD@<);T3K0RVCfaA5!d literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/sr.png b/plugins/language-selector/flags/sr.png new file mode 100644 index 0000000000000000000000000000000000000000..1538d68cc4ed058c8632aa6fcda5789788624ac5 GIT binary patch literal 488 zcmVP)O2LEiz1Xld$9Wup4OS$fMlBq&lU zilu`F3&I071PA*NvD?HwtxBR!pfQ0Twt<IBbS;*nvIIr1TU702PW50qvM@}453+@uSTNIbnFv9$(a&V~5S9)x)Z z?hkfxn|*`4rvy=es(eIP#5{JqWb%m3cH=9Tftsii6pO|3{LUBfnR~`h;k{yCvp~G` e@0gn7)q-Cq!bivOzb$0|0000&U>cv7h@-A}f&Z>*?YcQgJIep`r1`%>Ne+>n|Po zU$58IxG_BUVtr25hNLwKSD2i{Bt)^2=7-$Y>fk$L90|U1(2s1Lwngg=Q*3-o?L}F@k!UDO3Ba9L)4;%X1+xZVVdvJW( zRP=!>Y2pK+M^D5a9a2&}bN-A{LyCws(+0(jHzj8jFkDh)uy195eB#W4e?Ws6JYD@< J);T3K0RXnLV3q&? literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/th.png b/plugins/language-selector/flags/th.png new file mode 100644 index 0000000000000000000000000000000000000000..58ebb1f94cdcf19c699603e165c313f9b83f088f GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^5gOS+@4BLl<6e(pbstU$h{r;B4q#jWH72j=fAD*u9;Bsmyo zMSqy@dXv@ruQD4bgTe~DWM4f?M^S9 literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/tl.png b/plugins/language-selector/flags/tl.png new file mode 100644 index 0000000000000000000000000000000000000000..ffd461ddf8dd0acfd6ee1f91fe2b9da4ddaa244f GIT binary patch literal 347 zcmV-h0i^zkP)QX`2XjI?f*X)#s2@jDE|N7`!ztpA0V0kKi=;8 z-@4%Pe;&s*6j<=}9GV3i;1>LSv+e)$-l_jD$Qb-TC#Xg;Mhc>4ND#f93lF0An|J-c zqUS)C!KfCXMe?_cSO4GgjiJb3gat^+^!J;0{~s0C|34?JK^4Qn7JxF^-}guVznn7n t|3w88su>Ko;NzY{|F4;QQr%z}1_1LupzRsD>|Fo=002ovPDHLkV1g1auO?Q{M{r~vI$^Z7}O{2NMJmtFzK?K i(nOmtpBcC6Ffhc}p112=^t2P`5(ZCKKbLh*2~7ZtZC;fC literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/uk.png b/plugins/language-selector/flags/uk.png new file mode 100644 index 0000000000000000000000000000000000000000..349327ae1a28cf1c04e40df1763c1515217ee38e GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^5<1YyR*nIXYIL6&q!Uq=Rpjs4tz5?O(KRZkbkkcwN$2@XtQOWpqkGaEl( rS}fMXz+HDw^tV5+P1Zq<%?u2?9ymuIWGgTe~DWM4f{lO>< literal 0 HcmV?d00001 diff --git a/plugins/language-selector/flags/vi.png b/plugins/language-selector/flags/vi.png new file mode 100644 index 0000000000000000000000000000000000000000..728fec9358b6bc450712dd89f7d14fb5fa12af48 GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^51P7+)ELZ;pGaEl( zV$M70EB*ApdBcn}u{~Ln|NdVU+O|vV&Zh8R^|ymx{?`>>`rn?V_O>&pj{8Q| z=~qMk*GKAq{Qtf37 z9X=kVLW9|>Cf0<;|NOsu=B5Ao9;=!RJ9vc_&tg?@?i7^%BiSp%&EOk+Wc|706}CW! OGI+ZBxvX&U>cv7h@-A}f%8+|$J|q~ca`f&=q+6V`wCuQDWw zHva!^^7H@w>(BrHztAUshV7)_A)Xe76AP@nnEuC4FZ#1zm2rzl=!5^yQ`b0n|2!xb zoO4i@^Wgvg_J)7{m(PFr|9?EsfBBssm}(FI|9{^1*#Gh;D<3g8{`aq``1im5$cO*F zw#WZhM>)td))t1(l|QqriAOCOkKL0P95OXI`?8pC7UE{4a427y1XB@v= zPI&iUe%Ypj%5$~s9F8sU*teJ^MOg4)N~D99+}4B-kqitw-%oq>r%_xR=p_bES3j3^ HP6_) z3p^r=85raaf-vLZ%#dK9AWOQVuOkD)#(wTUiL5|=uBVG*NX4z>gaZt`{{?r*btV4k z`|rS{pQgYg!1nxUE_-r|YslsW5BGPSTJoP?ejj^s>Qm1v-yI`vtor}{em#4#!0c0Y zEB>E9c=40HdAYPi^NoQWY}{4zy-IRtSvkeTNAD@@o+Qnd6ymR`2Kk< P&|(HpS3j3^P60) //if $target matches an element within the dropdown markup, don't bind ondropdown to that element + return; + $target.bind("mouseenter", function(e){ + dropdownmenu.showbox($, $dropdown) + }); + $target.bind("mouseleave", function(e){ + dropdownmenu.hidebox($, $dropdown) + }); + $target.bind("click", function(e){ + dropdownmenu.stubbox($, $dropdown) + }) + } +}; + +//By default, add dropdown to anchor links with attribute "data-dropdown" +jQuery(document).ready(function($){ + + jQuery.fn.adddropdown=function(dropdownid){ + var $=jQuery; + return this.each(function(){ //return jQuery obj + var $target=$(this); + var $dropdownId = $('#'+dropdownid); + if ($dropdownId.length === 1) //check dropdown is defined + dropdownmenu.init($, $target, $dropdownId) + }) + }; + + var $anchors=$('*[data-dropdown]'); + $anchors.each(function(){ + $(this).adddropdown(this.getAttribute('data-dropdown')) + }) +}); diff --git a/plugins/language-selector/language-selector.php b/plugins/language-selector/language-selector.php new file mode 100644 index 0000000..0f9e92c --- /dev/null +++ b/plugins/language-selector/language-selector.php @@ -0,0 +1,109 @@ + ['onPluginsInitialized', 0] + ]; + } + + /** + * Initialize configuration + */ + public function onPluginsInitialized() + { + if ($this->isAdmin()) { + $this->active = false; + return; + } + + $this->enable([ + 'onTwigInitialized' => ['onTwigInitialized', 0], + 'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0], + 'onTwigSiteVariables' => ['onTwigSiteVariables', 0] + ]); + } + + /** Add the native_name function */ + public function onTwigInitialized() + { + $this->grav['twig']->twig()->addFunction( + new \Twig_SimpleFunction('native_name', function($key) { + return LanguageCodes::getNativeName($key); + }) + ); + } + + /** + * Add current directory to twig lookup paths. + */ + public function onTwigTemplatePaths() + { + $this->grav['twig']->twig_paths[] = __DIR__ . '/templates'; + } + + /** + * Set needed variables to display Language-Selector. + */ + public function onTwigSiteVariables() + { + $data = new \stdClass; + + // Manage Data content + $page = $this->grav['page']; + $data->page_route = $page->rawRoute(); + if ($page->home()) { + $data->page_route = '/'; + } + + $languages = $this->grav['language']->getLanguages(); + $data->languages = $languages; + + if ($this->config->get('plugins.language-selector.untranslated_pages_behavior') !== 'none') { + $translated_pages = []; + foreach ($languages as $language) { + $translated_pages[$language] = null; + $page_name_without_ext = substr($page->name(), 0, -(strlen($page->extension()))); + $translated_page_path = $page->path() . DS . $page_name_without_ext . '.' . $language . '.md'; + if (file_exists($translated_page_path)) { + $translated_page = new Page(); + $translated_page->init(new \SplFileInfo($translated_page_path), $language . '.md'); + $translated_pages[$language] = $translated_page; + } + } + $data->translated_pages = $translated_pages; + } + + $data->current = $this->grav['language']->getLanguage(); + + // Manage Twig Variables + $path_flags = $this->grav['locator']->findResource('plugin://language-selector/flags/', false) . "/"; + $path_flags = $this->grav['base_url'] ."/". ltrim($path_flags, '/'); + $this->grav['twig']->twig_vars['language_selector'] = $data; + $this->grav['twig']->twig_vars['language_display'] = array( + "select" => $this->config->get('plugins.language-selector.select_display'), + "button" => $this->config->get('plugins.language-selector.button_display'), + ); + $this->grav['twig']->twig_vars['path_flags'] = $path_flags; + + // Manage Assets + $this->grav['assets']->add('plugin://language-selector/js/language-selector.js'); + if ($this->config->get('plugins.language-selector.built_in_css')) { + $this->grav['assets']->add('plugin://language-selector/css/language-selector.css'); + } + } + + public function getNativeName($code) { + + } +} diff --git a/plugins/language-selector/language-selector.yaml b/plugins/language-selector/language-selector.yaml new file mode 100644 index 0000000..4a804cf --- /dev/null +++ b/plugins/language-selector/language-selector.yaml @@ -0,0 +1,5 @@ +enabled: true +built_in_css: true +untranslated_pages_behavior: none +button_display: default +select_display: default diff --git a/plugins/language-selector/languages.yaml b/plugins/language-selector/languages.yaml new file mode 100644 index 0000000..22b1169 --- /dev/null +++ b/plugins/language-selector/languages.yaml @@ -0,0 +1,87 @@ +# English +en: + PLUGINS: + LANGUAGE_SELECTOR: + PLUGIN_STATUS: 'Plugin status' + BUILT_IN_CSS: 'Use built in CSS' + UNTRANSLATED_PAGES: + LABEL: 'Untranslated pages behavior' + HELP: 'Determine what to do with a language link when the current page doesn''t exist in that language or it exists but it''s not published.' + OPT_NONE: 'Show language (default)' + OPT_REDIR: 'Show language, link to home route' + OPT_HIDE: 'Hide language' + BUTTON_DISPLAY: + LABEL: 'Button Display' + HELP: 'Define how button of selected language will be displayed' + SELECT_DISPLAY: + LABEL: 'Selector Display' + HELP: 'Define how language selector will be displayed' + OPT_DEFAULT: 'Flag + Language name' + OPT_FLAG: 'Only the flag' + OPT_NAME: 'Only the language name' + +# French +fr: + PLUGINS: + LANGUAGE_SELECTOR: + PLUGIN_STATUS: 'Statut du plugin' + BUILT_IN_CSS: 'Utiliser CSS du plugin' + UNTRANSLATED_PAGES: + LABEL: 'Comportement des pages non-traduites' + HELP: 'Définit le comportement des liens lorsque la page n''existe pas dans la langue courante, ou bien existe mais non publié' + OPT_NONE: 'Affiche le langage (par défaut)' + OPT_REDIR: 'Affiche le langage, lié à l''URL de base' + OPT_HIDE: 'Cache le langage' + BUTTON_DISPLAY: + LABEL: 'Affichage du boutton' + HELP: 'Définit l''affichage du bouton de language sélectioné' + SELECT_DISPLAY: + LABEL: 'Affichage du sélecteur' + HELP: 'Définit l''affichage du sélecteur de language' + OPT_DEFAULT: 'Drapeau + Nom de la langue' + OPT_FLAG: 'Seulement le drapeau' + OPT_NAME: 'Seulement le nom de la langue' + +# Italian +it: + PLUGINS: + LANGUAGE_SELECTOR: + PLUGIN_STATUS: 'Status del plugin' + BUILT_IN_CSS: 'Utilizzare CSS del plugin' + UNTRANSLATED_PAGES: + LABEL: 'Comportamento delle pagine non-tradotte' + HELP: 'Determina il comportamento del link quando la pagina attuale non esiste in quella lingua, oppure esiste ma non è stata pubblicata.' + OPT_NONE: 'Esibire lingua (default)' + OPT_REDIR: 'Esibire lingua, linkare all''URL di base' + OPT_HIDE: 'Nascondere lingua' + BUTTON_DISPLAY: + LABEL: 'Presentazione del tasto' + HELP: 'Definisce la presentazione del tasto della lingua selezionata' + SELECT_DISPLAY: + LABEL: 'Presentazione del selettore' + HELP: 'Definisce la presentazione del selettore di lingua' + OPT_DEFAULT: 'Bandiera + Nome della lingua' + OPT_FLAG: 'Soltanto la bandiera' + OPT_NAME: 'Soltanto il nome della lingua' + +# Portuguese (Brazil) +pt-br: + PLUGINS: + LANGUAGE_SELECTOR: + PLUGIN_STATUS: 'Status do plugin' + BUILT_IN_CSS: 'Utilizar CSS do plugin' + UNTRANSLATED_PAGES: + LABEL: 'Comportamento das páginas não-traduzidas' + HELP: 'Determina o comportamento do link quando a página atual não existe naquela língua, ou existe mas não está publicada.' + OPT_NONE: 'Mostrar língua (default)' + OPT_REDIR: 'Mostrar língua, linkar para o URL de base' + OPT_HIDE: 'Esconder língua' + BUTTON_DISPLAY: + LABEL: 'Apresentação do botão' + HELP: 'Define a apresentação do botão da língua selecionada' + SELECT_DISPLAY: + LABEL: 'Apresentação do seletor' + HELP: 'Define a apresentação do seletor de língua' + OPT_DEFAULT: 'Bandeira + Nome da língua' + OPT_FLAG: 'Apenas a bandeira' + OPT_NAME: 'Apenas o nome da língua' \ No newline at end of file diff --git a/plugins/language-selector/templates/partials/language-selector.hreflang.html.twig b/plugins/language-selector/templates/partials/language-selector.hreflang.html.twig new file mode 100644 index 0000000..6ffa3db --- /dev/null +++ b/plugins/language-selector/templates/partials/language-selector.hreflang.html.twig @@ -0,0 +1,9 @@ +{% set langobj = grav['language'] %} +{% for key in language_selector.languages %} +{% if key == language_selector.current %} + {% set lang_url = page.url %} +{% else %} + {% set lang_url = base_url_simple ~ langobj.getLanguageURLPrefix(key) ~ language_selector.page_route ~ page.urlExtension ?: '/' %} +{% endif %} + +{% endfor %} \ No newline at end of file diff --git a/plugins/language-selector/templates/partials/language-selector.html.twig b/plugins/language-selector/templates/partials/language-selector.html.twig new file mode 100644 index 0000000..7e19f0e --- /dev/null +++ b/plugins/language-selector/templates/partials/language-selector.html.twig @@ -0,0 +1,49 @@ +