aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-05 07:52:43 +0000
committerMario <mario@mariovavti.com>2021-06-05 07:52:43 +0000
commit0784d2ea4e4f492d9f03d025b56d603d15b5ee89 (patch)
treee7ccf216da5cac2f3bef12cb80e5f61fe6fe356c /Zotlabs
parent7b3eb09067e08bc017b71f5f05aef5a67eb5b05a (diff)
parentb90db6931de2e1989cf44fac9ef037d1bc2cc16b (diff)
downloadvolse-hubzilla-0784d2ea4e4f492d9f03d025b56d603d15b5ee89.tar.gz
volse-hubzilla-0784d2ea4e4f492d9f03d025b56d603d15b5ee89.tar.bz2
volse-hubzilla-0784d2ea4e4f492d9f03d025b56d603d15b5ee89.zip
Merge branch 'dev' into six
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Lang.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/Zotlabs/Module/Lang.php b/Zotlabs/Module/Lang.php
index a32f933a6..1a2f1664e 100644
--- a/Zotlabs/Module/Lang.php
+++ b/Zotlabs/Module/Lang.php
@@ -7,6 +7,52 @@ use Zotlabs\Web\Controller;
class Lang extends Controller {
+ const MYP = 'ZIN';
+ const VERSION = '2.0.0';
+
+ function post() {
+
+ $re = [];
+ $isajax = is_ajax();
+ $eol = $isajax ? "\n" : EOL;
+
+ if (! Apps::system_app_installed(local_channel(), 'Language')) {
+ $re['msg'] = 'ZIN0202E, ' . t('Language App') . ' (' . t('Not Installed') . ')' ;
+ notice( $re['msg'] . EOL);
+ if ($isajax) {
+ echo json_encode( $re );
+ killme();
+ exit;
+ } else {
+ return;
+ }
+ }
+
+ $lc = x($_POST['zinlc']) && preg_match('/^\?\?|[a-z]{2,2}[x_\-]{0,1}[a-zA-Z]{0,2}$/', $_POST['zinlc'])
+ ? $_POST['zinlc'] : '';
+ $lcs= x($_POST['zinlcs']) && preg_match('/^[a-z,_\-]{0,191}$/', $_POST['zinlcs'])
+ ? $_POST['zinlcs'] : '';
+
+ if ($isajax) {
+
+ if ($lc == '??') {
+ $re['lc'] = get_best_language();
+ $re['lcs'] = language_list();
+ } else {
+ $re['lc'] = $lc;
+ $re['alc'] = App::$language;
+ $re['slc'] = $_SESSION['language'];
+ $_SESSION['language'] = $lc;
+ App::$language = $lc;
+ load_translation_table($lc, true);
+ }
+
+ echo json_encode( $re );
+ killme();
+ exit;
+ }
+ }
+
function get() {
if(local_channel()) {