Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101145 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31068 invoked from network); 20 Nov 2017 10:03:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2017 10:03:38 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Received: from [82.113.146.227] ([82.113.146.227:42988] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/00-31058-678A21A5 for ; Mon, 20 Nov 2017 05:03:35 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 49C2E10C88B; Mon, 20 Nov 2017 10:03:23 +0000 (GMT) Date: Mon, 20 Nov 2017 10:03:23 +0000 (GMT) X-X-Sender: derick@singlemalt.home.derickrethans.nl To: Markus Fasselt cc: PHP Developers Mailing List In-Reply-To: <27be8912-b520-d70b-e2c0-49a194ce2ceb@gmail.com> Message-ID: References: <27be8912-b520-d70b-e2c0-49a194ce2ceb@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-66161124-1511172203=:6462" Subject: Re: [PHP-DEV] Preposition in IntlDateFormatter From: derick@php.net (Derick Rethans) --8323329-66161124-1511172203=:6462 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 19 Nov 2017, Markus Fasselt wrote: > I just noticed an issue with PHP's DateFormatter and some locales. >=20 > Consider this example code: >=20 > > foreach (['en', 'de', 'da', 'pt', 'fr', 'cs'] as $locale) { > > $df =3D new IntlDateFormatter($locale, IntlDateFormatter::LONG, > > IntlDateFormatter::SHORT); > > var_dump($locale . ': ' . $df->format(new DateTime())); > > } >=20 > which will output the following: >=20 > > string(33) "en: November 19, 2017 at 10:28 PM" > > string(30) "de: 19. November 2017 um 22:28" > > string(31) "da: 19. november 2017 kl. 22.28" > > string(32) "pt: 19 de novembro de 2017 22:28" > > string(29) "fr: 19 novembre 2017 =C3=A0 22:28" > > string(28) "cs: 19. listopadu 2017 22:28" >=20 > As you can see, the first examples all have a preposition before the time= =2E But > there is none for the Czech language - there should be a "v". >=20 > Some other languages are missing their prepositions as well, e.g. pl and = se > (and probably more). >=20 > Is this a bug? I am no native speaker in these languages, but got a bug r= eport > from a user and did some research. In my opinion, the prepositions are > missing. The information used for this is not part of the PHP source or code, but=20 comes out of ICU, which uses CLDR for its localisation information. CLDR doesn't include the "v" for Cs. From=20common/main/cs.xml: {1} {0} From=20common/main/de.xml: {1} 'um' {0} CLDR can be downloaded at http://cldr.unicode.org/index/downloads, and=20 bugs can be file at http://cldr.unicode.org/index/bug-reports cheers, Derick --=20 https://derickrethans.nl | https://xdebug.org | https://dram.io Like Xdebug? Consider a donation: https://xdebug.org/donate.php twitter: @derickr and @xdebug --8323329-66161124-1511172203=:6462--