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

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

Thread Next
From:
Martin Barth
Date:
April 11, 2018 03:51
Subject:
Re: [perl #133093] I18N::LangTags::List name failes for az-*
Message ID:
3d0b7f0c-8238-3225-e3ed-1373084b2d9f@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.
>


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