Skip to content

Commit

Permalink
Automate creation of .trf translation files
Browse files Browse the repository at this point in the history
  • Loading branch information
Epicpkmn11 committed Nov 29, 2024
1 parent 47e5ea2 commit f48f0d5
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ desktop.ini
# User additions
/zzz_backup
/arm9/source/language.inl
*.trf
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ ifeq ($(NTRBOOT),1)
endif

# Definitions for translation files
SOURCE_JSON := resources/languages/source.json
LANGUAGE_INL := arm9/source/language.inl
JSON_FOLDER := resources/languages
TRF_FOLDER := resources/gm9/languages

SOURCE_JSON := $(JSON_FOLDER)/source.json
LANGUAGE_INL := arm9/source/language.inl

JSON_FILES := $(filter-out $(SOURCE_JSON),$(wildcard $(JSON_FOLDER)/*.json))
TRF_FILES := $(subst $(JSON_FOLDER),$(TRF_FOLDER),$(JSON_FILES:.json=.trf))

ifeq ($(OS),Windows_NT)
ifeq ($(TERM),cygwin)
Expand Down Expand Up @@ -55,7 +61,7 @@ clean:
@set -e; for elf in $(ELF); do \
$(MAKE) --no-print-directory -C $$(dirname $$elf) clean; \
done
@rm -rf $(OUTDIR) $(RELDIR) $(FIRM) $(FIRMD) $(VRAM_TAR) $(LANGUAGE_INL)
@rm -rf $(OUTDIR) $(RELDIR) $(FIRM) $(FIRMD) $(VRAM_TAR) $(LANGUAGE_INL) $(TRF_FILES)

unmarked_readme: .FORCE
@$(PY3) utils/unmark.py -f README.md data/README_internal.md
Expand Down Expand Up @@ -93,13 +99,16 @@ $(LANGUAGE_INL): $(SOURCE_JSON)
@echo "Creating $@"
@$(PY3) utils/transcp.py $< $@

$(TRF_FOLDER)/%.trf: $(JSON_FOLDER)/%.json
@$(PY3) utils/transriff.py $< $@

%.elf: .FORCE
@echo "Building $@"
@$(MAKE) --no-print-directory -C $(@D)

arm9/arm9.elf: $(VRAM_TAR) $(LANGUAGE_INL)

firm: $(ELF)
firm: $(ELF) $(TRF_FILES)
@mkdir -p $(call dirname,"$(FIRM)") $(call dirname,"$(FIRMD)")
@echo "[FLAVOR] $(FLAVOR)"
@echo "[VERSION] $(VERSION)"
Expand Down
Binary file removed resources/gm9/languages/de.trf
Binary file not shown.
Binary file removed resources/gm9/languages/en.trf
Binary file not shown.
Binary file removed resources/gm9/languages/es.trf
Binary file not shown.
Binary file removed resources/gm9/languages/fr.trf
Binary file not shown.
Binary file removed resources/gm9/languages/id.trf
Binary file not shown.
Binary file removed resources/gm9/languages/it.trf
Binary file not shown.
Binary file removed resources/gm9/languages/ja-KANA.trf
Binary file not shown.
Binary file removed resources/gm9/languages/ja.trf
Binary file not shown.
Binary file removed resources/gm9/languages/nl.trf
Binary file not shown.
Binary file removed resources/gm9/languages/pl.trf
Binary file not shown.
Binary file removed resources/gm9/languages/ru.trf
Binary file not shown.
Binary file removed resources/gm9/languages/ry.trf
Binary file not shown.

0 comments on commit f48f0d5

Please sign in to comment.