【发布时间】:2016-03-21 19:05:30
【问题描述】:
我有一个大文件,其中包含在语言环境中指定的消息。例如:
book.registration.error.service = ..
book.registration.error.empty.book = ..
book.registration.error.file.format.book = ..
publisher.register.firstpublisher = ..
publisher.register.publisherNameUa = ..
publisher.register.nameRu = ..
publisher.register.NameEn = ..
有很多消息。要阅读它们,我使用
java.util.ResourceBundle.getBundle(messagesLocation, locale)
但有了 whis 我会阅读所有消息。有什么方法可以只读取一段消息。例如以“book”开头的只读消息?
【问题讨论】:
-
为什么这么糟糕?我想你保留那个包以备后用?
标签: java properties resourcebundle