从 Java 类中提取字符串

发布于 2024-10-01 13:17:35 字数 90 浏览 0 评论 0原文

我想提取数百个java类中的所有字符串(文本,用“”编写),将它们交给翻译器进行多语言平台翻译。

有人知道我该怎么做吗?有什么特别的免费程序或方法吗?

I want to extract all Strings (texts, written in " ") in hundreds of java classes, to get them to a translator for a multilanguage platform translation.

Does somebody have an idea how I could do this? Any special free program or method?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

风柔一江水 2024-10-08 13:17:35

Eclipse 具有“外部化字符串”功能,可以创建一个或多个类中所有字符串的属性文件。其他 IDE 可能也有类似的功能。

Eclipse has an "Externalize Strings" feature that creates a properties file of all of the strings within a class or classes. Other IDEs may have a similar feature.

兔小萌 2024-10-08 13:17:35

如果您使用 Eclipse 作为 IDE,则只需选择您的项目并从上下文菜单中选择 Source/Externalise Strings 即可。

If you use eclipse as your IDE, this is as simple as selecting your project and from the context menu select Source / Externalise Strings.

眼藏柔 2024-10-08 13:17:35

您可以编写一个程序来使用正则表达式来捕获字符串中包含的任何组。

You could write a program to use regular expressions to capture any groups encased in strings.

浅浅淡淡 2024-10-08 13:17:35

如果您有源代码,请使用 Dave 提到的 Eclipse 的外部化字符串功能。

如果您只有类文件,请使用 GNU 字符串工具,该工具可以查找二进制文件中的任何字符串序列。

http://sourceware.org/binutils/docs/binutils/strings.html

If you have the source code, use Eclipse's externalize strings feature that Dave mentioned.

If you only have the class files, use the GNU strings tool, which finds any string sequences inside a binary file.

http://sourceware.org/binutils/docs/binutils/strings.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文