Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-15330

Twig function to know if a language string is defined

    XMLWordPrintable

    Details

      Description

      I think there is necessary a twig function know if a language string is defined on the templates.

      Actually 2 variables are passed to the template (the language string, and a flag to know if the string is defined)

      <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>

       

      this is what i do

      <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label>{% if lang(options.TITLE_EXPLAIN) != options.TITLE_EXPLAIN %}<br /><span>{{ lang(options.TITLE_EXPLAIN) }}</span>{% endif %}</dt>

       

      And this is how i think it should be:

      <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label>{% if lang_exists(options.TITLE_EXPLAIN) %}<br /><span>{{ lang(options.TITLE_EXPLAIN) }}</span>{% endif %}</dt>

       

       

       

       

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              Marc Marc
              Reporter:
              rubencm rubencm
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: