Hello,
I have lately been trying to internationalize to at least 2 languages a program I am making. For that matter, I have been using nimterlingua and i18n. However I have problems with both of them.
In this case I'm trying to build a website and I'm using niml to create some html. However, nimterlingua is not able to exchange the strings to the ones specified on the required config file. The same happens with string concatenation, arguments they are not replaced with the correct string. I think this happens because the string replacement performed by nimterlingua happens after niml/& operations have been performed, so the string is already different, avoiding nimterlingua to replace them. A solution would be to store all internationalizable variables in another place somehow and perform there the nimterlingua process. However, that basically makes this package almost useless.
If I try to use i18n, the problem is simple, gettext is not compatible with nim. A work around I found was to use the gettext function provided by this package (as gettext(string)) instead of the shorter version tr, then ln -s (or copy) the nim file to another one ending in .py and find for translatable strings then (afterwards, the copy or link could be deleted). I have been using poedit for that purpose, as I'm a beginner on this world of translation.
I don't think I should be doing any of the both work arounds I mentioned, as they are pretty dirty. The one that I seem to like the most is the second one, making use of a script to create links to all nim files and then apply xgettext (I think) to the whole folder to update the po file.
I have also thought about macro execution preference. If I could make nim execute first the macro for nimterlingua, I would just use that, but I don't know if that is even possible.
I hope you can help me with this problem. Anyways, thank you.
Make a shared lib with only strings, kinda like translations.nim --> translations.so.
Report bugs to the libs that do not work, lib devs can not read minds yet, so the only way is to report an issue. :)