The default ./config/environment.rb file in Rails 2.2.2 has the following suggestion for setting a value for the load_path of I18n:
config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
config.i18n.default_locale = :"zh-CN"
Using this syntax causes I18n to crash while loading the locale files. Exception is:
can't convert Array into String (TypeError)
.../i18n-0.0.1/i18n/backend/simple.rb:176:in `extname'
.../i18n-0.0.1/i18n/backend/simple.rb:176:in `load_file'
.../i18n-0.0.1/i18n/backend/simple.rb:13:in `load_translations'
.../i18n-0.0.1/i18n/backend/simple.rb:13:in `each'
.../i18n-0.0.1/i18n/backend/simple.rb:13:in `load_translations'
.../i18n-0.0.1/i18n/backend/simple.rb:79:in `init_translations'
.../i18n-0.0.1/i18n/backend/simple.rb:94:in `lookup'
.../i18n-0.0.1/i18n/backend/simple.rb:33:in `translate'
.../i18n-0.0.1/i18n.rb:160:in `t'
This is caused by the call to '<<' instead of '=' or '+=', changing the suggestion to the following solves the problem:
config.i18n.load_path += Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
config.i18n.default_locale = :"en"
reference:
分享到:
相关推荐
JSON++ can also convert JSON documents into lossless XML documents. Contributors http://github.com/hjiang http://github.com/elanthis http://github.com/r-lyeh If you've made substantial ...
Even if BOOST is very powerful,it can't still meet all requirements. e.g. convert runtime data into compile period data needed by metaprogramming. /***************************************************...
Paseto.NET,.NET的 (与平台安全令牌)实现特征v1.local v1.public ... // Convert it into byte arraybyte [] privateKey = new byte [ 64 ];byte [] publicKey = new byte [ 32 ];Ed25519 . KeyPairFromSeed ( out p
图像数据库演示 该项目将图像存储为二进制文件,并从... // Convert image into a byte array try { cntDatabase . Open (); string insertQuery = @" INSERT INTO Images(Image) VALUES(@Image) " ; // @Image is a
)[+] Added new items to languages constant array[-] Example wasn‘t showing messages received in RTF format02-July-2002, Version 0.5[+] Added visible/invisible list support: look at AddContactVisible,...
link ▶Don't use an #include when a forward declaration would suffice. When you include a header file you introduce a dependency that will cause your code to be recompiled whenever the header file ...
// convert a date into a string that tells how long ago // that date was.... eg: 2 days ago, 3 minutes ago. function ago($d) { $c = getdate(); $p = array('year', 'mon', 'mday', 'hours', 'minutes', '...
Inserting into an Array Using TRUNCATE Before Adding New Data Using JSON_INSERT Using JSON_REPLACE JSON_REMOVE JSON_SET JSON_UNQUOTE The Three JSON_MERGE Functions JSON_MERGE JSON_MERGE_PRESERVE JSON_...
You can use these functions to insert a file into the active file, insert a string into the file at every specified increment, sample colors from anywhere on your screen, and more. Using Bookmarks ...
// Community length // Copy community string into pdu Array.Copy(community.getBytes(), 0, pdu, 7, community.Length); // Set object ID pdu[7 + community.Length] = 0x06; // Type pdu[8 + community....
<END><br>46,adoxml.zip Use ADO to convert database records into an XML file. All users must have MSXML.dll version 3.0, and Internet Explorer 5.5. <END><br>47,DataCntl.zip Simple application ...
be protocol agnostic, you can't overcome the limitations of the underlying protocols. If a capability isn't supported by a chosen protocol, the JavaMail API doesn't magically add the capability on ...
SELECT array_to_string(ARRAY['dfa', 'dfas', 'fds'], '?'); -- 使用 lpad 添加前导零 SELECT lpad('9', 6, '0'); ``` #### 四、PostgreSQL 特性介绍 除了以上提到的差异外,PostgreSQL 还拥有一些高级特性: 1...
can be selected to be compiled into main WPTools package. - also see FAQ: http://www.wpcubed.com/forum/viewforum.php?f=15 - and support forum: http://www.wpcubed.com/forum/ - WPTools 6 PRO and ...
User can type data into an edit box or can bring up dialog or popup window by clicking a button. TMemoryTable implements BDE in-memory table as a dataset component (with Delete operation). ...
User can type data into an edit box or can bring up dialog or popup window by clicking a button. TMemoryTable implements BDE in-memory table as a dataset component (with Delete operation). ...
You can also set the length of the returned string. Great of coming up with random passwords for your applications.<END><br>42,norepeat.zip A simple program that generates non repeating numbers ...
doesn't extract the files and the files thus can't be copied/moved. This is caused by a quirk in WinZip; Apparently WinZip doesn't like IDataObject.GetData to be called before IDropTarget.Drop is ...
BOUND Check Array Index Against Bounds BSF Bit Scan Forward BSR Bit Scan Reverse BT Bit Test BTC Bit Test and Complement BTR Bit Test and Reset BTS Bit Test and Set CALL Call Procedure CBW/CWDE ...