From 76c96d3a1c6597c39b2237246fbef52030465e2b Mon Sep 17 00:00:00 2001 From: bye Date: Fri, 28 Jun 2024 22:41:18 +0100 Subject: [PATCH] Add basic translation support --- .gitmodules | 4 ++++ common/strings.php | 49 ++++++++++++++++++++++++++++++++++++++++++++++ strings | 1 + 3 files changed, 54 insertions(+) create mode 100644 .gitmodules create mode 100644 common/strings.php create mode 160000 strings diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..64fd4b1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "strings"] + path = strings + branch = main + url = https://github.com/byecorps/id-strings diff --git a/common/strings.php b/common/strings.php new file mode 100644 index 0000000..618ad18 --- /dev/null +++ b/common/strings.php @@ -0,0 +1,49 @@ + $value) { + if (is_array($value)) { + if (!isset($original[$key])) { + $original[$key] = []; + } + $original[$key] = merge_arrays($original[$key], $value); + } else { + // Replace only if the value is not blank + if ($value !== '') { + $original[$key] = $value; + } + } + } + return $original; + } + + $LANG = merge_arrays($temp, $LANG); +} diff --git a/strings b/strings new file mode 160000 index 0000000..2ca0a98 --- /dev/null +++ b/strings @@ -0,0 +1 @@ +Subproject commit 2ca0a987728cf7c90454eab06083f49442109eb5