Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n 显示 #2

Open
guojhq opened this issue Jun 18, 2019 · 6 comments
Open

i18n 显示 #2

guojhq opened this issue Jun 18, 2019 · 6 comments

Comments

@guojhq
Copy link

guojhq commented Jun 18, 2019

image

@jasl
Copy link
Member

jasl commented Jun 18, 2019

升级一下 gem?看现在的实现跟你截图里的不同了 https://github.com/rails-engine/audit-log/blob/master/lib/audit-log/model.rb#L31

@guojhq
Copy link
Author

guojhq commented Jun 18, 2019

@jasl 不知道是不是我自己i18n有关配置问题,我是默认的,但问题不是你说的那个位置https://github.com/rails-engine/audit-log/blob/master/lib/audit-log.rb#L50

@jasl
Copy link
Member

jasl commented Jun 18, 2019

哦,这个我一直觉得现在应该有更好的新做法了,先给你一个 workaround。

config/initializers 里建一个 locale.rb 里面一句话

I18n.backend.send(:init_translations)

这个的意思是 eager loading 翻译文件

@guojhq
Copy link
Author

guojhq commented Jun 18, 2019

OK,试了一下,initializers 放好像不起作用,放在有问题的那句上面,暂时可以走下去,谢了

@jasl
Copy link
Member

jasl commented Jun 18, 2019

嗯 或者放到 after_initialize 之类的Rails 应用的钩子去,具体我没动手测试,有空你试试吧,做法会好一些。

我觉得他这里写法或许有更好的做法,我有空研究一下

@huacnlee
Copy link
Member

可能是翻译没对上,或者你的 I18n 配置文件配置错误了,可以多检查检查。

这个东西是基于我们目前的项目实践里面提取出来的,多语言也有的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants