develooper Front page | perl.perl5.porters | Postings from April 2018

[perl #133093] I18N::LangTags::List name failes for az-*

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
April 9, 2018 14:41
Subject:
[perl #133093] I18N::LangTags::List name failes for az-*
Message ID:
rt-4.0.24-19852-1523284857-1142.133093-15-0@perl.org
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)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133093

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About