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
3
votes
1 answer

PHP Intl library and human readable time span

I'm using PHP Intl library to format dates, numbers and so on. Now I have to show a time span in human readable string, for example: 1day, 1hour, 10 minutes, 14s or in compact way: 1d 1s 10m 14s or in supercompact way: 1d 1.10:14 Is there any…
Tobia
  • 9,165
  • 28
  • 114
  • 219
3
votes
2 answers

Update ICU extension within xampp?

I'm running xampp and I need to upgrade ICU (php_intl extension) to the latest version - I downloaded 54 from the ICU page but unsure how to go about upgrading it. There is a bin, include and lib folder - where do I put these files and do I have to…
Brett
  • 19,449
  • 54
  • 157
  • 290
3
votes
2 answers

PHP with IntlDateFormatter

There's a script: for($i=80; $i<=89; $i++) { $date = '01.04.19'.$i; $intlDateFormatter = new \IntlDateFormatter('ru', 2, -1, 'Europe/Moscow', 1, 'dd.MM.yyyy'); $intlDateFormatter->setLenient(false); $timestamp =…
Alex
  • 311
  • 2
  • 14
3
votes
0 answers

Why is the PHP localeconv() returning an empty array on Windows 7?

So, localeconv() seems to be ignoring the locale in my php script, and returns a basically empty array. I've found numerous questions, etc. the answers to which all boiled down to the locale not being set correctly for Windows. I believe this…
3
votes
2 answers

Manipulate the list of countries provided by Symfony Intl and the form choice type

Politics aside, I need to provide Kosovo as a form choice when selecting a country. What's the most elegant way of doing this with Symfony's built-in form choice type country, while also providing translations for the Kosovo name? Here's what I've…
Adam Elsodaney
  • 7,722
  • 6
  • 39
  • 65
3
votes
1 answer

NumberFormatter::formatCurrency() ignores MIN_FRACTION_DIGITS

I want to use PHP's Intl's NumberFormatter class to display prices in a human-readable format. What our project needs: The CLDR number pattern, and the currency and separator symbols will need to be configured through our code and not default to…
Xano
  • 131
  • 3
3
votes
2 answers

install php intl extension on mountain lion

I'm trying to install rubedo cms, and get an error in the php application: Zend\I18n\Validator component requires the intl PHP extension These are the steps I've taken to install the extension sudo port install php5-intl sudo cp…
xanld
  • 977
  • 1
  • 11
  • 22
3
votes
1 answer

PHP IntlDateFormatter->format() returns false

This code works perfectly on my development server, but when I run it on another server, it fails: $formatter = new IntlDateFormatter('en-GB', IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/London'); var_dump($formatter->format(new…
Jack Sleight
  • 17,010
  • 6
  • 41
  • 55
3
votes
1 answer

Using intltool with cmake

I'm writing a GNOME application and use CMake. Now I'm considering making the app translatable, for which GNU provides intltool, gettext, msgfmt, etc.. autotools supports these tools and the entire i18n process out of the box. How do I get this to…
Fabian Schuiki
  • 1,268
  • 7
  • 18
2
votes
2 answers

Named arguments for INTL MessageFormatter with PHP

I would like to use named arguments in a string passed to MessageFormater, like that $fmt = new MessageFormatter("en_US", "My name id {my_name}"); $fmt->format(array('my_name' => 'John')); When I running this code, I obtain the error message…
Tristan
  • 41
  • 4
2
votes
1 answer

How to add support for custom languages in Flutter using the 'intl' package?

I am developing a Flutter app and want to add support in my application for regional languages of India like Hindi, Gujarati, Tamil, etc. I am using the intl package (version 0.18.0) for internationalization and localization. Could anyone provide…
ankushlokhande
  • 870
  • 5
  • 20
2
votes
1 answer

Flutter - firebase_auth_web 5.4.0 depends on intl ^0.17.0 but I must use higher version (intl ^0.18.0)

Flutter Dependencies error: Because firebase_auth_web 5.4.0 depends on intl ^0.17.0 and no versions of firebase_auth_web match >5.4.0 <6.0.0, firebase_auth_web ^5.4.0 requires intl ^0.17.0. So, because ventus depends on both intl ^0.18.0 and…
TomasF
  • 23
  • 3
2
votes
2 answers

php IntlDateFormatter not working in my docker container

I want to display the date and more precisely the names of the months according to the locale of the country, but for some reason the class IntlDateFormatt for the name of the month returns the record M05, which I understand as the month and its…
UKRman
  • 404
  • 3
  • 16
2
votes
2 answers

How to filter DateTime(intl) in flutter?

I have list of data and I want to filter them from earliest to lates The list with data looks like this: [{id: 73, startTime: 2022-12-13T15:30:57.244Z}, {id: 74, startTime: 2022-12-13T10:00:57.244Z}]; And the output should look like this: [{id: 74,…
newbie2210
  • 223
  • 8
2
votes
3 answers

how to use intl flutter without context?

I'm trying to use the intl plugin to get more translations of my app, but it always needs a context. In files without context where I simply have to assign a value to the variable what should I do? For example I would like to do something like…
Jonathan
  • 106
  • 1
  • 8