Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I18N::LangTags::List name fails for az-* #16500

Open
p5pRT opened this issue Apr 9, 2018 · 6 comments
Open

I18N::LangTags::List name fails for az-* #16500

p5pRT opened this issue Apr 9, 2018 · 6 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Apr 9, 2018

Migrated from rt.perl.org#133093 (status was 'open')

Searchable as RT133093$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 9, 2018

From martin@senfdax.de

Created by martin@senfdax.de

This is a bug report for perl from martin@​senfdax.de,
generated with the help of perlbug 1.40 running under perl 5.26.0.

-----------------------------------------------------------------
I think that the sub name does not respond corret to 'az-Latn',
'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback"
because the string 'az-Arab' in the POD contains a uppercase char while
sub name() invokes lc() on $_[0]

perl -E 'use I18N​::LangTags​::List; $I18N​::LangTags​::List​::Debug = 1;
say I18N​::LangTags​::List​::name("az-Latn")'
Input​: {az-latn}
Shaving off​: -latn leaving az
Output​: {Azerbaijani}{-latn}
Azerbaijani (Subform "latn")

Perl Info

Flags:
     category=library
     severity=low
     module=I18N::LangTags

Site configuration information for perl 5.26.0:

Configured by martin at Wed May 31 13:14:31 CEST 2017.

Summary of my perl5 (revision 5 version 26 subversion 0) configuration:

   Platform:
     osname=linux
     osvers=4.4.0-78-generic
     archname=x86_64-linux-multi
     uname='linux psyche 4.4.0-78-generic #99-ubuntu smp thu apr 27 
15:29:09 utc 2017 x86_64 x86_64 x86_64 gnulinux '
     config_args='-de 
-Dprefix=/home/martin/perl5/perlbrew/perls/perl-5.26.0 -Duseshrplib 
-Dusemultiplicity 
-Aeval:scriptdir=/home/martin/perl5/perlbrew/perls/perl-5.26.0/bin'
     hint=recommended
     useposix=true
     d_sigaction=define
     useithreads=undef
     usemultiplicity=define
     use64bitint=define
     use64bitall=define
     uselongdouble=undef
     usemymalloc=n
     default_inc_excludes_dot=define
     bincompat5005=undef
   Compiler:
     cc='cc'
     ccflags ='-fwrapv -fno-strict-aliasing -pipe 
-fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64'
     optimize='-O2'
     cppflags='-fwrapv -fno-strict-aliasing -pipe 
-fstack-protector-strong -I/usr/local/include'
     ccversion=''
     gccversion='5.4.0 20160609'
     gccosandvers=''
     intsize=4
     longsize=8
     ptrsize=8
     doublesize=8
     byteorder=12345678
     doublekind=3
     d_longlong=define
     longlongsize=8
     d_longdbl=define
     longdblsize=16
     longdblkind=3
     ivtype='long'
     ivsize=8
     nvtype='double'
     nvsize=8
     Off_t='off_t'
     lseeksize=8
     alignbytes=8
     prototype=define
   Linker and Libraries:
     ld='cc'
     ldflags =' -fstack-protector-strong -L/usr/local/lib'
     libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed 
/usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib 
/usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
     libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
     perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
     libc=libc-2.23.so
     so=so
     useshrplib=true
     libperl=libperl.so
     gnulibc_version='2.23'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs
     dlext=so
     d_dlsymun=undef
     ccdlflags='-Wl,-E 
-Wl,-rpath,/home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/5.26.0/x86_64-linux-multi/CORE'
     cccdlflags='-fPIC'
     lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Locally applied patches:
     Devel::PatchPerl 1.38


@INC for perl 5.26.0:
     /home/martin/.workspace/e2l/base/lib
     /home/martin/.workspace/e2l/sta/lib
     /home/martin/.workspace/e2l/agent/lib
     /home/martin/.workspace/e2l/tls/lib
     /home/martin/.workspace/e2l/lib
     /home/martin/.workspace/e2l/webapps/webadmin/lib
     /home/martin/.workspace/e2l/webapps/statusweb/lib
     /home/martin/.workspace/e2l/webapps/restapi/lib
     /home/martin/.workspace/e2l/portal/dzbank/lib
/home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux-multi
/home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/site_perl/5.26.0
/home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/5.26.0/x86_64-linux-multi
     /home/martin/perl5/perlbrew/perls/perl-5.26.0/lib/5.26.0


