wrong_lang

An article by Gaspard Bucher

Show a message when the article is not in the correct language.

  1. action
  2. ajax
  3. API
  4. classes
  5. common attributes
  6. conditions
  7. context
  8. dates
  9. display
  10. forms
  11. i18n
    1. lang_links
    2. load
    3. trans
    4. wrong_lang
  12. meta
  13. SQLiss
  14. urls

Show a message when the article is not in the correct language.

  • text message to display (evaluated)
see prefix, zena 1.0

Conditional text to display when the visitor’s language does not match the current version’s language.

Display the default ‘[fr]’ string:

<r:wrong_lang/> some other text

Customize the string to display on wrong language:

<r:wrong_lang text='(article in #{trans(v.lang)}) '/>some other text

You can also use wrong_lang as a conditional block:

<r:wrong_lang>Warning: this is not an article in your mother's tongue</r:wrong_lang> some other text

As with all conditional blocks, you can use the ‘else’ clause to display text only when the languages match:

<r:wrong_lang>Warning: this is not an article in your mother's tongue<r:else>Easy to read</r:else></r:wrong_lang> some other text