FreeRealmsLocaleTools 1.0.0

dotnet add package FreeRealmsLocaleTools --version 1.0.0
                    
NuGet\Install-Package FreeRealmsLocaleTools -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FreeRealmsLocaleTools" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FreeRealmsLocaleTools" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FreeRealmsLocaleTools" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FreeRealmsLocaleTools --version 1.0.0
                    
#r "nuget: FreeRealmsLocaleTools, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FreeRealmsLocaleTools@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FreeRealmsLocaleTools&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FreeRealmsLocaleTools&version=1.0.0
                    
Install as a Cake Tool

FreeRealmsLocaleTools

A .NET library which allows developers to read and write text entries from Free Realms locale files. It also includes other utilities such as acquiring the name IDs of text entries and modifying locale metadata.

Background

Locale files are located in the "./locale" and "./tcg/locale" directories of a Free Realms client, in the form of <locale>_data.dat and <locale>_data.dir files (i.e., en_us_data.dat/en_us_data.dir). The .dat file consists of text entries while the .dir file contains metadata and information on each entry in the .dat file. Combined, the client uses these files to display text based on the user's locale configuration.

Examples of an en_us_data.dat and en_us_data.dir file can be seen here.

Usage

See documentation for API reference, samples, and tutorials.

Installation

This project is available as a NuGet package.

dotnet add package FreeRealmsLocaleTools

Code Samples

Adding a Locale Entry

using FreeRealmsLocaleTools.LocaleParser;

LocaleFileInfo localeFile = new("data/en_us_data.dat", "data/en_us_data.dir");
int nameId = localeFile.AddEntry("Illusion: Necronomicus - 15 minutes");
Console.WriteLine(localeFile.IdToEntry[nameId]);
localeFile.WriteEntries();

Console output:

2841312400      ucdt    Illusion: Necronomicus - 15 minutes

Generating a CSV of Name IDs → Text

using CsvHelper;
using FreeRealmsLocaleTools.LocaleParser;
using System.Globalization;

LocaleFileInfo localeFile = new("data/en_us_data.dat", "data/en_us_data.dir");
using StreamWriter writer = new("names.csv");
using CsvWriter csv = new(writer, CultureInfo.InvariantCulture);
csv.WriteRecords(localeFile.IdToEntry.Select(x => new { Id = x.Key, x.Value.Text }));

First 5 lines of names.csv:

Id,Text
1,Default Housing NPC
2,You receive #count([*item*])
3,You receive #count([*experience*]) and #count([*coins*])
4,coin

Reading Locale Metadata

using FreeRealmsLocaleTools.LocaleParser;

LocaleMetadata metadata = LocaleFile.ReadMetadata("data/en_us_data.dir");
Console.WriteLine($"Locale = {metadata.Locale}");
Console.WriteLine($"Count = {metadata.Count}");
Console.WriteLine($"Date = {metadata.Date}");

Console output:

Locale = en_US
Count = 113286
Date = Thu Mar 13 10:10:13 PDT 2014

Supported Locales

ID Locale Description
1 zh_CN Simplified Chinese
2 de_DE German
3 fr_FR French
4 en_GB British English
5 ja_JP Japanese
6 ko_KR Korean
7 zh_TW Traditional Chinese
8 en_US American English
9 es_ES Spanish
10 it_IT Italian
11 pt_PT Portuguese
12 ru_RU Russian
13 sv_SE Swedish
14 pt_BR Brazilian Portuguese
15 es_MX Mexican Spanish

Credits

Icon by photo3idea_studio.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 149 5/24/2025