A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

build: Tweaks to better support non-English as primary language

* get rid of $(LANGUAGE) in top-level makefile (and configure script)
* un-hardcode English-as-primary-language in a couple more places
* allow DEFAULT_VOICE_LANG to be overriden

To actually change the primary from English, one must change:

* $english in voice.pl
* hardcoded 'english' in rbutil
* $ENGLISH in apps/lang/lang.make
* DEFAULT_VOICE_LANG in apps/talk.c
* configure script (default prompt)

Of course, if one wants to change the default UI language, it's simpler
to change the default language setting variable at compile time, or
perhaps by adding a configuration file with the desired value into the
.rockbox directory when the .zip is assembled.

Change-Id: If5cf76019d416e838628a2eccd4ec7d6cbaeeb74

+6 -7
+4 -3
apps/lang/lang.make
··· 11 11 LANGOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.lng) 12 12 VOICEOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.vstrings) 13 13 LANG_O = $(BUILDDIR)/lang/lang_core.o 14 + ENGLISH := english 14 15 15 16 CLEANOBJS += $(BUILDDIR)/lang/max_language_size.h $(BUILDDIR)/lang/lang* 16 17 ··· 36 37 # instead we pretend that genlang create lang_core.c and that lang.c depends from lang.h 37 38 # it will work fine as long as one never manually removes lang.c and not lang.h, and it will avoid 38 39 # race conditions such as running genlang twice or worse in parallel with other things! 39 - $(BUILDDIR)/lang/lang.h: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features 40 + $(BUILDDIR)/lang/lang.h: $(APPSDIR)/lang/$(ENGLISH).lang $(BUILDDIR)/apps/features 40 41 $(call PRINTS,GEN lang.h) 41 42 $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done; \ 42 43 perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $< ··· 49 50 $(BUILDDIR)/%.lng $(BUILDDIR)/%.vstrings: $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features 50 51 $(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<)) 51 52 $(SILENT)mkdir -p $(dir $@) 52 - $(SILENT)$(TOOLSDIR)/genlang -u -e=$(APPSDIR)/lang/english.lang $< > $@.tmp 53 - $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$*.lng -c=$*.vstrings $@.tmp 53 + $(SILENT)$(TOOLSDIR)/genlang -u -e=$(APPSDIR)/lang/$(ENGLISH).lang $< > $@.tmp 54 + $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/$(ENGLISH).lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$*.lng -c=$*.vstrings $@.tmp 54 55 $(SILENT)rm -f $@.tmp 55 56 56 57 $(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ)
+2
apps/talk.c
··· 82 82 83 83 #define LOADED_MASK 0x80000000 /* MSB */ 84 84 85 + #ifndef DEFAULT_VOICE_LANG 85 86 #define DEFAULT_VOICE_LANG "english" 87 + #endif 86 88 87 89 /***************** Data types *****************/ 88 90
-4
tools/configure
··· 4669 4669 4670 4670 echo "Using source code root directory: $rootdir" 4671 4671 4672 - # this was once possible to change at build-time, but no more: 4673 - language="english" 4674 - 4675 4672 uname=`uname` 4676 4673 4677 4674 if [ "yes" = "$simulator" ]; then ··· 5039 5036 export OBJDIR=${pwd} 5040 5037 export BUILDDIR=${pwd} 5041 5038 export RBCODEC_BLD=${pwd}/lib/rbcodec 5042 - export LANGUAGE=${language} 5043 5039 export VOICELANGUAGE=${voicelanguage} 5044 5040 export MEMORYSIZE=${memory} 5045 5041 export BUILDDATE:=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')