Add multilanguage support (i18n)#7
Open
NikFlip wants to merge 5 commits into
Open
Conversation
✅ Deploy Preview for master-demo-gw2timer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ae23d4c to
1881088
Compare
Add complete i18n JSON files for EN and DE with all UI strings, category names, event names, map names, and notes. German translations use official GW2 API-verified names.
Minimal translation module (~70 lines, zero dependencies) that loads JSON translation files, translates DOM elements via data-i18n attributes, and provides getTranslation() for dynamic content. Language preference is persisted in localStorage.
Add data-i18n attributes to static UI text (site name, browser alert, donation text, tooltips). Add EN/DE language switcher buttons in the header. Fix donation text typo.
Use getTranslation() for event names, map names, notes, and categories. Add retranslateAll() for live language switching of all visible elements. Fix localStorage check to ignore the lang key.
c9596a0 to
2274751
Compare
Add styles for the EN/DE toggle buttons in the header with active state highlighting and hover effects.
2274751 to
7e8906d
Compare
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.
This PR introduces internationalization (i18n) to GW2 Simple Timer, making the tool accessible to a broader community. Translations start with German alongside the existing English, with a language switcher in the sidebar. Adding more languages in the future is straightforward — just drop in a new translation file.