RESW/RESX

The RESW and RESX formats are the standards for localizing C# and .NET applications. RESW was introduced with Windows 8 for Windows Store applications. While these two file types use different extensions (.resw and .resx), their internal XML structure is identical.

Format

  • The format is based on XML; standard XML rules for encoding, escaping, and quoting apply.
  • LingoHub ignores any XSD schema present in the file.
  • The name attribute of the <data> element defines the segment key.
  • Each name attribute must be unique within a LingoHub project.
  • The content of the <value> element defines the segment text.
  • XML comments are parsed and assigned as descriptions to the subsequent segment.
  • Supported placeholder examples include {name} and {0}.
  • If the attribute xml:space="preserve" is specified, LingoHub preserves the exact content of the <value> node without stripping whitespace.

LingoHints can be included in a comment:

<data name="auth_failed" xml:space="preserve">
    <value>Authentifikation fehlgeschlagen</value>
    <comment><lh>{"status": "DRAFT","qc": {"min": "3","max": "20"},"labels": ["q3-2024"],"not_translatable": false}</lh></comment>
 </data>

Example

Additional example files are available on GitHub for both RESX and RESW.

<?xml version="1.0" encoding="utf-8"?>
<root>
  <data name="auth_failed" xml:space="preserve">
    <value>Authentifikation fehlgeschlagen</value>
    <comment>This comment is assigned as a description to the "auth_failed" segment.</comment>
  </data>
  <data name="billable" xml:space="preserve">
    <value>Verrechenbar</value>
  </data>
  <data name="break_time" xml:space="preserve">
    <value>Pausen</value>
  </data>
  <data name="title">
    <value>Titel</value>
  </data>
  <data name="salutation" xml:space="preserve">
    <value>Hallo {0}</value>
  </data>
</root>

References