Expand description
Localisation table files for Total War games.
Loc files store key-value pairs for text localisation, enabling translation of in-game strings. Each entry consists of a unique key, the localised text, and a boolean flag (purpose unknown, commonly called “tooltip”).
§Overview
Unlike DB tables which require schema definitions, Loc files have a fixed structure:
- Key: Unique identifier for the text entry (UTF-16 string)
- Text: The localised string content (UTF-16 string)
- Tooltip: Boolean flag of unknown purpose
Loc files are used in all Total War games since Empire. In games prior to Troy, when
using a non-English language, only the main localisation.loc file is loaded -
individual loc files are ignored.
§Binary Structure
§Header (14 bytes)
| Bytes | Type | Data |
|---|---|---|
| 2 | u16 | Byte order mark. Always 0xFFFE. |
| 3 | UTF-8 String | File type identifier. Always "LOC". |
| 1 | u8 | Unknown, always 0. Possibly padding. |
| 4 | i32 | Version. Always 1 in known files. |
| 4 | u32 | Number of entries in the table. |
§Data (per entry)
| Bytes | Type | Data |
|---|---|---|
| 2 + * | Sized StringU16 | Localisation key (u16 length prefix + UTF-16). |
| 2 + * | Sized StringU16 | Localised text (u16 length prefix + UTF-16). |
| 1 | bool | Tooltip flag (unknown purpose). |
Structs§
- Loc
- In-memory representation of a decoded Loc (localisation) file.
Constants§
- EXTENSION
- Extension used by Loc files.