mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #6807 from mglae/le11_locale_gbm_fix
locale addon: fix call of localedef, update language and settings format, REV 103
This commit is contained in:
commit
32b7df7013
@ -1,3 +1,6 @@
|
||||
103:
|
||||
- Fix localedef call, add error detection
|
||||
|
||||
102:
|
||||
- Include localedef
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="locale"
|
||||
PKG_REV="102"
|
||||
PKG_REV="103"
|
||||
PKG_ARCH="any"
|
||||
PKG_DEPENDS_TARGET="toolchain glibc"
|
||||
PKG_SECTION="service"
|
||||
@ -34,10 +34,9 @@ addon() {
|
||||
if [ "${l}" = "POSIX" ]; then
|
||||
continue
|
||||
fi
|
||||
locales+="|${l}"
|
||||
locales+="$(echo -e '\\\n <option>'"${l}"'</option>')"
|
||||
done
|
||||
locales="${locales:1}"
|
||||
|
||||
sed -e "s/@LOCALES@/${locales}/" \
|
||||
sed -e "s|@LOCALES@|${locales}|" \
|
||||
-i ${ADDON_BUILD}/${PKG_ADDON_ID}/resources/settings.xml
|
||||
}
|
||||
|
@ -1,7 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<settings>
|
||||
<category label="30000">
|
||||
<setting label="30001" id="charmap" type="select" default="UTF-8" values="UTF-8" enable="false" />
|
||||
<setting label="30002" id="locale" type="select" default="en_GB" values="@LOCALES@" />
|
||||
<?xml version="1.0" ?>
|
||||
<settings version="1">
|
||||
<section id="service.locale">
|
||||
<category id="configuration" label="30000" help="">
|
||||
<group id="1">
|
||||
<setting id="charmap" type="string" label="30001" help="">
|
||||
<level>0</level>
|
||||
<default>UTF-8</default>
|
||||
<constraints>
|
||||
<options>
|
||||
<option>UTF-8</option>
|
||||
</options>
|
||||
</constraints>
|
||||
<dependencies>
|
||||
<dependency type="enable">
|
||||
<condition on="property" name="InfoBool">false</condition>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<control type="list" format="string">
|
||||
<heading>30001</heading>
|
||||
</control>
|
||||
</setting>
|
||||
<setting id="locale" type="string" label="30002" help="">
|
||||
<level>0</level>
|
||||
<default>en_GB</default>
|
||||
<constraints>
|
||||
<options>@LOCALES@
|
||||
</options>
|
||||
</constraints>
|
||||
<control type="list" format="string">
|
||||
<heading>30002</heading>
|
||||
</control>
|
||||
</setting>
|
||||
</group>
|
||||
</category>
|
||||
</section>
|
||||
</settings>
|
||||
|
@ -38,8 +38,20 @@ class Monitor(xbmc.Monitor):
|
||||
|
||||
if os.path.isdir(localepath) == False:
|
||||
os.environ['I18NPATH'] = i18npath
|
||||
subprocess.call([os.path.join(path, 'bin/localedef'), '-f', charmap,
|
||||
'-i', locale, localepath])
|
||||
rc = subprocess.run([os.path.join(path, 'bin/localedef'), '-v', '-f', charmap,
|
||||
'-i', locale, localepath], capture_output=True,
|
||||
stdin=subprocess.DEVNULL)
|
||||
|
||||
if rc.returncode not in [0, 1]:
|
||||
xbmc.log(repr(rc), xbmc.LOGERROR)
|
||||
try:
|
||||
os.rmdir(localepath)
|
||||
except OSError as e:
|
||||
pass
|
||||
if os.path.isfile(profile):
|
||||
os.unlink(profile)
|
||||
xbmcgui.Dialog().ok('Locale', strings(30004).format(lang))
|
||||
return
|
||||
|
||||
if os.path.isdir(profiled) == False:
|
||||
os.makedirs(profiled)
|
||||
|
@ -17,3 +17,7 @@ msgstr ""
|
||||
msgctxt "#30003"
|
||||
msgid "Locale changed to {}. Please reboot to apply globally."
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30004"
|
||||
msgid "Creating locale {} failed. Aborting."
|
||||
msgstr ""
|
@ -1,4 +1,4 @@
|
||||
<settings>
|
||||
<setting id="charmap" value="UTF-8" />
|
||||
<setting id="locale" value="en_GB" />
|
||||
<settings version="2">
|
||||
<setting id="charmap" default="true">UTF-8</setting>
|
||||
<setting id="locale" default="true>en_GB</setting>
|
||||
</settings>
|
||||
|
Loading…
x
Reference in New Issue
Block a user