Age | Commit message (Collapse) | Author |
|
This module makes it easier to read JSON files, simply returning false
on errors, and attempting to repair the JSON automatically.
|
|
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.
|
|
This allows someone to have their system in any language, and then have
Viper in a separate language. This is also useful for testing.
|
|
variable
|
|
|
|
|
|
If a message is not localized it'll default back to English, instead of
just giving back the string...
|
|
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"
|
|
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.
|