[www-doc] [Git][VideoLAN.org/websites][master] 2 commits: Provide an english name for the currently selected language

Konstantin Pavlov gitlab at videolan.org
Fri Mar 26 18:24:09 UTC 2021



Konstantin Pavlov pushed to branch master at VideoLAN organization / websites


Commits:
72a543b9 by Konstantin Pavlov at 2021-03-26T20:55:39+03:00
Provide an english name for the currently selected language

- - - - -
6bb1e68f by Konstantin Pavlov at 2021-03-26T21:23:54+03:00
Replace hardcoded locale target with a dynamic target

- - - - -


2 changed files:

- www.videolan.org/Makefile.inc
- www.videolan.org/include/footer.php


Changes:

=====================================
www.videolan.org/Makefile.inc
=====================================
@@ -45,93 +45,4 @@ js/slick.min.js: js/slick.js
 	yui-compressor --type js $< > $@.tmp || cp $< $@.tmp
 	rm -f $@ && mv $@.tmp $@
 
-
-locales: index.af.php \
-         index.am-ET.php \
-         index.an.php \
-         index.ar.php \
-         index.ast.php \
-         index.az.php \
-         index.be.php \
-         index.bg.php \
-         index.bn.php \
-         index.bn-IN.php \
-         index.br.php \
-         index.bs.php \
-         index.ca.php \
-         index.co.php \
-         index.cs.php \
-         index.cy.php \
-         index.da.php \
-         index.de.php \
-         index.dv.php \
-         index.el.php \
-         index.en-GB.php \
-         index.es.php \
-         index.es-MX.php \
-         index.et.php \
-         index.eu.php \
-         index.fa.php \
-         index.fi.php \
-         index.fo.php \
-         index.fr.php \
-         index.fy.php \
-         index.ga.php \
-         index.gd.php \
-         index.gl.php \
-         index.gu.php \
-         index.he.php \
-         index.hi.php \
-         index.hr.php \
-         index.hu.php \
-         index.id.php \
-         index.is.php \
-         index.it.php \
-         index.ja.php \
-         index.ka.php \
-         index.km.php \
-         index.kn.php \
-         index.ko.php \
-         index.ky.php \
-         index.lb.php \
-         index.lo.php \
-         index.lt.php \
-         index.lv.php \
-         index.mk.php \
-         index.ml.php \
-         index.mn-MN.php \
-         index.mr.php \
-         index.ms.php \
-         index.my.php \
-         index.my-MM.php \
-         index.nb.php \
-         index.ne-NP.php \
-         index.nl.php \
-         index.nn.php \
-         index.or.php \
-         index.pl.php \
-         index.pt.php \
-         index.pt-BR.php \
-         index.ro.php \
-         index.ru.php \
-         index.sc.php \
-         index.si.php \
-         index.sk.php \
-         index.sl.php \
-         index.sq.php \
-         index.sr.php \
-         index.sv.php \
-         index.ta.php \
-         index.te.php \
-         index.th.php \
-         index.tr.php \
-         index.tt.php \
-         index.ug.php \
-         index.uk.php \
-         index.ur.php \
-         index.uz.php \
-         index.vi.php \
-         index.wa.php \
-         index.zh.php \
-         index.zh-TW.php \
-         include/header.php
+locales: $(addsuffix .php,$(addprefix index.,$(shell find locale -maxdepth 1 -mindepth 1 -type d | sed 's,locale/,,'))) include/header.php


=====================================
www.videolan.org/include/footer.php
=====================================
@@ -96,6 +96,7 @@ function footer($tag = "", $alternate_lang=array(), $additional_class = "") {
                         $root_filename = explode('.', $_SERVER['SCRIPT_NAME'] );
                         foreach($alternate_lang as $lang) {
                             $lang_name = Locale::getDisplayName($lang, $lang);
+                            $lang_name_english = Locale::getDisplayName($lang, 'en');
                             if( $lang == $GLOBALS["language"] )
                                 $selected = ' selected="selected"';
                             else
@@ -103,7 +104,7 @@ function footer($tag = "", $alternate_lang=array(), $additional_class = "") {
                             if( $lang == "en" )
                                 echo '                <option value="/'.$root_filename[0].'.html"'.$selected.'>'.$lang_name.'</option>'."\n";
                             else
-                                echo '                <option value="/'.$root_filename[0].'.'.$lang.'.html"'.$selected.'>'.$lang_name.'</option>'."\n";
+                                echo '                <option value="/'.$root_filename[0].'.'.$lang.'.html"'.$selected.'>'.$lang_name_english." | ".$lang_name.'</option>'."\n";
                         }
                         echo '                </select></div>'."\n";
                     }



View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/compare/a235aa9ad338dfb91fb7840a82643e22b9651ccd...6bb1e68fbe41ee03cd1304eef3347b81949719a1

-- 
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/compare/a235aa9ad338dfb91fb7840a82643e22b9651ccd...6bb1e68fbe41ee03cd1304eef3347b81949719a1
You're receiving this email because of your account on code.videolan.org.




More information about the www-doc mailing list