aboutsummaryrefslogtreecommitdiff
path: root/src/lang.js
AgeCommit message (Collapse)Author
2023-01-12added: src/modules/json.js0neGal
This module makes it easier to read JSON files, simply returning false on errors, and attempting to repair the JSON automatically.
2022-04-28added: error if config file isn't valid0neGal
Essentially just validates the config file and then prompts you about it, it allows you to reset it directly or just to exit and let yourself fix it. And because the error message appears directly in the renderer we have access to navigator.language, and can therefore still localize the string. However! We can't actually care if the user has disabled auto detection of their language, since... y'know, the config file where that's stored isn't able to be read properly. And so I added an argument to lang(), which allows you to force it to use a specific language if that language is available, if not it defaults back to English.
2022-04-13the user can now manually select a language0neGal
This allows someone to have their system in any language, and then have Viper in a separate language. This is also useful for testing.
2022-02-19[fix] translation file is only loaded is current context didn't set up lang ↵Alystrasz
variable
2022-02-19[fix] loading up translation object each time a translation is neededAlystrasz
2022-01-17documented: index.js, cli.js, lang.js app/lang.js0neGal
2021-12-29fallback to localizations0neGal
If a message is not localized it'll default back to English, instead of just giving back the string...
2021-12-28if no lang is set, use "en"0neGal
By error I forgot to include this check... I also added in the ability for it to look for a lang file without the extra locale info on the end, i.e if "en-GB" is not found it'll try "en"
2021-12-28attempt at making localization0neGal
This may or may not be how we actually do localization in the future, however for now this seems doable. I will obviously need to look at how we detect the language, as I think instead of relying on names like "en-US" just have "en", so we don't have to symlink various editions of English to the same file. But for now this is a draft, and the important part of this is rather how the underlying localization works.