intl

PHP intl country code 2 chars to country name

不问归期 提交于 2021-02-18 08:59:30
问题 I'm triying to convert, using PHP, 2 characters country code (ISO 3166-1) to country names, or intl country codes, so I can translate the country name. Using Locale::getDisplayRegion needs locale codes for languages ( nl_NL ) and all I have is the 2 characters country code. I don't want to rely on Webservices, but I can think on the geoip extension (I can't find a solution using it anyway) Is there any way to get the 2 chars country code and convert it to localiced country name in PHP without

Why does the JS Internationalization API for number formatting contradict German standards?

倾然丶 夕夏残阳落幕 提交于 2021-01-28 01:58:00
问题 Today I became aware of the ECMAScript Internationalisation API, as I was researching a sane way to format numbers. Thus I tested for German by calling Intl.NumberFormat("de").format(10000.23) on the console in Firefox and Chrome, which provides me with "10.000,23". However this form of number formatting is discouraged in German according to the DIN 5008 standard (and the official language reference "Duden"), which says that thin spaces (\u2009) should be used as a thousand separator. Who

Flutter internationalization - Dynamic strings

为君一笑 提交于 2020-12-04 19:47:04
问题 I'm translating my app to spanish using the intl package. locales.dart class AppLocale { ... String get folder => Intl.message("Folder", name: 'folder'); ... } messages_es.dart class MessageLookup extends MessageLookupByLibrary { get localeName => 'es'; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => <String, Function> { "folder": MessageLookupByLibrary.simpleMessage("Carpeta"), }; } I call it using the following code: AppLocale.of(context).folder

Flutter internationalization - Dynamic strings

守給你的承諾、 提交于 2020-12-04 19:36:21
问题 I'm translating my app to spanish using the intl package. locales.dart class AppLocale { ... String get folder => Intl.message("Folder", name: 'folder'); ... } messages_es.dart class MessageLookup extends MessageLookupByLibrary { get localeName => 'es'; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => <String, Function> { "folder": MessageLookupByLibrary.simpleMessage("Carpeta"), }; } I call it using the following code: AppLocale.of(context).folder

Flutter internationalization - Dynamic strings

丶灬走出姿态 提交于 2020-12-04 19:35:36
问题 I'm translating my app to spanish using the intl package. locales.dart class AppLocale { ... String get folder => Intl.message("Folder", name: 'folder'); ... } messages_es.dart class MessageLookup extends MessageLookupByLibrary { get localeName => 'es'; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => <String, Function> { "folder": MessageLookupByLibrary.simpleMessage("Carpeta"), }; } I call it using the following code: AppLocale.of(context).folder

Flutter - Converting minutes into H:M

戏子无情 提交于 2020-07-06 13:56:30
问题 I'm looking for a method to convert minutes into hours and minutes. I'm using the intl package through DateFormat but this requires both hours and minutes so it won't do. If I have 100 minutes, I would like this to be converted to 01:40 . Thanks 回答1: Does this work? String durationToString(int minutes) { var d = Duration(minutes:minutes); List<String> parts = d.toString().split(':'); return '${parts[0].padLeft(2, '0')}:${parts[1].padLeft(2, '0')}'; } print(durationToString(100)); //returns 01

PHP intl extension in Docker container

末鹿安然 提交于 2020-06-10 03:32:51
问题 I'm trying to load the intl PHP extension in my Docker container, but it doesn't seem to work. Have already tried this https://github.com/docker-library/php/issues/57 but I still get the same error message: configure: error: in `/usr/src/php/ext/intl': configure: error: C++ preprocessor "/lib/cpp" fails sanity check See `config.log' for more details My Docker file looks like this: RUN apt-get -y update \ && apt-get install -y libicu-dev\ && docker-php-ext-configure intl \ && docker-php-ext

PHP: Get Version of ICU

馋奶兔 提交于 2020-03-03 07:34:25
问题 My production site just provides the old ICU version 4.2.1. Since Yii2 requires Version 49.1 or higher I need to make workarounds in PHP. How do I get the nersion number of ICU (libicu) which is used by PHP during runtime. Since I have frequent production updates I need to get the version number dynamically in PHP code, e.g. by $libIcuVersion = ... The version number is shown in phpinfo.php but the output cannot be used in my code. 回答1: This is how Symfony/Intl does it in Symfony\Component

FLUTTER: Localization of a multi-screen app

℡╲_俬逩灬. 提交于 2020-02-29 04:23:52
问题 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 --output-dir=lib\l10n lib\main.dart command for every "page/activity/fragment" of my app? 回答1: Are you trying to implement in-app localization? i.e. just changing the app's locale without it being affected by the phone's locale? Then you can refer to this