mirror of
https://github.com/Dasemu/vnpipe.git
synced 2026-11-26 15:26:27 +00:00
feat(renpy): copy work translations, set default language and make e2e clicks language-independent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec4d4cf41b
commit
a49e50636a
3 files changed
+44
-4
No files matched your search
@@ -427,6 +427,22 @@ def test_scan_and_copy_audio(work, tmp_path):
|
||||
assert "audio/scenes/x.ogg" in audio.files
|
||||
|
||||
|
||||
def test_copy_translations_and_default_language(work, tmp_path):
|
||||
root = tmp_path / "w"
|
||||
(root / "tl/spanish").mkdir(parents=True)
|
||||
(root / "tl/spanish/common.rpy").write_text("translate spanish strings:\n", encoding="utf-8")
|
||||
data = {**work.data, "ui": {**work.data.get("ui", {}), "language": "spanish"}}
|
||||
out = tmp_path / "out"
|
||||
copied = renpy_gen.copy_translations(type(work)(root=root, data=data), out)
|
||||
assert (out / "game/tl/spanish/common.rpy").is_file()
|
||||
lang = out / "game/language.rpy"
|
||||
assert lang in copied
|
||||
assert lang.read_text(encoding="utf-8") == 'define config.default_language = "spanish"\n'
|
||||
# Without [ui].language the stale file is removed.
|
||||
renpy_gen.copy_translations(type(work)(root=tmp_path / "none", data=work.data), out)
|
||||
assert not lang.exists()
|
||||
|
||||
|
||||
def test_mood_directory_is_a_playlist(work, annotated):
|
||||
block = scene_block(renpy_gen.render_script(work, annotated, _audio()), "lyric")
|
||||
assert _music_lines(block) == [
|
||||
|
||||
Reference in new issue
Block a user