My favorites | Sign in
Project Logo
                
Search
for
Updated Aug 26, 2007 by caoweiyuan
Labels: Featured
ActiveScaffoldSupport  
Now support active_scaffold localization & model/controller generating

Introduction

l10n_scaffold was inherited from various of tools to support Rails Localization. Besides latin language l10n features which was inherited from its parents, l10n_scaffold focuses on Easten-Asian language l10n and localized scaffold generations.

Now it begins to support active_scaffold localization, defaultly in Simplified-Chinese, and easily switch to other languages. It also contains generators to generate localized models and controllers in with active_scaffold customs and callback functions, make sure to have active_scaffold installed before running generated codes.

Active_scaffold Localization

Translated active_scaffold displays to your language, as well as dates, times, distance of times. It also localized numbers, currencies and arrays, which originally supported by l10n-scaffold.

Generators

  1. as_model
  2.   script/generate as_model ModelName attributes
      e.g. script/generate as_model product name:string price:decimal quantity:integer
  3. as_controller
  4.   script/generate as_controller ControllerName
      e.g. script/generate as_controller products
  5. after generating models and controllers, u have to translate in model file
  6.   # human names
      ModelName = "产品"
      ColumnNames = {
        :name => "产品名称",
        :price => "价格",
        :quantity => "数量"
      }
  7. go

After these steps, active_scaffold will automatically show scaffold of the model in your language. In the meanwhile, validation error messages are also localized.


Sign in to add a comment
Hosted by Google Code