php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63515 Getting supported locales problem
Submitted: 2012-11-14 12:57 UTC Modified: 2021-06-27 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ckunep at fromru dot com Assigned: cmb (profile)
Status: No Feedback Package: intl (PECL)
PHP Version: 5.4.8 OS: Windows 7 Pro x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
46 + 17 = ?
Subscribe to this entry?

 
 [2012-11-14 12:57 UTC] ckunep at fromru dot com
Description:
------------
I tried to resolve a list of available locales in the "locales" folder. But get nothing.

$_SERVER['SCRIPT_FILENAME'] == D:\www\german\htdocs\index.php.

Folder structure:
D:\www\german\htdocs\locales\en.txt
D:\www\german\htdocs\locales\en.res
D:\www\german\htdocs\locales\en_US.txt
D:\www\german\htdocs\locales\en_US.res
D:\www\german\htdocs\locales\root.txt
D:\www\german\htdocs\locales\root.res

RES-files generated by ICU's genrb.exe.

Test script:
---------------
$directory = dirname($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPATATOR . 'locales';
print_r(resourcebundle_locales($directory));

Expected result:
----------------
Array
{
    [0] => "en"
    [1] => "en_US"
    [2] => "root"
}

Actual result:
--------------
nothing

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-14 13:47 UTC] ckunep at fromru dot com
Also I noticed that resourcebundle_locales() returns FALSE. I try to use resourcebundle_locales() to get locales list from package generated by ICU's pkgdata.exe, but it fails too.

Code:

is_file('D:\www\german\htdocs\locales\package.dat') == true;
print_r(resourcebundle_locales('D:\www\german\htdocs\locales\package'));

After script execution the "package.dat" file is locked on. I managed to delete the file only with the help of Unlocker.
 [2016-09-29 11:22 UTC] cmb@php.net
-Package: I18N and L10N related +Package: intl
 [2021-06-14 14:14 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-14 14:14 UTC] cmb@php.net
> print_r(resourcebundle_locales($directory));

resourcebundle_locales() expects a file path, not a directory path.

> I try to use resourcebundle_locales() to get locales list from
> package generated by ICU's pkgdata.exe, but it fails too.

How exactly did you produce the "package"?  Did the PHP script
hang while reading the file?
 [2021-06-27 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 18:01:30 2024 UTC