bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59062] po.m4: LINGUAS check should exclude .po files for unrelated


From: Arfrever
Subject: [bug #59062] po.m4: LINGUAS check should exclude .po files for unrelated languages
Date: Fri, 4 Sep 2020 00:52:02 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

URL:
  <https://savannah.gnu.org/bugs/?59062>

                 Summary: po.m4: LINGUAS check should exclude .po files for
unrelated languages
                 Project: GNU gettext
            Submitted by: arfrever
            Submitted on: Fri 04 Sep 2020 04:52:00 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

po.m4 contains:

          # CATALOGS depends on both $ac_dir and the user's LINGUAS
          # environment variable.
          INST_LINGUAS=
          if test -n "$ALL_LINGUAS"; then
            for presentlang in $ALL_LINGUAS; do
              useit=no
              if test "%UNSET%" != "$LINGUAS"; then
                desiredlanguages="$LINGUAS"
              else
                desiredlanguages="$ALL_LINGUAS"
              fi
              for desiredlang in $desiredlanguages; do
                # Use the presentlang catalog if desiredlang is
                #   a. equal to presentlang, or
                #   b. a variant of presentlang (because in this case,
                #      presentlang can be used as a fallback for messages
                #      which are not translated in the desiredlang catalog).
                case "$desiredlang" in
                  "$presentlang"*) useit=yes;;
                esac
              done
              if test $useit = yes; then
                INST_LINGUAS="$INST_LINGUAS $presentlang"
              fi
            done
          fi
          CATALOGS=
          if test -n "$INST_LINGUAS"; then
            for lang in $INST_LINGUAS; do
              CATALOGS="$CATALOGS $lang.gmo"
            done
          fi


This allows an xx element to match xx or xx@yy or xx_ZZ, but it also
unexpectedly matches xxa.

E.g. LINGUAS="fr" currently would enable processing of fr.po, fr_FR.po (French
language) and unexpectedly also frr.po (North Frisian language).

Probable fix is to change 'case' check to be:

case "$desiredlang" in
  "$presentlang"|"$presentlang"@*|"$presentlang"_*) useit=yes;;
esac





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59062>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]