Arc Forumnew | comments | leaders | submitlogin
3 points by garply 5248 days ago | link | parent

I use some i18n in my programs, a key decision I think you'll have to make is whether translation should be done at compile-time or dynamically. I went the former route, but I often find myself wishing my strings were translated dynamically.

I use a global called locale* and have a macro which translates strings based on it. I'd be happy to work with you and the community to agree on something we all think works well and put it in the github repo.



1 point by chris_l 5247 days ago | link

I don't think the cost of dynamic lookup will be very high, at least in news.arc there isn't that much text. I intend to use a function that looks into a table:

(prn (i18n 117))

I think numbers over pseudo-text-symbols will fit with arc's keep-it-brief style.

-----

3 points by garply 5246 days ago | link

I don't like the numeric setup - I find it makes the code hard to read. Most of the other i18n libs I've seen use English in the code and then a mapping between English and other languages in a separate file. I think that approach makes more sense. When I'm skimming code, I'd rather read (i18n "Add Comment") than (i18n 143).

-----