Skip to content

Commit

Permalink
load localization file.
Browse files Browse the repository at this point in the history
  • Loading branch information
younthu committed Dec 26, 2022
1 parent b978f7b commit 57f0f70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
user: # 单数复数
one: "用户"
other: "用户"
panda/user:
one: '用户'
other: '用户'
comment:
one: "评论"
other: "评论"
Expand Down Expand Up @@ -112,7 +115,7 @@
country: '国家'
id_card: '身份证号码'
phone_number: '电话号码'
user:
user: &user
<<: *common
id: '编号'
name: '姓名'
Expand Down Expand Up @@ -148,6 +151,8 @@
apps: '申请'
invitation_code: '邀请码'
whitelisted_jwts: 'jwt白名单'
panda/user:
<<: *user
moment:
<<: *common
location: '位置坐标'
Expand Down
6 changes: 6 additions & 0 deletions lib/panda/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 57f0f70

Please sign in to comment.