In VirtueMart we have two specialities. The first speciality is that language related data is kept in extra language tables. Of course, we have always an extra join, even for the main language and that creates theoretically a performance loss. But on the other hand, we can handle as many languages as we want without performance loss.
The whole system has a fallback system on sql level. Pragmatically it is "impossible" to update a running store with another language, if fallbacks are not available. Imagine your store has 1000 products and you want to add another language, which takes time and so long the products would have no description in the new language. The fallback is always back to the mainlanguage. The fallback can be also disabled (per vmconfig). On the SQL level, the fallback work like that:
SELECT IFNULL(l.'.$langField.','ld.'.$langField) FROM lang1 as l LEFT JOIN langDefault as ld ON l.$idField=ld.$idField WHERE $idField = "id"
The best, you dont need to care about in normal daily work as developer. The whole complex stuff is in the class VmTable. So as long you use vmTable to store or load, anything works automatically. Just if you write a search plugin, it maybe important.
The second speciality is our vmLanguage class. The reason is simple, in VirtueMart it can happen, that we have to send 2 emails in different languages. Joomla uses always the same language object. Changing a language is just overwriting the first JLanguage object. This leaded to unwanted side effects and is also bad for performance. Our class vmLanguage caches the JLanguage objects per language.
Additionally we put all helper functions in that file. They ensure that we cannot include a language file more than once. If we change the language, all already loaded language files are automatically loaded for the other language!
And we can define our own overrides. This is done in the standard vmconfig. Imagine you run a store in portugese, spanish and english. It makes sense, that the fallback for portugese is spanish and vice versa. For example
pt-PT~es-ES;pt-BR~es-ES
maps the portugese language of Portugal and Brazil to spanish.
What is important for normal users? Almost nothing, just remember, the fallback is always to the main language. So be sure that your product has always a description in the main language. And take care that your set main language is your actual language. It often happened in the past, that people write whatever language in english tables.
Our hint for developers. Use always the functions of the class vmText and vmLanguage and NOT JText or JLanguage.