Introductionl10n_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 LocalizationTranslated 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- as_model
script/generate as_model ModelName attributes
e.g. script/generate as_model product name:string price:decimal quantity:integer - as_controller
script/generate as_controller ControllerName
e.g. script/generate as_controller products - after generating models and controllers, u have to translate in model file
# human names
ModelName = "产品"
ColumnNames = {
:name => "产品名称",
:price => "价格",
:quantity => "数量"
}- 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.
|