I've just finished an initial version of a i18n/l10n library for Nim called intl. Take a look and tell me what you think: https://github.com/iffy/nim-intl
Some of the main reasons for me writing it:
messages "es":
done 48392, "greeting", "Hola"
todo 13482, "yellow", "yellow"
todo 28392, "red", "red"
redo 39294, "favorite", "mejor"
gone 11111, "green", "verde"
todo 55445, "cats", proc(count:int):string =
if count == 1:
return "I have 1 cat"
else:
return "I have " & count & " cats."
echo tr"Hello, World!"
becomes
echo [selectedMessages_myprogram.s_rhellowor71994]
Take a look and tell me what you think: https://github.com/iffy/nim-intl
I like the approach. :-)
Here are my ideas/suggestions/bikeshedding. ;-)
In the README:
In the code (intl.nim):