Building upon the criticism of my first version, I have a new translation API at
This allows you to translate interpolated strings in the native Crystal syntax. There is no need for you to write your code in a special string format for translation.
This will be checked in over
BrucePerens/i18n, my older translation shard,
when it’s more stable. The paint is still wet on this software, and I got it done just in time to deliver a Raw Crystal talk about it tomorrow, but it’s available for you to review and criticize.
This addresses some issues with the first version:
- Translations can change the order of interpolated expressions.
- The programmer can add explanations of the meaning of the interpolated expressions, for the translator.
- The programmer can add interpolated expressions that are not used in the native-language string, so that things that don’t appear in the native language, like gendered nouns, can be handled.
- It is possible to modify the translation table at run-time, so that I can implement a version of http://github.com/BrucePerens/i18n-edit for Lucky, etc. This allowed the Rails programmer to click on strings in a running program and enter their translations directly!