• How to resolve gettext error "can't guess language"?

    From Gregor Riepl@21:1/5 to All on Thu Apr 8 15:00:02 2021
    Hi,

    We're getting translation errors on the Debian package "cura":

    gettext: resources/i18n/cs_CZ/cura.po: can't guess language
    ...other po files follow...

    Full report: https://i18n.debian.org/l10n-pkg-status/c/cura.html

    Can you help us figure out why this happens?
    The PO files have the Language metadata tag set: https://salsa.debian.org/3dprinting-team/cura/-/blob/master/resources/i18n/cs_CZ/cura.po#L14

    Thanks,
    Gregor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jens Seidel@21:1/5 to All on Thu Apr 8 15:20:02 2021
    Hi Gregor,

    Am 08.04.2021 um 14:51 schrieb Gregor Riepl <onitake@gmail.com>:

    We're getting translation errors on the Debian package "cura":

    gettext: resources/i18n/cs_CZ/cura.po: can't guess language
    ...other po files follow...

    Full report: https://i18n.debian.org/l10n-pkg-status/c/cura.html

    Can you help us figure out why this happens?

    is the locale package installed? Is cs in the output of locale -a? The po file itself is fine. For me it works flawlessly.

    Jens

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gregor Riepl@21:1/5 to All on Thu Apr 8 20:20:01 2021
    gettext: resources/i18n/cs_CZ/cura.po: can't guess language
    ...other po files follow...

    Full report: https://i18n.debian.org/l10n-pkg-status/c/cura.html

    is the locale package installed? Is cs in the output of locale -a? The po file itself is fine. For me it works flawlessly.

    If I execute the command locally, it doesn't report any errors.
    As a matter of fact, all of the PO files verify ok, even though I have
    only enabled some of the locales.

    But I'd like to know why https://i18n.debian.org/ flags these errors.
    Is there something wrong with this system? Do I have to contact debian-l10n-devel@lists.alioth.debian.org for help?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laura Arjona Reina@21:1/5 to All on Fri Apr 9 10:20:02 2021
    Hi

    (I think most of the people subscribed to debian-l10n-devel is also
    subscribed to debian-i18n, but I'm adding them, just in case).

    El 8/4/21 a las 20:00, Gregor Riepl escribió:
    gettext: resources/i18n/cs_CZ/cura.po: can't guess language
    ...other po files follow...

    Full report: https://i18n.debian.org/l10n-pkg-status/c/cura.html

    is the locale package installed? Is cs in the output of locale -a? The po file itself is fine. For me it works flawlessly.

    If I execute the command locally, it doesn't report any errors.
    As a matter of fact, all of the PO files verify ok, even though I have
    only enabled some of the locales.

    But I'd like to know why https://i18n.debian.org/ flags these errors.
    Is there something wrong with this system? Do I have to contact debian-l10n-devel@lists.alioth.debian.org for help?


    The code producing this error is the dl10n-check script:

    https://salsa.debian.org/l10n-team/dl10n/-/blob/master/dl10n-check

    I'm not 100% sure, but I think that the problem is that the function process_po_file https://salsa.debian.org/l10n-team/dl10n/-/blob/master/dl10n-check#L654

    tries to guess the language from the name of the file instead of the
    folder structure or the Language tag written in the content of the file.

    I don't know if the cura.po files should be renamed to cura.xx_yy.po or
    it's better to change the script to add some logic to try to guess the
    language from the Language tag inside the file. This second option I'm
    afraid is beyond my Perl skills.

    Kind regards,
    --
    Laura Arjona Reina
    https://wiki.debian.org/LauraArjona

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From victory@21:1/5 to Laura Arjona Reina on Fri Apr 9 23:40:01 2021
    On Fri, 9 Apr 2021 10:12:30 +0200
    Laura Arjona Reina wrote:

    gettext: resources/i18n/cs_CZ/cura.po: can't guess language
    ...other po files follow...
    Full report: https://i18n.debian.org/l10n-pkg-status/c/cura.html
    The code producing this error is the dl10n-check script: https://salsa.debian.org/l10n-team/dl10n/-/blob/master/dl10n-check
    I'm not 100% sure, but I think that the problem is that the function process_po_file https://salsa.debian.org/l10n-team/dl10n/-/blob/master/dl10n-check#L654
    tries to guess the language from the name of the file instead of the
    folder structure or the Language tag written in the content of the file.
    I don't know if the cura.po files should be renamed to cura.xx_yy.po or
    it's better to change the script to add some logic to try to guess the language from the Language tag inside the file. This second option I'm
    afraid is beyond my Perl skills.

    it determines the lang code in 4 patterns:
    [lang]/messages/
    [lang]/LC_MESSAGES/
    po/[lang]/[whatever].po
    [lang].po

    resources/i18n/[lang]/cura.po does not match any of these;
    it will match if you place po files under i18n/po/


    --
    victory
    no need to CC me :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gregor Riepl@21:1/5 to All on Mon Apr 12 16:00:03 2021
    it determines the lang code in 4 patterns:
    [lang]/messages/
    [lang]/LC_MESSAGES/
    po/[lang]/[whatever].po
    [lang].po

    resources/i18n/[lang]/cura.po does not match any of these;
    it will match if you place po files under i18n/po/

    Can this be customized so it checks under resources/ ?

    I'm strongly against modifying the upstream source code structure just
    to silence an automatic verification tool in Debian...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)