New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with localised Data Source output #2
Comments
Multilingual checks if a field (in another language) has content or not, and if not, it defaults to the first language. The problem here (I guess) is that more complex fields like Meta Keys have a very different structure and Not sure if it's even possible to provide a general solution to this without adding support for fields like Meta Keys specifically. Edit: I have an idea... |
@nilshoerrmann Can you think of other common fields with a more complex structure you need this tested with? |
Date and Time maybe? |
If you want to help with this issue, maybe you can tinker around a bit and try to find a good solution. The value checking is in Line 356. Edit: Other idea would be, we just have multiple elemements with the same name and a language attribute ( This solution wouldn't care about falling back to the default language (in case the translated field is empty) and leave the checking and falling back to your XSLT. Would be more flexible, but also massively bloat the XSLT (you would have to do the checks and fallback everywhere you want to access a translated field). |
If I have two fields, say In this case, wouldn't it be easier to just check for the existence of those elements without taking care of their content? So you could just clone the element you need, change its name to
I like the idea of having language attributes.
It would be possible to have both ( |
Unfortunately not, Symphony also returns empty fields, that's why I have to check the content (empty textareas even have content since Symphony outputs an empty CDATA-string).
That's already how I do it, but as mentioned above, still needs checking if empty or not.
Right, good idea. Doesn't solve our issue, though. |
Is there something like a |
There's the generate() function which returns the XML output as string. Not sure if this is really better for checking or even more complicated. Will do some testing. |
I just noticed that this issue also occurs on the core select field. |
This is a strange problem with Brendan's Meta Keys extension: Multilingual returns the correct translation for all fields in the XML output expect for Meta Keys fields. It always defaults to the first language available.
Example:
…
datenblatt
should representdatenblatt-en
in this case while it shows the content ofdatenblatt-de
.The text was updated successfully, but these errors were encountered: