Created by: jhang-jhe-wei
Field::HasMany i18n
How to Use?
If you have ActiveRecord i18n translation of the model you don't need to do anything extra, if not, make an ActiveRecord i18n translation of the model.
Example
The recipe has many recipe items.
app/dashboards/recipe_dashboard.rb
ATTRIBUTE_TYPES = {
recipe_items: Field::HasMany,
id: Field::Number,
name: Field::String,
package_spec: Field::String,
remark: Field::String,
created_at: Field::DateTime,
updated_at: Field::DateTime,
}.freeze
zh-TW.yml
zh-TW:
activerecord:
models:
recipe: 配方表
recipe_item: 材料
Result
材料種類
is defined in helper.label.recipe.recipe_items, it's not the same, don't confuse.