问题标签 [intl]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - Symfony2 中的系统 (SonataAdminBundle) 中缺少请求的 PHP 扩展 intl
我尝试安装沙盒,但从 composer 收到以下错误:
使用包信息加载作曲家存储库从锁定文件安装依赖项您的需求无法解析为可安装的包集。
问题 1
问题 2
php - IntlDateFormatter::format(): datefmt_format: 采用数组或整数时间戳值或 DateTime 对象 (SonataSanBox)
我已经安装了SonataAdmin Bundle
。一切正常,但是,当我从仪表板添加任何用户时,它会引发警告:
警告:IntlDateFormatter::format(): datefmt_format: 在 C:\wamp\www\sonata-sandbox\vendor\symfony\symfony\src\Symfony\Component\Form\ 中采用数组或整数时间戳值或 DateTime 对象第 260 行的 Extension\Core\Type\DateType.php
symfony - Symfony 2.2 => symfony 2.3 错误德语语言环境
我刚刚完成了从 2.2 到 2.3.2 版本的升级。进入symfony 2.2,没有报错。当我升级到 2.3.2 版本时,我遇到了这个错误。
供您参考,第 2行(块开头上方)和第 51 行 (文件结尾)为空..
有什么帮助吗?
山姆
php - PHP intl country code 2 chars to country name
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 using webservices or external resources?
(I was using zend_locale some time ago, but zf2 does not have that functionality)
php - php 5.5.1:opcahe 和 intl 不起作用
我在 centos 5.8 上安装了 php 5.5.1,设置如下
'./configure' '--prefix=/usr/local/php' '--with-libdir=lib64' '--with-config-file-path=/etc/php/php.d' '--disable -debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--enable-gd-native-ttf' ' --with-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-openssl' '--with-pspell' '--with-zlib' '- -with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' ' --enable-wddx' '--with-kerberos' '--enable-shmop' '--enable-calendar' '--with-mysqli' '--with-apxs2' '--with-mysql' '--with-gd' '--with-jpeg-dir=/usr' '--disable-dba' '--without-unixODBC' '--enable-mbstring' '--with-pdo-mysql' '- -enable-zip' '--with-mcrypt' '--enable-soap' '--enable-opcache'
php.ini:
php 在安装过程中没有显示任何错误,但opcache和intl没有出现在 phpinfo() 的输出中(httpd 重新启动)
这里有什么问题?请帮我修复它。
php - 为什么 Windows 上的 PHP 看不到扩展 php_intl.dll,即使它存在?
我一直在尝试让 intl 扩展在我的测试工作站(PHP 5.5.1、Apache 2.2.4、Windows 7 32 位)上工作。似乎无论我尝试什么,我都无法启动并运行它。
- 我在 php.ini 中取消了“extension=php_intl.dll”行的注释。
- 我已验证 extension_dir 指令指向正确的目录 (c:\wamp\php5.5\ext)。
- 我已验证 php_intl.dll 位于 c:\wamp\php5.5\ext 中。
- 我已验证所有 icu*.dll 文件都存在于 php 根目录 (c:\wamp\php5.5) 中。
- 我已经验证 c:\wamp\php5.5 在我的 PATH 中。
- 是的,我正在编辑的 php.ini 副本是正确的,它由 httpd.conf 中的 PHPIniDir 指令指定。
我检查了 Apache 错误日志,每次重新启动 Apache 时都发现了这一行:
PHP 警告:PHP 启动:无法加载动态库 'c:\wamp\php5.5\ext\php_intl.dll' - 找不到指定的模块。\r\n 在第 0 行未知
我再说一遍,但是 c:\wamp\php5.5\ext\php_intl.dll 确实存在!
我很想尝试指向 Windows 资源管理器并对我的电脑大喊:“看!臭文件就在那儿!” 知道为什么我可以看到文件而 PHP 看不到,即使我们显然在同一个目录中查找?还是我错过了其他事情?
php - 在 XAMPP for Mac Lion 10.8 上安装 Php-intl
大家好,我正在尝试在 xampp for mac 上安装 intl 库。我已经安装了 php 5.3,所以我只是将 intl.so 文件从 php 5.3 位置复制到 Xampp bin 文件夹。之后我取消注释 extension=intl.so 并重新启动服务器。我仍然没有在 phpinfo() 中看到 intl 更新(找不到错误类区域设置)
php - 为什么 Normalizer::normalize (PHP) 不起作用?
我正在尝试将带有 'áéíóú' 之类的字符的字符串标准化为 'aeiou' 以简化搜索。
在对这个问题的回答之后,我应该使用这个Normalizer
类来做这件事。
问题是该normalize
函数什么都不做。例如,该代码:
显示:
什么是正常化必须做的?
---已编辑---
这是陌生的。从网络浏览器复制和粘贴结果时,在编辑器和原始页面中我可以看到:
在stackoverflow问题页面中我可以看到(仅在代码示例模式下):
php - NumberFormatter 货币符号(前置)
我正在使用 Intl 库来格式化带有货币符号的数字。
我的本地 php 版本:
服务器:
结果:
我的版本:234.234,23 €<br> 服务器版本:€ 234.234,23
货币符号应该在数字的末尾而不是数字的开头
谢谢
php - 使用 getCountryNames() 时的 Symfony2 Locale en_gb 问题
在我的 parameters.yml 我有这个:
在我的用户实体中,我有这个:
当我使用表单时,验证会抱怨:“国家‘美国’不是有效国家。”
所以我在:/src/Symfony/Component/Validator/Constraints/CountryValidator
并遇到:
所以我把它放在我的代码中,看看里面有什么。里面有什么,是这样的:
而不是它应该拥有的258个国家。
如果我将语言环境更改为en而不是en-gb,我会得到数组中的 258 个国家/地区。
所以,我的问题是我的 parameters.yml 是否应该是这样的?
还是这样的?这样它就可以从 en 中获取所有内容并覆盖 en-gb 所需的内容。
或者这是一个错误?(这似乎是我使用的版本中的一个错误。2.3.1,现在已在 2.3.5 中修复) - 感谢 Ritter 提供此信息。