diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 8783e55..c716add 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -41,6 +41,9 @@ user: # 单数复数 one: "用户" other: "用户" + panda/user: + one: '用户' + other: '用户' comment: one: "评论" other: "评论" @@ -112,7 +115,7 @@ country: '国家' id_card: '身份证号码' phone_number: '电话号码' - user: + user: &user <<: *common id: '编号' name: '姓名' @@ -148,6 +151,8 @@ apps: '申请' invitation_code: '邀请码' whitelisted_jwts: 'jwt白名单' + panda/user: + <<: *user moment: <<: *common location: '位置坐标' diff --git a/lib/panda/engine.rb b/lib/panda/engine.rb index 02c2525..617cb08 100644 --- a/lib/panda/engine.rb +++ b/lib/panda/engine.rb @@ -23,5 +23,11 @@ class Engine < ::Rails::Engine end end end + + # 加载本地化文件 + config.before_initialize do + config.i18n.load_path += Dir["#{config.root}/config/locales/**/*.yml"] + end + end end