Skip to content

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOS-ReLocalization 🌐

A re-localization toolkit for MILFs of Sunville (JSON-based).

English | 中文

MOS-ReLocalization is a Python toolkit for re-localizing MILFs of Sunville (or any JSON-based localization). It provides AI translation, placeholder fixing, English-in-Chinese review, proper‑noun unification, and coverage analytics — producing cleaner, more natural Chinese output.


Features

  • Language column detection: auto build column→language map (scripts/detect_all_languages.pydata/language_map.json)
  • AI translation (RU/EN → ZH): context‑aware Chinese localization (scripts/ai_translate.pyoutput/language_dict_translated.json)
  • English‑in‑Chinese review and merge: export mixed entries, manually fix, then merge (scripts/export_english_in_chinese.py → fix → scripts/merge_fixed_translations.py)
  • Placeholder fixes: normalize [mcname] / [mcsurname] and variants (scripts/fix_mcname_tags.py, scripts/fix_mcname_format.py, scripts/fix_mcsurname_tags.py)
  • Proper‑noun unification: apply data/name_map.json and optionally AI‑assisted unification
    • Apply + AI QA: scripts/ai_apply_namemap_unify.py
    • Unified flow (merge + apply): scripts/unify_namemap_and_apply_ai.py
    • Alternative applier: scripts/ai_apply_namemap_aiunify.py
    • Merge candidates & generate mapping: scripts/ai_name_unify_with_namemap.py
    • No‑AI quick apply (pure replace): scripts/apply_namemap_fix_no_ai.py
  • Coverage analytics: per‑column fill ratio (scripts/translation_coverage.py)

Setup

  1. Python 3.13+

  2. Install dependencies

pip install -U openai python-dotenv langdetect
  1. Configure environment via .env (examples)
# Engine selection
MODEL_PROVIDER=deepseek          # or: chatgpt

# OpenAI
OPENAI_API_KEY=sk-...
MODEL=gpt-4o-mini

# DeepSeek (OpenAI-compatible)
DEEPSEEK_API_KEY=sk-...
DEEPSEEK_BASE_URL=https://api.siliconflow.cn
DEEPSEEK_MODEL=deepseek-ai/DeepSeek-R1

# Optional rate limiting / concurrency
RPM=1000
TPM=100000
ASYNC_CONCURRENCY=100
PRINT_EVERY=50
BATCH_FLUSH=200

Recommended Workflow

  1. Detect language columns
python scripts/detect_all_languages.py

Output: data/language_map.json

  1. AI translation to Chinese (using RU + EN)
python scripts/ai_translate.py

Output: output/language_dict_translated.json

  1. Review English‑in‑Chinese and merge back
# Export mixed entries in Chinese columns
python scripts/export_english_in_chinese.py
# Manually fix: output/review_english_mixed/mixed_entries_fixed.json
# Merge back
python scripts/merge_fixed_translations.py

Output: output/language_dict_merged.json

  1. Fix placeholders and normalize formats
python scripts/fix_mcname_tags.py            # → output/language_dict_fixed.json
python scripts/fix_mcname_format.py          # → output/language_dict_mcname_fixed.json
python scripts/fix_mcsurname_tags.py         # → output/language_dict_mcsurname_fixed.json
  1. Unify proper nouns (pick one path)
  • Path A: Apply name_map with AI QA
python scripts/ai_apply_namemap_unify.py     # → output/language_dict_namemap_applied.json
  • Path B: Merge candidates + apply in one go
python scripts/unify_namemap_and_apply_ai.py # → output/language_dict_name_final.json
  • Alternatives (advanced)
python scripts/ai_apply_namemap_aiunify.py
python scripts/ai_name_unify_with_namemap.py
python scripts/apply_namemap_fix_no_ai.py
  1. Coverage report
python scripts/translation_coverage.py --save

Output: output/translation_coverage.json


Data & Outputs

  • Input data: data/language_dict.json, data/name_map.json
  • Language map: data/language_map.json (generated)
  • Intermediate/final outputs under output/ (JSON + reports like name_unify_report.txt)
  • Caches under cache/

Notes

  • Rate limits: DeepSeek typical RPM≈1000 / TPM≈100000; scripts auto back‑off on 429.
  • Placeholders: keep [mcname], [mcsurname] intact in translations.
  • Proper nouns: curate data/name_map.json first, then run unification to ensure consistency.

License

MIT License © 2025 AyeSt0

Re‑forging words — re‑localizing MILFs of Sunville.

About

A Python toolkit for the re-localization of MILFs of Sunville. Extracts, refines, and rebuilds JSON translation files to enhance translation quality, fluency, and immersion across any language.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages