voice: Include a simple string enumeration in voicestrings.zip

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 0abfb3ff782d69d77b8abc6a82208b46ff337206
Author: Solomon Peachy <[email protected]>
Date:   Thu Jan 8 20:13:04 2026 -0500

    voice:  Include a simple string enumeration in voicestrings.zip
    
    This maps the numerical IDs contained within the binary .vstrings files
    to their logical LANG_* and VOICE_* names.
    
    While not strictly needed to produce voice files, it adds the final
    piece to be able to use vstrings files to produce the same voice files
    as the existing 'make voice' flow that directly parses the language files.
    
    The 'make voice' flow intentionally divert a few of the generated clips
    into standalone files:
    
     * "invalid voice file"
     * <spoken language name>
     * <short pause>
    
    For this to be possible, we need to know which specific entries in
    vstrings map to the ones we care about, and without this enumeration
    (which can change on a per-target or even per-build basis) this is
    effectively impossible.
    
    The produced lang-enum.txt is simple, with one entry per line of the
    format: number:name
    
    Note that nothing uses this new file yet; that will come in subsequent
    commits.
    
    Change-Id: Iec3fccbb6d503dd7e2d529aad318009a489b1d77

diff --git a/apps/lang/lang.make b/apps/lang/lang.make
index 305b7b9f92..bae19aad85 100644
--- a/apps/lang/lang.make
+++ b/apps/lang/lang.make
@@ -57,7 +57,11 @@ $(BUILDDIR)/apps/lang/voice-corrections.txt: $(ROOTDIR)/tools/voice-corrections.
 	$(SILENT)mkdir -p $(dir $@)
 	$(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $@
 
-$(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ) $(wildcard $(BUILDDIR)/apps/lang/*.talk) $(BUILDDIR)/apps/lang/voice-corrections.txt
+$(BUILDDIR)/apps/lang/lang-enum.txt: $(BUILDDIR)/lang_enum.h
+	$(SILENT)mkdir -p $(dir $@)
+	$(call PRINTS,GEN $(subst $(BUILDDIR)/,,$@))perl -ne 'print if s|\s+(.*), /\* (\w+).*|$$2:$$1|' < $<  |grep -v 'this:' > $@
+
+$(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ) $(wildcard $(BUILDDIR)/apps/lang/*.talk) $(BUILDDIR)/apps/lang/voice-corrections.txt $(BUILDDIR)/apps/lang/lang-enum.txt
 	$(call PRINTS,ZIP $(subst $(BUILDDIR)/,,$@))
 	$(SILENT)zip -9 -q $@ $(subst $(BUILDDIR)/,,$^)
 
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.