Skip to content

Commit abde6b4

Browse files
authored
Fix hestiacp#3745 Translations not loading (hestiacp#3746)
* English was not accepted as a valid language * Fix translations hestiacp#3745 Export from crowdin did escape \n to \\n for some reasons * Minor changes locale strings
1 parent cf7f80a commit abde6b4

File tree

42 files changed

+17
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+17
-7
lines changed

bin/v-change-sys-language

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,18 @@ source $HESTIA/func/main.sh
2323
source_conf "$HESTIA/conf/hestia.conf"
2424

2525
is_language_valid() {
26-
if [ ! -d "$HESTIA/web/locale/$language" ]; then
27-
echo "Error: language file $language doesn't exist"
28-
log_event "$E_NOTEXIST $ARGUMENTS"
29-
exit "$E_NOTEXIST"
26+
# English is always allowed
27+
if [ "$1" != "en" ]; then
28+
if ! [[ "$1" =~ ^[[:alnum:]_-]+$ ]]; then
29+
echo "Error: language $1 is not valid"
30+
log_event "$E_INVALID" "$ARGUMENTS"
31+
exit $E_INVALID
32+
fi
33+
if [ ! -d "$HESTIA/web/locale/$1" ]; then
34+
echo "Error: language $1 doesn't exist"
35+
log_event "$E_NOTEXIST" "$ARGUMENTS"
36+
exit $E_NOTEXIST
37+
fi
3038
fi
3139
}
3240

-2.07 KB
Binary file not shown.
-36.1 KB
Binary file not shown.
-27.7 KB
Binary file not shown.
-25.4 KB
Binary file not shown.
-38.3 KB
Binary file not shown.
-33.6 KB
Binary file not shown.
-31 KB
Binary file not shown.
-39.8 KB
Binary file not shown.
935 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)