Repository navigation
A language select on the player page and in the app - #54
Closed
alekswebnet wants to merge 1 commit into
Closed
alekswebnet wants to merge 1 commit into
alekswebnet wants to merge 1 commit into
Conversation
Both played with H5P's own strings in English, the page's language. The player page now has a Language select beside the Trusted/Untrusted switch, English by default; the app has one in its menu, defaulting to the first of the browser's languages the runtime has and remembering the learner's pick on the device. A change plays the current package again, in the app where the learner was. The list is the runtime's own (packages/runtime/l10n/index.json), so a language its weekly refresh adds appears with no change here. Each is named in its own language where the browser has that language's data, and in English otherwise: Chromium has none for Albanian or Armenian and answered in the browser's language. Closes #53. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closed unmerged: a select can only make H5P's strings differ from the content's language, and the two should match. Replaced by #55, which has H5P's own strings follow the language the package declares. |
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.
Closes #53.
The element already shows H5P's own strings in its
lang, from the runtime's 56 languages. The player page and the app never let a visitor choose: both played in English, the page's language.Changes
localStorageand wins over the browser's on the next visit. Storage refused, as in some private windows, means the browser's language each time.apps/demo/demo/languages.js(new), shared by both: the list read from the runtime'sl10n/index.json, so a language the weekly refresh adds appears with no change here. 1.9 kB gzipped, its own chunk, precached by the app.Intl.DisplayNamesthen answered in the browser's language: "Albanisch" in a German browser, shown as Albanian's own name in the first cut. Those now show the English name alone. Firefox and WebKit have the data, so the order differs a little by browser.What it does not change
The content's own text — a quiz's questions, its Check and Retry buttons — is written into the package by its author and stays as written. The select changes H5P's own strings: full screen, Reuse, Rights of use, Embed, the licence names, the "content has changed" dialog. The app shows no action bar, so there it is mostly the full-screen button and that dialog.
Testing
apps/demo/tests/app.test.ts): with the browser in French, the app starts on French and the frame'sH5P.t('fullscreen')is "Plein écran". German picked in the menu replays the quiz on the same screen and history step with "Vollbild", and a reload keeps German over the browser's French. Passes in Chromium, Firefox and WebKit; fails without the change in app.js.pnpm build:demopasses, and the app's worker precaches the language chunk.pnpm --filter @missing-elements/h5p-demo typecheckpasses.Release
None: demo and app only. It ships with the deploy of the merge.
🤖 Generated with Claude Code