支持文件类型 (Strings)

.XML - Java Properties (Strings)

文本由 Phrase Language AI 从英语机器翻译而得。

文件扩展名 

.xml

API 扩展 

properties_xml

导入 

导出 

复数形式支持 

描述支持 

Java Properties XML 是 Java Properties 文件的 XML 等价物。Java Properties 文件的键作为 XML 中 entry 元素的属性存在,而值则是嵌套在 entry 标签内的行内文本字符串。与标准 Java Properties 文件相比,XML 类型提供了更高的灵活性,因为您可以向 entry 元素添加更多属性。例如,您可以决定只有带有 class='translatable' 属性的键才会被选中进行翻译。

代码示例

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
  <entry key="boolean_key">--- true
</entry>
  <entry key="empty_string_translation"/>
  <entry key="key_with_description">看看吧!This key has a description!(在某些格式中) </entry>
  <entry key="key_with_line-break">此翻译包含
a line-break.</entry>
  <entry key="nested.deeply.key">哇,这个键嵌套得更深了。</entry>
  <entry key="nested.key">这个键嵌套在一个命名空间内。</entry>
  <entry key="null_translation"/>
  <entry one="只找到一个复数形式。" other="哇,你有 %s 个复数形式!" zero="你没有复数形式。" key="pluralized_key"/>
  <entry key="sample_collection">---
- first item
- second item
- third item
</entry>
  <entry key="simple_key">简单的键,简单的信息,如此简单。</entry>
  <entry key="unverified_key">此翻译尚未验证,正在等待验证。(在某些格式中我们也导出此状态)</entry>
</properties>
这篇文章有帮助吗?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.