Pylocres
Tool for reading and writing Unreal Engine translation files.
Install / Use
/learn @stas96111/PylocresREADME
🧩 PyLocres
PyLocres is a Python library for reading, writing, and editing .locres and .locmeta files used in Unreal Engine's localization system.
Supports all known versions of Locres, including the latest.
📦 Installation
Install from PyPI:
pip install pylocres
Or install directly from the repository:
git clone https://github.com/stas96111/pylocres.git
cd pylocres
pip install -r requirements.txt
pip install .
🛠️ Command Line Tool
# Show info about a .locres file
pylocres info --path example.locres
# Convert .locres to .csv
pylocres to-csv --path example.locres --out output.csv
# Convert .csv to .locres
pylocres from-csv --path output.csv --out result.locres
# Convert .locres to .po
pylocres to-po --path example.locres --out output.po
# Convert .po to .locres
pylocres from-po --path output.po --out result.locres
📘 Usage: Locres
from pylocres import LocresFile, Namespace, Entry, LocresVersion, entry_hash
# Create Locres file instance
locres = LocresFile()
# Read a .locres file
locres.read("path/to/file.locres")
# Iterate over all namespaces
for namespace in locres:
print("Namespace:", namespace.name or "<default>")
# Iterate over all entries in the namespace
for entry in namespace:
print("Key:", entry.key) # cf433749-2e... (uuid4 or custom key)
print("Translation:", entry.translation) # Hello world!
print("Source Hash:", entry.hash) # 828975897
# Set a new translation
entry.translation = "Привіт світ!"
# Optionally, recalculate source hash
entry.hash = entry_hash("Hello world!")
# Create a new entry and add it to a namespace
new_entry = Entry("my_key", "My translation", entry_hash("My source"))
namespace.add(new_entry)
# Add a new namespace
new_namespace = Namespace("UI")
locres.add(new_namespace)
# Set file format version (default: CityHash)
locres.version = LocresVersion.CityHash
# Save the modified locres file
locres.write("path/to/output.locres")
# Done
Locmeta Usage
from pylocres import LocmetaFile, LocmetaVersion
# Create Locmeta file instance
locmeta = LocmetaFile()
# Read a .locmeta file
locmeta.read("path/to/file.locmeta")
# View metadata
print("Version:", locmeta.version)
print("Native culture:", locmeta.native_culture) # en
print("Native locres path:", locmeta.native_locres) # en/Game.locres
print("Compiled cultures:", locmeta.compiled_cultures) # ["en", "de", "fr", ...]
# Modify metadata
locmeta.native_culture = "uk"
# Save changes
locmeta.write("path/to/output.locmeta")
# Done
License
MIT License © 2025 stas96111
Related Skills
qqbot-channel
349.7kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.4k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
349.7kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
