Arc Forumnew | comments | leaders | submitlogin
Language-neutral news.arc
5 points by chris_l 5209 days ago | 3 comments
I'm currently working on this: a language-neutral news.arc, as in natural language strings are put into a seperate file for translation (in my case into German). If you have done some work on this or have hints, please contact me.


3 points by garply 5209 days ago | link

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 5207 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 5207 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).

-----