diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 41e8685e..e59aa936 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,10 +37,11 @@ jobs:
- name: Check broken links
shell: bash
continue-on-error: false
+ # Exclude checking locales for each link 'lang=*'
run: |
set +e
set +o pipefail
- npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' | tee blc.log
+ npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' --exclude '*lang=*' | tee blc.log
echo "BLC_RESULT=${PIPESTATUS[0]}" >> "$GITHUB_ENV"
- name: Report on broken links
diff --git a/_includes/2020/templates/Menu.php b/_includes/2020/templates/Menu.php
index f3c7136c..4370f4dc 100644
--- a/_includes/2020/templates/Menu.php
+++ b/_includes/2020/templates/Menu.php
@@ -29,6 +29,56 @@ public static function render(array $fields): void {
Menu::render_top_menu($fields);
}
+ /**
+ * Generate the URL with query to change the UI language
+ * @param language - language tag to use
+ */
+ private static function change_ui_language($language): string {
+ // Parse the current URI for populating the UI dropdown
+ $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
+ $parts = parse_url($url);
+
+ if (!empty($parts['query'])) {
+ parse_str($parts['query'], $queryParams);
+ } else {
+ $queryParams = [];
+ }
+
+ // Set the language query
+ $queryParams['lang'] = $language;
+ $query = http_build_query($queryParams);
+
+ return $parts['path'] . "?" . $query;
+ }
+
+ /**
+ * Render the globe dropdown for changing the UI language.
+ * As UI languages get added, we'll need to update this
+ * @param number - Div number, default 0.
+ */
+ private static function render_globe_dropdown($number = 0): void {
+ $divID = ($number == 1) ? "ui-language1" : "ui-language";
+echo <<
Enter the name of a keyboard or language to search for. (Popular keyboards | All keyboards)
+= _m('enter_name') ?> (= _m('popular_keyboards') ?> | = _m('all_keyboards') ?>)
Hints
+= _m('hints') ?>
k: (keyboards), l: (languages), s: (scripts, writing systems)
- or c: (countries) to filter your search results. For example c:thailand searches for keyboards for languages used in Thailand.l:id: to search for a BCP 47 language tag, for example l:id:ti-et searches for Tigrigna (Ethiopia).k: = _m('keyboards') ?> l: = _m('languages') ?> s: = _m('scripts_ws') ?>
+ c: = _m('countries_to_filter') ?> c:thailand = _m('thailand_searches') ?>l:id: = _m('to search for a BCP 47 language tag, for example') ?> l:id:ti-et = _m('searches_tigrigna') ?>