Environment for perl 5.26.0:
     HOME=/home/martin
     LANG=de_DE.UTF-8
     LANGUAGE=de_DE
     LC_CTYPE=de_DE.UTF-8
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
PATH=/home/martin/perl5/perlbrew/bin:/home/martin/perl5/perlbrew/perls/perl-5.26.0/bin:/usr/lib/go-1.9/bin/go:/home/martin/.rakudobrew/moar-2017.09/install/share/perl6/site/bin:/home/martin/.rakudobrew/bin:/opt/bin:/home/martin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/martin/bin/:/opt/splunk/bin:/opt/netsnmp/bin:/opt/idea-IC-139.225.3/bin:/opt/gradle/gradle-2.2.1/bin:.:/home/martin/bin/android-sdk-linux/platform-tools
PERL5LIB=/home/martin/.workspace/e2l/base/lib:/home/martin/.workspace/e2l/sta/lib:/home/martin/.workspace/e2l/agent/lib:/home/martin/.workspace/e2l/tls/lib:/home/martin/.workspace/e2l/lib:/home/martin/.workspace/e2l/webapps/webadmin/lib:/home/martin/.workspace/e2l/webapps/statusweb/lib:/home/martin/.workspace/e2l/webapps/restapi/lib:/home/martin/.workspace/e2l/portal/dzbank/lib
     PERLBREW_BASHRC_VERSION=0.76
     PERLBREW_HOME=/home/martin/.perlbrew
PERLBREW_MANPATH=/home/martin/perl5/perlbrew/perls/perl-5.26.0/man
PERLBREW_PATH=/home/martin/perl5/perlbrew/bin:/home/martin/perl5/perlbrew/perls/perl-5.26.0/bin
     PERLBREW_PERL=perl-5.26.0
     PERLBREW_ROOT=/home/martin/perl5/perlbrew
     PERLBREW_VERSION=0.76
     PERL_BADLANG (unset)
     SHELL=/bin/zsh

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 9, 2018

From @jkeenan

On Mon, 09 Apr 2018 08​:37​:39 GMT, martin@​senfdax.de wrote​:

This is a bug report for perl from martin@​senfdax.de,
generated with the help of perlbug 1.40 running under perl 5.26.0.

-----------------------------------------------------------------
I think that the sub name does not respond corret to 'az-Latn',
'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback"
because the string 'az-Arab' in the POD contains a uppercase char
while
sub name() invokes lc() on $_[0]

perl -E 'use I18N​::LangTags​::List; $I18N​::LangTags​::List​::Debug = 1;
say I18N​::LangTags​::List​::name("az-Latn")'
Input​: {az-latn}
Shaving off​: -latn leaving az
Output​: {Azerbaijani}{-latn}
Azerbaijani (Subform "latn")

I believe that this is at most a minor documentation flaw.

'perldoc I18N​::LangTags​::List' specifically states​:

#####
Remember these important facts​:
...
* Language tags are not case-sensitive. en-US, en-us, En-Us, etc., are all the same tag, and denote the same language.
#####

So the function accepts input in mixed case and consistently returns lower case. Example​:

#####
$ for f in az uz sr; do echo -n $f | perl -E 'use I18N​::LangTags​::List; $g=<>;$a="$g-LATN";$u="$g-Latn";$l="$g-latn";say $a;say I18N​::LangTags​::List​::name($a);say ""; say $u;say I18N​::LangTags​::List​::name($u); say ""; say $l;say I18N​::LangTags​::List​::name($l); say "";'; done
az-LATN
Azerbaijani (Subform "latn")

az-Latn
Azerbaijani (Subform "latn")

az-latn
Azerbaijani (Subform "latn")

uz-LATN
Uzbek (Subform "latn")

uz-Latn
Uzbek (Subform "latn")

uz-latn
Uzbek (Subform "latn")

sr-LATN
Serbian (Subform "latn")

sr-Latn
Serbian (Subform "latn")

sr-latn
Serbian (Subform "latn")
#####

Would a small documentation patch improve matters?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 9, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 11, 2018

From martin@senfdax.de

There are probably even more langtags affected​: e.g

{zh-Hans} Chinese, in simplified script;
{zh-Hant} Chinese, in traditional script;

Am 09.04.2018 um 16​:40 schrieb James E Keenan via RT​:

On Mon, 09 Apr 2018 08​:37​:39 GMT, martin@​senfdax.de wrote​:

This is a bug report for perl from martin@​senfdax.de,
generated with the help of perlbug 1.40 running under perl 5.26.0.

-----------------------------------------------------------------
I think that the sub name does not respond corret to 'az-Latn',
'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback"
because the string 'az-Arab' in the POD contains a uppercase char
while
sub name() invokes lc() on $_[0]

