用于播放的SecureSocial插件:消息(i18n)(SecureSocial Plugin for Play: Messages (i18n))

编程入门 行业动态 更新时间:2024-10-19 17:43:29
用于播放的SecureSocial插件:消息(i18n)(SecureSocial Plugin for Play: Messages (i18n))

我创建了一个视图子包,以自定义securesocial模板的默认外观。 (我以https://github.com/ngarera/securesocial-custom-views-sample为例,基本上复制了相关文件)

我的/ conf文件夹中有两个i18n文件(messages.en,messages.de)。 查看主页确认messages.en已正确使用。

但是,当调用/ login(并因此显示自定义模板)时,没有正确查找messages-key - 而是仅显示密钥本身(例如“auth.login”),而实际上它应显示“Login”。

我在Stackoverflow( 如何更改SecureSocial中的文本 )中看到了类似的请求,其中声明删除.en文件扩展名。 这样做会显示正确的消息......但创建一个消息文件并不是国际化的重点......

我已经确认我的浏览器发送了正确的语言( http://www.mybrowserinfo.com/detail.asp?bhcp=1 )所以messages.de应该可以工作......(当我打开一个自制的控制器时它会这样做 - 只有custom-securesocial-view无效...)

有没有人有类似的问题? 为什么本地化适用于securesocial的消息?

问候,大卫

PS:使用Play 2.1.3,Java

I have created a subpackage of views in order to customize the default look of securesocial's templates. (I have used https://github.com/ngarera/securesocial-custom-views-sample as an example and basically copied the relevant files)

There are two i18n-files (messages.en, messages.de) in my /conf folder. Viewing the main page confirms that the messages.en is correctly used.

However, when calling /login (and therefore displaying the custom template), no messages-key is correctly looked up - instead only the key itself (e.g. "auth.login") is displayed, when really it should show "Login".

I have seen a similar request at Stackoverflow (How to change text in SecureSocial) where it was stated to remove the .en file extension. Doing that will show the correct Message...but creating one messages file is not really the point of internationalization...

I have confirmed that my browser sends the correct language (http://www.mybrowserinfo.com/detail.asp?bhcp=1) so messages.de should work...(which it does when I open a self-made controller - only the custom-securesocial-view is not working...)

Does anybody have similar problems? And why does the localization work for securesocial's messages?

Regards, David

PS: using Play 2.1.3, Java

最满意答案

SecureSocial代码中存在一些阻止i18n正常工作的问题。

这已得到修复,目前在master-SNAPSHOT版本中可用,因为尚未发布包含这些更改的稳定版本。

There were some issues in the SecureSocial code that prevented i18n from working properly.

This has been fixed and is currently available in the master-SNAPSHOT version because a stable version with those changes has not been released yet.

更多推荐

本文发布于:2023-07-31 02:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340506.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:插件   消息   SecureSocial   i18n   Messages

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!