Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23554

Some strings in frontend break gettext

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 7.0.0alpha7, 7.0 (plan)
    • 7.0.0alpha6, 7.0.0alpha7
    • Frontend (F)
    • None
    • Sprint 105 (Oct 2023)
    • 0.125

      The strings in question are:

      It seems that the number of format specifiers like %1$s must be the same for singular an plural forms when _n / ngettext function is used. This is due to how the plural formula is specified for russian and ukranian languages.

      "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

      This formula results in msgstr[0] translation be used for both signular and plural forms, and in case of format specifier number mismatch, it results in gettext failing

      number of format specifications in 'msgid_plural' and 'msgstr[0]' does not match

      Here is an example *.po file entry.

      #: include/classes/helpers/CMaintenanceHelper.php:85
      #, c-format
      msgid "At %1$s %2$s of every week"
      msgid_plural "At %1$s %2$s of every %3$s weeks"
      msgstr[0] "В %1$s %2$s каждую неделю"
      msgstr[1] "В %1$s %2$s каждые %3$s недели"
      msgstr[2] "В %1$s %2$s каждые %3$s недели"

      Propose rephrasing the string in question to include the same number of format specifiers for both singular and plural form. Update development guidelines.

            vmurzins Valdis Murzins
            yurii Jurijs Klopovskis
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: