I couldn’t find a solution for my problem.
I want to manage about five to six different languages with YAMS. The installation was no problem. But now I want to have something like a fallback solution:
If there’s no content in the chosen language the content of the default language should appear.
How can I do that?
Sorry for the delay in replying. There is nothing built into YAMS at present that will allow automatic falling back to the default language.
You can get close to what you want using some tricks, but there is currently no way that is both elegant and simple I’m afraid.
Here are some ideas...
A) The multilingual template variables created by YAMS (like pagetitle_en) can be edited manually and given default values. So you could set a default value for the non-default language fields to some text that says "not yet translated" (in the appropriate language.)
B) Another approach is to use a [tt]((yams_data:docId:fieldname))[/tt] placeholder to pull in data from the default language template variable into a non-default language template variable. For example, for document number 3, if the default language was English with id [tt]en[/tt], then you could make the English page title appear in a different language pagetitle field by inserting [tt]((yams_data:3:pagetitle_en))[/tt] in that field.
Clearly, the text that needs to be entered is different for each document and each field... so this approach is not very practical since setting up the default values would mean editing each field of each document.
C) What we want is a way to assign the docId automatically so that the ((yams_data)) placeholder can be used as the default value of the non-default language multilingual template variables. One simple way of doing this would appear to be to use [tt]((yams_data:[*id*]:pagetitle_en))[/tt] as a default value for the non-English multilingual pagetitle TVs. However, the problem with this approach is that when evaluated in the context of a ditto call, this will always evaluate to the English page title of the document containing the Ditto call rather than the source document. In the context of a Ditto call you’d need [tt]((yams_data:[+id+]:pagetitle_en))[/tt] instead. I haven’t yet found a way around this.
Hope that helps.