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
2
votes
3 answers

PHP Intl functions does not work for some countries

Trying to get the language name from the language code, I run function test($local, $fallback) { $bundle = \ResourceBundle::create($local, 'ICUDATA-lang', $fallback); if ($bundle === null) { return "$local bundle not found"; } …
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
2
votes
0 answers

How to install INTL into Php 5.5.9 using PHPBREW

I'm working on some legacy code using PHP 5.5.9. Which uses intl. I installed php 5.5.9 with PhpBrew on my mac machine running: phpbrew install --mirror=https://www.php.net php-5.5.9 +default +mysql +pdo +openssl=/usr/local/opt/openssl…
Rubberduck1337106092
  • 1,294
  • 5
  • 21
  • 38
2
votes
3 answers

Return correct currency for Intl.NumberFormat Romanian lei

I'm trying to format a number and display it as price in Romanian lei. This is my snippet: console.log(Intl.NumberFormat('ro-RO', { style: 'currency', currency: 'RON', currencyDisplay: 'symbol', }).format(123)); I am expecting it…
proko
  • 175
  • 2
  • 11
2
votes
1 answer

IntlDateFormatter does not return specific non-location TimeZone format (z)

My app suddenly started to display a wrong timeZone format. I always had '12/11/2018 3:55 AM AEST' as the output but now it returns '12/11/2018 3:55 AM GMT+11'. The code: $formatter = new IntlDateFormatter('en-US', IntlDateFormatter::NONE,…
Pavel Bariev
  • 2,546
  • 1
  • 18
  • 21
2
votes
3 answers

FLUTTER: Localization of a multi-screen app

i'm creating a multi screen app on android using Flutter. I'm using intl to localize it, but i don't understand how to procede to create the arb file. Should i run the following commaand flutter pub pub run intl_translation:extract_to_arb…
DCanalia
  • 21
  • 1
  • 2
2
votes
1 answer

Intl.DateTimeFormat does not output separators on 2 digit month + day (IE 11)

I have encountered a bug in Intl.DateTimeFormat MDN Environment Internet Explorer 11.0.6900.19080 on Windows 7 Bug When only the "2-digit" option is used for month + day the function is not outputting any separators, be it / for en or . for de. This…
Marvin Fischer
  • 2,552
  • 3
  • 23
  • 34
2
votes
1 answer

Generating JSON translation files

my main problem which I am trying to solve is to generate JSON files from React source code. currently I am using for translations react-intl universal package which is working in my App https://github.com/alibaba/react-intl-universal To solve my…
Bobek
  • 757
  • 3
  • 7
  • 15
2
votes
1 answer

Get currency code based on symbol

I am currently working with an API where instead of floats or integers for currency I receive strings like these. $2.49 £2.49 €2.49 etc. The issue with that is that I need to store the value and currency separately but the currency needs to be…
Chris Mayer
  • 187
  • 3
  • 10
2
votes
0 answers

CMake does not find library even with hint

My build fails with the following message ld: library not found for -lintl From what I understand it's talking about libintl.a in the following directory: I tried doing the following in my cmake file to no avail: cmake_minimum_required(VERSION…
jeanluc
  • 1,608
  • 1
  • 14
  • 28
2
votes
1 answer

PHP-Intl acts different for PHP V7.0.20

I have the following code: $lang="de-AT"; $currency="3333"; $formatter = new NumberFormatter($lang, NumberFormatter::DECIMAL); $formatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 2); echo $formatter->format($currency); can be run in…
Edwin
  • 2,146
  • 20
  • 26
2
votes
4 answers

Installing/enabling PHP Pecl Intl extension on a default Mac OS X Leopard bundled PHP configuration

How can I install or enable the PHP Pecl Intl extension in my PHP environment? I've got a stock PHP configuration that came bundled with Mac OS X Snow Leopard. Installing libicu from source and than $pecl install intl results in the following…
Marijn Huizendveld
  • 791
  • 2
  • 7
  • 23
2
votes
1 answer

Change decimalseparator for a specific Language

In Russian language there is no fixed definition for the decimal separator character (GOST 8.417-2002 and GOST 2.004-88 - Russian state standards). The , (comma) is recommended but . (point) is possible. The intl Extension in php defines the ,…
Jürgen
  • 23
  • 6
2
votes
3 answers

PHP intl can convert a Gregorian date to other calendar type

PHP intl can convert a Gregorian date to other calendar type. For example Gregorian to Hijri, 2017/04/11 to 1396/01/22 Or we must use external library to convert dates?
msoa
  • 1,339
  • 3
  • 14
  • 33
2
votes
2 answers

Get currency ISO 4217 code based on locale

Say, if I parse HTTP Accept-Language header with Locale::acceptFromHttp is there an easy and reliable way to get user's preferred currency based on this locale identifier? Like "USD" for "en-US". I wish there was a way to do this with PHP intl…
Sim
  • 2,627
  • 1
  • 20
  • 21
2
votes
2 answers

How to print date using numeric numbers for arabic locales

I am using Intl package and try to format dates per locales. For ar-AE example, it formats date using arabic characters but I want to print it using numeric value. ops = { month: 'long', day : 'numeric', year : 'numeric' …
codereviewanskquestions
  • 13,460
  • 29
  • 98
  • 167