simplyi Posted August 30, 2010 Share Posted August 30, 2010 Hi! I need help understanding how to access resource files using ResourceBundle Class and what should be ResourceBundle file format. I have an example of usage in the form of: $r = ResourceBundle::create( 'en', $fileName); but what is the correct format of Resource file? Can it be a format of property file in the form of key=value key=value? or can it be a .txt file of format?: root:table { myName:string { "Here goes my name" } } Can someone share a very simple example of ready to use Resource file with a plain text in it? Thank you! Quote Link to comment Share on other sites More sharing options...
trq Posted August 30, 2010 Share Posted August 30, 2010 ResourceBundle isn't any standard php class, what framework / library are you trying to use? Is it installed? Quote Link to comment Share on other sites More sharing options...
simplyi Posted August 30, 2010 Author Share Posted August 30, 2010 thorpe, thank you very much for your reply. I am using PHP5.3.1 intl package. I learned that this package was moved to php.net from PEAR. Here is a link to ResourceBundle class: http://ca2.php.net/manual/en/class.resourcebundle.php And here is a link to example of usage: http://ca2.php.net/manual/en/resourcebundle.get.php thorpe, do you have experience using this class? can you advise how to create a Resouce file and the access it using ResourceBundle class? Thank you! Quote Link to comment Share on other sites More sharing options...
trq Posted August 30, 2010 Share Posted August 30, 2010 It is a PECL extension. See http://ca2.php.net/manual/en/intl.installation.php (will move this thread back to PHP Help). And no, Ive never used/heard of it, sorry. Quote Link to comment Share on other sites More sharing options...
simplyi Posted August 31, 2010 Author Share Posted August 31, 2010 thorpe, thank you for moving back my question! The intl package is working for me 50%. I have uncommented php_intl.dll in php.ini extension=php_intl.dll and I can work with Locale class no problem. But when I execute $r = ResourceBundle::create( 'en', $filename); then I get an error message: Fatal error: Class 'ResourceBundle' not found. Both classes Locale and ResourceBundle are in one package "intl". Why is it that Locale class is found and ResourceBundle class cannot be found??? Can someone advise me? Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.