We use the i18n class with the namespace and language attribute in the oure e-commerce system. The class has a default function called "translate", which basically searches the dictionary. This dictionary is loaded using a memory template from a text file containing all translations for the namespace and language.
The skeletons for these translation files are generated by a special tool (actually written by vbscript) that analyzes ASP calls for i18n ($ somestring). File names are based on namespace and languages, for example. "Shoppingcart_step_1_FR.txt". The tool can actually update / expand existing translation files when we add new translatable strings to ASP code, which is very important for maintenance.
The performance overhead for using this method is minimal. Due to segmentation, our largest translation file contains about 200 translatable strings (including static image URLs). Downloading this query has very little impact on performance. I think it would be possible to cache translation dictionaries in the application object using some kind of third-party dictionary for reading, but IMHO this is not a problem.
Extra tip, use variable substitution on your line to improve translatability. For example, use:
<%=replace(i18n("Buy $productname"), "$productname", product.name)%>
instead
<%=i18n("Buy")%> <%=product.name%>
The first method is much more flexible for translators. Many languages have different sentence structures.
Joost moesker
source share