refactor: Update globe button to modify lang in URL paths 🌋#712
Open
darcywong00 wants to merge 12 commits intoepic/i18n-url-schemefrom
Open
refactor: Update globe button to modify lang in URL paths 🌋#712darcywong00 wants to merge 12 commits intoepic/i18n-url-schemefrom
lang in URL paths 🌋#712darcywong00 wants to merge 12 commits intoepic/i18n-url-schemefrom
Conversation
User Test ResultsTest specification and instructions User tests are not required |
darcywong00
commented
Apr 23, 2026
| // Note: Validate::validate_bcp47 differs from regex in .htaccess | ||
| if (!empty($parts['path'])) { | ||
| $path = explode("/", $parts['path']); | ||
| if ($path[1] != null && class_exists('\\Keyman\\Site\\com\\keyman\\Validation') && |
Contributor
Author
There was a problem hiding this comment.
The 404.php was throwing uncaught error of \Keyman\Site\com\keyman\Validation class not being defined 😕
* Change from "Keyboard Search UI" to "Display in:" * Also add Khmer English name
mcdurdin
requested changes
Apr 28, 2026
Comment on lines
+44
to
+45
| npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 \ | ||
| --exclude '*/donate' --exclude '*/de/*' --exclude '*/es/*' --exclude '*/fr/*' --exclude '*/ipa/*' --exclude '*/km/*' --exclude '*lang=*' --exclude '*/lao/*' | tee blc.log |
Member
There was a problem hiding this comment.
Excluding all locales except en will not scale well. I wonder if there is a better way -- can we build a scripted filter using the api published at broken-link-checker?
Comment on lines
+79
to
+82
| 'de' => array(Menu::change_ui_language('de'), 'Deutsch'), | ||
| 'es' => array(Menu::change_ui_language('es'), 'Español'), | ||
| 'fr' => array(Menu::change_ui_language('fr'), 'Français'), | ||
| 'km' => array(Menu::change_ui_language('km'), 'ខ្មែរ') | ||
| 'km' => array(Menu::change_ui_language('km'), 'ខ្មែរ (Khmer)') |
Member
There was a problem hiding this comment.
Can this be extracted to a different file?
Contributor
Author
There was a problem hiding this comment.
refactored the list of language names to Locale.php in e9e548d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #696
Since i18n redirects
/fileto<lang>/file, this updates the globe key button to modify the BCP-47 language tag in the URL. The initial implementation of the globe key set the language tag as a query parameter.Additional changes:
enin .htaccess with a basic regex to allow language-script-region BCP-47 triplets. To keep things simple, intentionally not using the full-blown regex inkeyman.com/_includes/2020/Validation.php
Lines 28 to 37 in b448efc
(Khmer)to language nameScreenshots
phone layout

desktop layout

Test-bot: skip