Commit 415d96da authored by Anton Midyukov's avatar Anton Midyukov

grub, l10n: available only languages from $LOCALES in grub and installer

parent 0e780045
submenu $"Change language (press F2)" --hotkey 'f2' --id 'lang' {
insmod regexp
for langstr in "ru_RU=Russian" "en_US=English" "pt_BR=Portuguese" "uk_UA=Ukrainian"; do
for langstr in \
"ru_RU=Russian" \
"en_US=English" \
"pt_BR=Portuguese" \
"uk_UA=Ukrainian" \
; do
regexp -s 2:langname -s 1:langcode '(.*)=(.*)' "$langstr"
for locale in @LOCALES@; do
if [ "$locale" != "$langcode" ]; then continue; fi
menuentry "${langname}" "$langcode" {
lang="$2"
export lang
configfile ${prefix}/grub.cfg
}
done
done
menuentry $"Return to the Main menu" {
configfile ${prefix}/grub.cfg
}
......
......@@ -25,7 +25,7 @@ ifneq (,$(GRUB_UI))
GRUB_CFG := $(GRUB_CFG) gfxterm
endif
ifneq (,$(LOCALE))
ifneq (,$(LOCALES))
GRUB_CFG := $(GRUB_CFG) lang
endif
......@@ -103,6 +103,9 @@ bootargs: clean
sed -i "s, lang=.lang,,g" $(DSTCFGS); \
fi; \
sed -i "/lang=@LOCALE@/d" $(DSTCFGS)
@if [ -n "$(LOCALES)" ]; then \
sed -i "s,@LOCALES@,$(LOCALES),g" $(DSTCFGS); \
fi
@GRUBTHEME=$(GRUBTHEME); \
[ -n "$$GRUBTHEME" ] || GRUBTHEME=$$(cut -d "-" -f2 <<< $(BRANDING)); \
sed -i "s,@grubtheme@,$$GRUBTHEME,g" $(DSTCFGS)
......
#!/bin/bash
langlist="/etc/alterator/sysconfig/lang/langlist.all"
langlist_temp="$langlist".temp
locales="$GLOBAL_LOCALES"
[ -f "$langlist" ] || exit 0
[ -n "$locales" ] || exit 0
rm -f "$langlist_temp"
for lang in $locales; do
grep -q "$lang" "$langlist" && grep "$lang" "$langlist" >> "$langlist_temp"
done
mv "$langlist_temp" "$langlist"
#!/bin/bash
langlist="/etc/alterator/sysconfig/lang/langlist.all"
langlist_temp="$langlist".temp
locales="$GLOBAL_LOCALES"
[ -f "$langlist" ] || exit 0
[ -n "$locales" ] || exit 0
rm -f "$langlist_temp"
for lang in $locales; do
grep -q "$lang" "$langlist" && grep "$lang" "$langlist" >> "$langlist_temp"
done
mv "$langlist_temp" "$langlist"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment