PHP PECL extension providing malformed results for Swedish sequence numbers

I use the built-in PECL module to localize dates and numbers in a PHP project. In all other languages ​​that I use (40), localization of ordinal numbers works fine. However, in Swedish, I get a strange result. These are apparently the template constants used to generate ordinals.

$fnf = new NumberFormatter('sv_FI', NumberFormatter::ORDINAL);
echo $fnf->format(1);

and

$snf = new NumberFormatter('sv_SE', NumberFormatter::ORDINAL);
echo $snf->format(1);

Both return 1:e%digits-ordinal-neutre:0: 1:aagainst something like 1stor 1er.

My only assumption, apart from the mistake, is that I am missing additional arguments, such as the gender of the related verb.

+3
source share
1

$fnf->getPattern():

%digits-ordinal-masculine:
    0: =#,##0==%%dord-mascabbrev=;
    -x: −>%digits-ordinal-masculine>;
%%dord-mascabbrev:
    0: :e%digits-ordinal-neutre:0: =%digits-ordinal-feminine=;
%digits-ordinal-reale:
    0: =%digits-ordinal-feminine=;
%digits-ordinal-feminine:
    0: =#,##0==%%dord-femabbrev=;
    -x: −>%digits-ordinal-feminine>;
%%dord-femabbrev:
    0: :e;
    1: :a;
    2: :a;
    3: :e;
    20: >%%dord-femabbrev>;
    100: >%%dord-femabbrev>;
%digits-ordinal:
    0: =%digits-ordinal-masculine=;

, dord-mascabbrev , :

:e%digits-ordinal-neutre:0: 1:a

1, .

PECL INTL, malformatted, ICU ( ). sv number , , .

ICU CLDR (Common Locale Data Repository) Unicode. , , CLDR, ICU, PHP INTL.

ICU ( 4.8), PECL .

+1

Source: https://habr.com/ru/post/1770809/


All Articles