支持文件类型 (Strings)

.RESX - Microsoft .NET (Strings)

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

文件扩展名

.resx, .resw

API 扩展

resx

导入

导出

复数形式支持

描述支持

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

.resx 文件基于 XML,其根元素为 <root>。可本地化的 Strings 通常嵌入在 <data> 下嵌套的 <value> 元素中。<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>(至少对于某些格式而言)</value>
    <comment>这是此键的绝佳描述!</comment>
  </data>
  <data name="key_with_line-break">
    <value>此翻译包含
一个换行符。</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>
  </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.