If I add the option translation="#" all works well when I preview the node. But if I save the node, linodef issues a message: Linodef tag with id 69 ignores option translation since it has no value.

But it has the value "#"!

To be sure, I deactivated all filters except linodef and it still does not work.

btw. translation="# " works, but only with the trailing blank.

Comments

pepe roni’s picture

I forgot: The node has currently no language, but I want to assign a language later to translate it.

Roi Danton’s picture

Title: translation="#" does not work » Suppress warning message of translation="#" when using nodes without language settings
Status: Active » Needs review
StatusFileSize
new1.02 KB

When previewing the joker is replaced after the validation and when viewing it is replaced before. So it is NULL indeed when the node has no language what means "empty value". To suppress that (technically correct message) I could replace the joker with the sites default language, see patch.

Maybe a status message like the deprecated messages could be filed, too. But I don't think a message is necessary for this case (and Linodef needs a better message system on a "per role base" anyway).

pepe roni’s picture

I don't think it is good to use the site's default language. You should simply ignore the translation option in this case and display the named node. Example:

Node 78 (german)
Node 79 (english, translation of node 78)
Node 80: [#78,translation="#"], no language

If the site's language was english, you would link to node 79, if it was german, you would link to node 78, if it was french, you would link to what? So it is better to link to node 78!

If I would like to link to node 79 as default, I would mention this node in the linodef tag instead.

Another approach could be to extent the translation option: [#78,translation="#,de,en,fr"].

You could read that: "link to the translation of node 78 in the following sequence (first match):

  • if current node has language and node 78 has node translation in that language: link to that translation node
  • if current node has no language or node 78 has no node translation in current node's language,
    • but node 78 has translation "de": link to that translation node
    • but node 78 has translation "en": link to that translation node
    • but node 78 has translation "fr": link to that translation node
  • if none of the above applies, link to node 78

Syntactically you can enter a list of languages. In most cases # only makes sense in the first position.

Roi Danton’s picture

You should simply ignore the translation option in this case and display the named node

Okay, new patch attached.

Btw, I don't like multiple choices. The options translation is already confusing for most users as it is now and those sequences are likely to stay the same for all tags. So if such a feature might be required it would become an admin setting.