Skip to main content
.NET resources (.resx)
Nick Ustinov avatar
Written by Nick Ustinov
Updated over 3 months ago

.NET resource files (.resx) are used to store resources for .NET applications, including strings, images, and other objects. These files are XML-based and provide a structured way to manage localization data within .NET projects.

Technical information

Overview

Format name:
.NET Resources

File extensions:
.resx

Common use cases:
Managing and organizing localization strings and other resources in .NET applications.

Technical details:

  • Structure: .resx files consist of XML entries that specify objects and strings inside XML tags. Each entry typically includes a key, value, and optional metadata such as comments.

  • Encoding: UTF-8

Example:
Here's an example of a typical .resx file used for localization:

<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="welcomeMessage" xml:space="preserve">
<value>Welcome to Lokalise!</value>
</data>
<data name="farewellMessage" xml:space="preserve">
<value>Goodbye and see you soon!</value>
<comment>This message is shown when the user logs out</comment>
</data>
</root>

In this example, the .resx file includes two data entries: welcomeMessage and farewellMessage, each with a value and an optional comment.

Find more examples in our ASP.NET Core localization blog post.

Using with Lokalise

Lokalise supports .NET resource files, allowing you to manage and translate your application resources efficiently.

Supported project types

Please note that RESX files can be uploaded only to Web and mobile projects.

Known limitations and special notes

Base language and file downloads

When you download translations in the .resx format from Lokalise, the filename might look different for the base language. Normally, filenames include a language code, such as test.%LANG_ISO%.resx. For instance, for Spanish, the file would be named test.es.resx. However, for the base language, which could be English, the filename will simply be test.resx.

This omission of the language code for the base language helps with fallback functionality. If a specific language file, like test.es.resx, isn't available, the system will use the test.resx file instead. This ensures that there is always a default language file to fall back on.

Did this answer your question?