Merge pull request #568 from fewtarius/dev

Always apply language settings if a language is defined.
This commit is contained in:
fewtarius 2022-09-26 20:22:31 -04:00 committed by GitHub
commit 99c5d21c38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 2 deletions

View file

@ -90,6 +90,9 @@ makeinstall_target() {
rm -rf ${INSTALL}/usr/config/emulationstation/resources/logo.png
mkdir -p ${INSTALL}/usr/bin
cp ${PKG_BUILD}/es_settings ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/es_settings
cp ${PKG_BUILD}/start_es.sh ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/start_es.sh

View file

@ -0,0 +1,43 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert)
# Copyright (C) 2020-present Fewtarius
# Source predefined functions and variables
. /etc/profile
set_audio alsa
export SDL_AUDIODRIVER=alsa
TZ=$(get_setting system.timezone)
echo -n "TIMEZONE=${TZ}" > /storage/.cache/timezone
echo -n "${TZ}" >/storage/.cache/system_timezone
systemctl restart tz-data.service
# create charmap used for translations
locale=$(get_setting system.language)
if [[ -n "${locale}" ]]
then
charmap="UTF-8"
lang="${locale}.${charmap}"
locpath="/storage/.config/emulationstation/locale"
i18npath="$locpath/i18n"
localepath="$locpath/$lang"
if [ ! -d $localepath ]; then
export I18NPATH=$i18npath
performance
/usr/bin/localedef -f $charmap -i $locale $localepath
${DEVICE_CPU_GOVERNOR}
fi
export LOCPATH=$locpath
export LANG=$lang
export LANGUAGE=$lang
systemctl import-environment LANG
systemctl import-environment LOCPATH
systemctl import-environment I18NPATH
systemctl import-environment LANGUAGE
fi

View file

@ -16,7 +16,7 @@ systemctl restart tz-data.service
# create charmap used for translations
locale=$(get_setting system.language)
if [ $? == "0" ]
if [[ -n "${locale}" ]]
then
charmap="UTF-8"
lang="${locale}.${charmap}"

View file

@ -5,7 +5,8 @@ ConditionPathExists=/var/lock/start.games
[Service]
Environment=HOME=/storage
Environment=SDL_AUDIODRIVER=alsa
ExecStart=/usr/bin/start_es.sh
ExecStartPre=/usr/bin/es_settings
ExecStart=/usr/bin/emulationstation --log-path /var/log
KillMode=process
TimeoutStopSec=3
Restart=always