Questions tagged [intl]

Intl is a PHP extension which give ability to use Unicode, software internationalization (I18N) and globalization (G11N) from the ICU library.

Intl is the short description for Internationalization.

It's a PHP extension which create a wrapper for the library.

There are several modules available:

More information can be found on the PHP.net documentation.

434 questions
4
votes
2 answers

Where can I find a list of IDs or rules for the PHP transliterator (Intl)?

Transliterator::listIDs() will list IDs, but apparently it's not a complete list. In the example from this page, the ID looks like: Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower(); which is kind of weird, because…
nice ass
  • 16,471
  • 7
  • 50
  • 89
4
votes
2 answers

Get "list separator" character for any locale

Starting with only the locale identifier name (string) provided by clients, how or where do I look up the default "list separator" character for that locale? The "list separator" setting is the character many different types of applications and…
bob-the-destroyer
  • 3,164
  • 2
  • 23
  • 30
3
votes
1 answer

PHP IntlDateFormatter format returns wrong date

I'm getting incorrect results using IntlDateFormatter: $dateFormater = \IntlDateFormatter::create( 'en_EN', \IntlDateFormatter::LONG, \IntlDateFormatter::NONE ); $a = date('Y/m/d H:i:s',1332712800); //2012/03/26 00:00:00 $b =…
marcosberm
  • 33
  • 1
  • 3
3
votes
1 answer

Why does Intl.Collator sort negative numbers in descending order?

I cam across this use case and I am puzzled by it : const naturalCollator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }); const comparator = (a, b) => naturalCollator.compare(a, b); const numbers = [-1, 0, 1, 10, NaN,…
Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
3
votes
1 answer

The optional module, intl, is not installed, or has been disabled

I am seeing this message from WordPress Site Health. How do I install the missing module? The WordPress Hosting Team maintains a list of those modules, both recommended and required, in the team handbook Warning The optional module, intl, is not…
3
votes
2 answers

Flutter intl generated files, null safety problem

The current flutter version of my project is 2.2.3 and the version of my intl library is 0.17.0. When I add a new value to any of my language files, I get null safety syntax insertions in my messages_all and l10n files in my generated file. Code…
3
votes
3 answers

flutter intl 0.17.0-nullsafety.2 package initializeDateFormatting

i need some help because im going crazy. I just want to format date to my locale (should be it-IT). In flutter app i putted in pubspec.yaml the intl package with the new nullsafety feature: flutter: sdk: flutter intl: ^0.17.0-nullsafety.2…
Francesco
  • 103
  • 2
  • 7
3
votes
0 answers

Mock Intl.NumberFormat to make Jest Test independant of current culture

I am trying to write jest tests for a function, that writes a set of numbers to the clipboard. The important point is that this function should use the current language settings from the browser, i.e. for US culture settings I want a "." as decimal…
3
votes
2 answers

Convert long numbers to short and compact

I'm having a hard time finding a way to use (Compact Number Format) with NumberFormatter As a reference here's a working example with JavaScript new Intl.NumberFormat('en-GB', { notation: "compact" }).format(987654321); // → 988M new…
rock3t
  • 2,193
  • 2
  • 19
  • 24
3
votes
3 answers

Counterintuitive result in NumberFormat of Intl Package in Dart/Flutter

Why does NumberFormat(".##").format(17.46) leads to a string of 17.46 and not .46? How can I achieve the latter, i.e. remove all digits in front of the decimal sign?
Heikkisorsa
  • 740
  • 9
  • 31
3
votes
4 answers

Symfony2 with intl extension issues. I just can't seem to get the extension enabled

I've ran into problems that I knew would eventuall come in symfony2. It all boils down to needed the intl extension installed and enabled. I'm using mamp pro and have tried to follow these…
LondonGuy
  • 10,778
  • 11
  • 79
  • 151
3
votes
0 answers

In Flutter how can we translate the searchFieldLabel in the delegate of the showSearch() widget?

I have the following code to generate a showSearch() widget onTap: () { showSearch( context: context, delegate: CustomSearchDelegate(), query: '', ); }, Now in the CustomSearchDelegate I have the following code in…
Lav Shinde
  • 182
  • 2
  • 17
3
votes
1 answer

Flutter - undefined name on correctly imported packages

After migrating to my new workstation I'm getting the "undefined name '...'" error on several packages among which there is intl package with the DateFormat method. Another package giving me the same issue is strings, but I can live without it. I…
3
votes
1 answer

How to increase decimal precision on percentage format using Twig's Intl extension?

I have a decimal number with 4 digits and a scale of 4. (Max is 0.9999 and min is 0.0000) I'm using Twig and its intl extension. When I want to render a percent number, decimals are rounded. {% set decimal = 0.0850 %} {{…
Alexandre Tranchant
  • 4,426
  • 4
  • 43
  • 70
3
votes
2 answers

Currency format (by locale) in Dart

I was able to get a number in currency format with the following: final myLocale = Localizations.localeOf(context).toString(); final longNumberFormat = NumberFormat.currency(locale: myLocale, symbol: mySymbol, decimalDigits:…
Mark Watney
  • 307
  • 5
  • 13