From 21d022b11e0995e4c0d3c5d6bb124f5586b3cbda Mon Sep 17 00:00:00 2001
From: Daniel Winzen
Date: Fri, 23 Dec 2022 17:08:07 +0100
Subject: [PATCH] Add support for rtl languages
---
about.php | 6 +++---
chat/index.php | 4 ++--
common.php | 21 ++++++++++++++-------
contact.php | 4 ++--
faq.php | 4 ++--
github-ipv6-proxy.php | 4 ++--
hosting/index.php | 4 ++--
index.php | 4 ++--
new-domain.php | 4 ++--
privacy.php | 4 ++--
tutorials/index.php | 4 ++--
tutorials/torify-ftp/index.php | 4 ++--
12 files changed, 37 insertions(+), 30 deletions(-)
diff --git a/about.php b/about.php
index 75c43fc..44b76ad 100644
--- a/about.php
+++ b/about.php
@@ -1,8 +1,8 @@
-
+
@@ -32,7 +32,7 @@ global $language;
-
danwin1210.de are an NginX Proxy that will forward all requests to the raspberry pis at home. Additionally they run a Postfix instance only listening on the VPN network to send out mails to clearnet.'); ?>
+
danwin1210.de are an NginX Proxy that will forward all requests to the raspberry pis at home. Additionally, they run a Postfix instance only listening on the VPN network to send out mails to clearnet.'); ?>
diff --git a/chat/index.php b/chat/index.php
index 3722617..5bb47e4 100644
--- a/chat/index.php
+++ b/chat/index.php
@@ -1,8 +1,8 @@
-
+
diff --git a/common.php b/common.php
index 6c5ac28..fa95725 100644
--- a/common.php
+++ b/common.php
@@ -1,18 +1,18 @@
['name' => 'Deutsch', 'locale' => 'de_DE', 'flag' => '๐ฉ๐ช', 'show_in_menu' => true],
- 'en' => ['name' => 'English', 'locale' => 'en_GB', 'flag' => '๐ฌ๐ง', 'show_in_menu' => true],
- 'ru' => ['name' => 'ะ ัััะบะธะน', 'locale' => 'ru_RU', 'flag' => '๐ท๐บ', 'show_in_menu' => true],
+ 'de' => ['name' => 'Deutsch', 'locale' => 'de_DE', 'flag' => '๐ฉ๐ช', 'show_in_menu' => true, 'dir' => 'ltr'],
+ 'en' => ['name' => 'English', 'locale' => 'en_GB', 'flag' => '๐ฌ๐ง', 'show_in_menu' => true, 'dir' => 'ltr'],
+ 'ru' => ['name' => 'ะ ัััะบะธะน', 'locale' => 'ru_RU', 'flag' => '๐ท๐บ', 'show_in_menu' => true, 'dir' => 'ltr'],
];
$language = 'en';
$locale = 'en_GB';
+$dir = 'ltr';
if(isset($_REQUEST['lang']) && isset(LANGUAGES[$_REQUEST['lang']])){
$locale = LANGUAGES[$_REQUEST['lang']]['locale'];
$language = $_REQUEST['lang'];
+ $dir = LANGUAGES[$_REQUEST['lang']]['dir'];
setcookie('language', $_REQUEST['lang'], ['expires' => 0, 'path' => '/', 'domain' => '', 'secure' => ($_SERVER['HTTPS'] ?? '' === 'on'), 'httponly' => true, 'samesite' => 'Strict']);
}elseif(isset($_COOKIE['language']) && isset(LANGUAGES[$_COOKIE['language']])){
$locale = LANGUAGES[$_COOKIE['language']]['locale'];
$language = $_COOKIE['language'];
+ $dir = LANGUAGES[$_COOKIE['language']]['dir'];
}elseif(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$prefLocales = array_reduce(
explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']),
@@ -68,6 +74,7 @@ if(isset($_REQUEST['lang']) && isset(LANGUAGES[$_REQUEST['lang']])){
if(!empty($lang)){
$locale = LANGUAGES[$lang]['locale'];
$language = $lang;
+ $dir = LANGUAGES[$lang]['dir'];
setcookie('language', $lang, ['expires' => 0, 'path' => '/', 'domain' => '', 'secure' => ($_SERVER['HTTPS'] ?? '' === 'on'), 'httponly' => true, 'samesite' => 'Strict']);
break;
}
diff --git a/contact.php b/contact.php
index 719d129..159e273 100644
--- a/contact.php
+++ b/contact.php
@@ -1,8 +1,8 @@
-
+
diff --git a/faq.php b/faq.php
index e06e677..93c412e 100644
--- a/faq.php
+++ b/faq.php
@@ -1,8 +1,8 @@
-
+
diff --git a/github-ipv6-proxy.php b/github-ipv6-proxy.php
index 9ebd159..3415d38 100644
--- a/github-ipv6-proxy.php
+++ b/github-ipv6-proxy.php
@@ -1,8 +1,8 @@
-
+
diff --git a/hosting/index.php b/hosting/index.php
index e7201fd..73dc148 100644
--- a/hosting/index.php
+++ b/hosting/index.php
@@ -1,8 +1,8 @@
-
+
diff --git a/index.php b/index.php
index 670a141..a7ebcb2 100644
--- a/index.php
+++ b/index.php
@@ -1,8 +1,8 @@
-
+
diff --git a/new-domain.php b/new-domain.php
index 58dbeaf..73cf1f8 100644
--- a/new-domain.php
+++ b/new-domain.php
@@ -1,8 +1,8 @@
-
+
diff --git a/privacy.php b/privacy.php
index 1b48ed0..23fc4fe 100644
--- a/privacy.php
+++ b/privacy.php
@@ -1,8 +1,8 @@
-
+
diff --git a/tutorials/index.php b/tutorials/index.php
index c9e1d88..c675757 100644
--- a/tutorials/index.php
+++ b/tutorials/index.php
@@ -1,8 +1,8 @@
-
+
diff --git a/tutorials/torify-ftp/index.php b/tutorials/torify-ftp/index.php
index 797bb93..3e6b982 100644
--- a/tutorials/torify-ftp/index.php
+++ b/tutorials/torify-ftp/index.php
@@ -1,8 +1,8 @@
-
+