Arquivos de recursos .NET (RESX, RESW)

Um arquivo de recursos XML .NET emprega um formato de arquivo XML monolíngue usado em aplicativos Microsoft .NET.

Ele pode usar o complemento .resx ou .resw. Apesar na diferença do complemento de arquivo, o formato de arquivo .resw é idêntico ao formato de arquivo .resx, exceto que os arquivos .resw podem conter apenas textos e caminhos de arquivo.

Exemplo de arquivo:

<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Hello" xml:space="preserve" weblate-flags="c-format, max-length:100">
<value>Hello, world!</value>
</data>
<data name="Orangutan" xml:space="preserve">
<value>Orangutan has %d banana.</value>
</data>
<data name="Try" xml:space="preserve">
<value>Try Weblate at https://demo.weblate.org/!</value>
</data>
<data name="Thanks" xml:space="preserve">
<value>Thank you for using Weblate.</value>
</data>
</root>
Recursos suportados

File extensions

.resx

Linguality

Monolingual

Supports plural

No

Supports descriptions

Yes

Supports explanation

No

Supports context

No

Supports location

No

Supports flags

Yes

API identifier

resx

Supports read-only strings

No

Configuração do Weblate

Configuração de componente típica do Weblate

Máscara do arquivo

Resources/Language.*.resx

Arquivo de idioma da base monolíngue

Resources/Language.resx

Modelo para novas traduções

Vazio

Formato de arquivo

Arquivo de recurso .NET