播放框架,子文件夹中的 i18n "messages.*"

Posted

技术标签:

【中文标题】播放框架,子文件夹中的 i18n "messages.*"【英文标题】:Play framework, i18n "messages.*" in subfolders 【发布时间】:2015-11-08 11:14:40 【问题描述】:

我想将conf/messages 放入子文件夹,例如conf/lang/messages。文档中对此一无所知:https://www.playframework.com/documentation/2.4.x/JavaI18N。

有人解决了这个问题吗?

【问题讨论】:

【参考方案1】:

这个Messages.scala source code有个线索:

protected val messagesPrefix =
  config.getDeprecated[Option[String]]("play.i18n.path", "messages.path")

我还没有在 2.4 中尝试过,但看起来值得一试。

【讨论】:

【参考方案2】:

可以在application.conf中指定子目录,添加:

play.i18n.path = "lang"

这样做会告诉 Play 从 conf/lang 读取消息文件。

【讨论】:

以上是关于播放框架,子文件夹中的 i18n "messages.*"的主要内容,如果未能解决你的问题,请参考以下文章

如何通过 J2ME 中的扬声器播放音频

使用 Scala 播放 Framework 2.4.0 和 I18n

在 URL 概念中播放框架 2 语言代码?

J2me 应用程序在多个时间文件播放时出现内存不足异常

播放文件 wav j2me - Manager.createPlayer() 处的 IllegalArgumentException

Vue 单元测试 - 子组件和 i18n