支持文件类型 (Strings)

.RESX - Microsoft .NET (Strings)

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

文件扩展名

.resx, .resw

API 扩展

resx

导入

导出

复数形式支持

描述支持

.NET 是一个主要用于 Microsoft Windows 的开源软件开发框架。使用 .NET 框架开发的应用程序的本地化主要与资源文件 (.resx) 一起工作。

.resx 文件是基于 XML 的,根元素为 <root>。可本地化字符串通常嵌入在 <value> 元素中,这些元素嵌套在 <data> 下。 <value> 元素也可能出现在 <resheader> 中,但这些通常是元数据,不用于翻译。

代码示例

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
    <xsd:element name="data">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string"/>
        <xsd:attribute name="type" type="xsd:string"/>
        <xsd:attribute name="mimetype" type="xsd:string"/>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="boolean_key">
    <value>--- true
</value>
  </data>
  <data name="empty_string_translation">
    <value/>
  </data>
  <data name="key_with_description">
    <value>现在这是一个描述!(至少对于某些格式)</value>
    <comment>这是这个键的绝妙描述!</comment>
  </data>
  <data name="key_with_line-break">
    <value>这个翻译包含
a line-break.</value>
  </data>
  <data name="nested.deeply.key">
    <value>我是一个深度嵌套的键。</value>
  </data>
  <data name="nested.key">
    <value>这个键嵌套在一个命名空间中。</value>
  </data>
  <data name="null_translation">
    <value/>
  </data>
  <data name="pluralized_key">
    <value>这可能是复数形式。</value>
  </data>
  <data name="sample_collection">
    <value>---
- first item
- second item
- third item
</value>
  </data>
  <data name="simple_key">
    <value>简单的键,简单的信息,一切都如此简单。</value>
  </data>
  <data name="unverified_key">
    <value>此翻译尚未验证,正在等待验证。</value><value>(在某些格式中,我们也导出此状态)</value>
  </data>
</root>
这篇文章有帮助吗?

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.