Closed thombruce closed 1 year ago
Status | Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Lines | 67.93% / 60% | 358 / 527 |
🟢 | Statements | 67.93% / 60% | 358 / 527 |
🟢 | Functions | 63.41% / 60% | 26 / 41 |
🟢 | Branches | 70.17% / 60% | 40 / 57 |
Basic stuff; we're just setting up the mechanism to permit further translations in the future. There aren't that many strings that need translating... yet.
Language should change automatically dependent on user's actual locale, but I need to test this. I think we still should probably have a button as well as this to handle manually changing language.
For locale changing see: https://vue-i18n.intlify.dev/guide/essentials/scope.html
With a mechanism to change language implemented and defaulting to 'en' if an unsupported language is present... this is now done.
Some of the logic may need reworked later. For instance if we add support for sub-languages like 'en-US' and 'en-GB', then the default selector will need to be tweaked. And naturally we need to add support for other languages... but this should be easy for contributors to do at this point - I don't speak much any language other than English, but the mechanism is there to support whatever language gets added; the contributor just needs to do two things:
i18n/[lang].ts
file (e.g. i18n/en.ts
)i18n/index.ts
I think that's as minimal as I can make the process without stuffing all translations into a single file. This is preferable to that. Two simple changes, and I am more than happy to handle the second part for anyone not too familiar with programming if it means they're contributing their language to the project.
In fact... I could create an application that makes this kind of contribution SUPER easy. It'd be a wholly separate project, but I might consider it as it might have some other utilities too... The idea being that it would be a non-programming way for non-programmers to contribute... strings, I guess. I don't know what use that has outside of internationalisation, but I'll keep the idea in mind.
Closes #27