We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
你知道,这个非常不典型,我怀疑任何框架都会包含它,因为它需要分析代码并确定哪些调用是对资源包的,哪些可以是作为参数传递的动态字符串等。
通常使用专用编辑器来编辑包, fg ResourceBundle Eclipse 插件,您可以在其中同时编辑原始版本和翻译版本,并且您会看到所有翻译版本中未出现的每个键的警告。
You know, this one is quite untypical and I doubt any framework would include it, since it requires analysing code and determining, which calls are to resource bundle, which can be dynamic strings passed as arguments etc.
Normally the bundles are edited using dedicated editor, f.g. ResourceBundle plugin for Eclipse, in which you edit original and translation simultanously, and you see warnings for each key not present in all translations.
我也遇到了同样的问题并开始开发新的解决方案。我刚刚 发布 今天在我的博客中。它只是使用 Java 注释处理器工具来创建(或更新)属性文件和密钥。正如帖子中所述,它也是可扩展的。它可以在我的 GitHub 项目中找到(您必须从我的博客中找到该链接,因为我不能发布超过 2 个链接)。
请随意使用它并询问您需要的任何内容。
我还发现 此解决方案(尚未尝试过),听起来很有希望!
希望有帮助!
I've also faced those same issues and started developing a new solution. I just posted it today in my blog. It just uses the Java annotation processor tool to create (or just update) properties files and keys. It is also extensible, as described in the post. And it is available in my GitHub project (you will have to find the link from my blog, as I cannot post more than 2 links).
Feel free to use it and ask whatever you need.
I have also found this solution (haven't tried it yet), and it sounds promising!
Hope it helps!
为此,我实现了 消息编译器,它创建资源包文件和常量定义为
Java enum
用于单个源文件中的键。所以可以在Java源代码
中使用常量,这是一种更安全的方式。消息编译器不能仅用于Java
。它还为 Objective-C 或 Swift 创建资源文件和常量,并且可以扩展到其他编程环境。I implemented the Message Compiler for this purpose, which creates the resource bundle files and constant definitions as
Java enum
for the keys from one single source file. So the constants can be used in theJava source code
, which is a much safer way. The message compiler cannot only be used forJava
. It creates also resource files and constants forObjective-C or Swift
and can be extended for other Programming environments.