I've finally added some localization. I started writing all the strings in French, because it's running on a minitel, and having it display anything else felt like a betrayal.
I finally took the time to add a localization class, that handles English, French and Spanish. The spanish translation could use some checking by a native, but there's no rush now (also, the minitel can't display the "ñ" character, which looks odd).
Basically, all I have is an enum with the strings index, and a 2D array of strings to display :
enum Languages {
ENGLISH,
FRENCH,
SPANISH,
LANGUAGES_LAST
};
enum L10N_STRINGS {
SSH_PAGE_TITLE,
SSH_PAGE_HOST,
[...]
L10N_LAST_STRING
};
String languageStore[L10N_LAST_STRING][LANGUAGES_LAST] = {
{ "3615 SSH client", "3615 SSH client", "3615 SSH client" },
{ "Host:", "Hôte :", "Servidor:" },
[...]
};
The implementation is contained in a single header file, and is super simple to use. It doesn't have all the bells and whitles of more complete solutions, but it's simple and more than enough for my needs.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.