alaz/scala-i18n

If no messages.txt file found, the `Messages.apply` will be blocking forever

Closed this issue · 1 comments

If I run the sample code below without having any messages.txt file exists in the classpath, the Messages("greet") will keep blocking forever:

implicit val userLang = Lang("en")
val msg = Messages("greet")  // blocking here
println("msg = " + msg)

I expect if it can't find any messages.txt file, it should throw exception.


Also, a bit suggestion, it will be great if you can add getOrElse method for the Messages, e.g.

val msg = Messages.getOrElse("greet", "")

So in case of the "greet" key is not found, I will get the default value rather than an exception.

alaz commented

@s101d1 thank you for the bug report.

Regarding Messaging.getOrElse, can you please file a separate issue.