I know, I know, shame on me. At that time we were forced to cut all expenses for that project. That included docs and testing. Today I don’t care anymore what customers say about that... Lessons learned.
The index we used for the Zope 3 app containes BTrees for all the languages and is able to search the correct language (e.g. the user selected language). I don’t think there is something similar in Plone yet. The “magic” happens here: ps.zope.i18nfield/index.py at master · propertyshelf/ps.zope.i18nfield · GitHub
def doIndex(self, oid, value):
"""Index a value by its object id."""
if isinstance(value, I18NDict):
for lang in utils.available_languages():
lang_val = value.get_for_language(lang)
if lang_val is None:
index = self.get_or_add_index(lang)
It iterates over all available languages in the system and indexes the corrsponding content for that field in a given language in the matching sub-index. Searching then happens again in the sub-index for the given language.