perl -E 'use I18N​::LangTags​::List; $I18N​::LangTags​::List​::Debug = 1;
say I18N​::LangTags​::List​::name("az-Latn")'
Input​: {az-latn}
Shaving off​: -latn leaving az
Output​: {Azerbaijani}{-latn}
Azerbaijani (Subform "latn")

I believe that this is at most a minor documentation flaw.

'perldoc I18N​::LangTags​::List' specifically states​:

#####
Remember these important facts​:
...
* Language tags are not case-sensitive. en-US, en-us, En-Us, etc., are all the same tag, and denote the same language.
#####

So the function accepts input in mixed case and consistently returns lower case. Example​:

#####
$ for f in az uz sr; do echo -n $f | perl -E 'use I18N​::LangTags​::List; $g=<>;$a="$g-LATN";$u="$g-Latn";$l="$g-latn";say $a;say I18N​::LangTags​::List​::name($a);say ""; say $u;say I18N​::LangTags​::List​::name($u); say ""; say $l;say I18N​::LangTags​::List​::name($l); say "";'; done
az-LATN
Azerbaijani (Subform "latn")

az-Latn
Azerbaijani (Subform "latn")

az-latn
Azerbaijani (Subform "latn")

uz-LATN
Uzbek (Subform "latn")

uz-Latn
Uzbek (Subform "latn")

uz-latn
Uzbek (Subform "latn")

sr-LATN
Serbian (Subform "latn")

sr-Latn
Serbian (Subform "latn")

sr-latn
Serbian (Subform "latn")
#####

Would a small documentation patch improve matters?

Thank you very much.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 11, 2018

From martin@senfdax.de

only if you change the pod in lines 355 ff.

https://metacpan.org/source/SHAY/perl-5.26.1/dist/I18N-LangTags/lib/I18N/LangTags/List.pm#L355

The expected result of

I18N​::LangTags​::List​::name('az-Latn') would beAzerbaijani in Latin script.

Am 09.04.2018 um 16​:40 schrieb James E Keenan via RT​:

On Mon, 09 Apr 2018 08​:37​:39 GMT, martin@​senfdax.de wrote​:

This is a bug report for perl from martin@​senfdax.de,
generated with the help of perlbug 1.40 running under perl 5.26.0.

-----------------------------------------------------------------
I think that the sub name does not respond corret to 'az-Latn',
'az-Arab' and 'az-Cyrl'. The results returns the "subform fallback"
because the string 'az-Arab' in the POD contains a uppercase char
while
sub name() invokes lc() on $_[0]

perl -E 'use I18N​::LangTags​::List; $I18N​::LangTags​::List​::Debug = 1;
say I18N​::LangTags​::List​::name("az-Latn")'
Input​: {az-latn}
Shaving off​: -latn leaving az
Output​: {Azerbaijani}{-latn}
Azerbaijani (Subform "latn")

I believe that this is at most a minor documentation flaw.

'perldoc I18N​::LangTags​::List' specifically states​:

#####
Remember these important facts​:
...
* Language tags are not case-sensitive. en-US, en-us, En-Us, etc., are all the same tag, and denote the same language.
#####

So the function accepts input in mixed case and consistently returns lower case. Example​:

#####
$ for f in az uz sr; do echo -n $f | perl -E 'use I18N​::LangTags​::List; $g=<>;$a="$g-LATN";$u="$g-Latn";$l="$g-latn";say $a;say I18N​::LangTags​::List​::name($a);say ""; say $u;say I18N​::LangTags​::List​::name($u); say ""; say $l;say I18N​::LangTags​::List​::name($l); say "";'; done
az-LATN
Azerbaijani (Subform "latn")

az-Latn
Azerbaijani (Subform "latn")

az-latn
Azerbaijani (Subform "latn")

uz-LATN
Uzbek (Subform "latn")

uz-Latn
Uzbek (Subform "latn")

uz-latn
Uzbek (Subform "latn")

sr-LATN
Serbian (Subform "latn")

sr-Latn
Serbian (Subform "latn")

sr-latn
Serbian (Subform "latn")
#####

Would a small documentation patch improve matters?

Thank you very much.

@toddr toddr removed the khw label Oct 25, 2019
@xenu xenu removed the affects-5.26 label Nov 19, 2021
@xenu xenu removed the Severity Low label Dec 29, 2021
@jkeenan jkeenan changed the title I18N::LangTags::List name failes for az-* I18N::LangTags::List name fails for az-* Jul 1, 2022
@jkeenan
Copy link
Contributor

@jkeenan jkeenan commented Jul 1, 2022

I don't think that a case has been made for either a code change or a documentation change in dist/I18N-LangTags/lib/I18N/LangTags/List.pm.

@khwilliamson, can you comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants