aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-07-13 09:47:50 +0000
committerMario <mario@mariovavti.com>2023-07-13 09:47:50 +0000
commit70b8c57d220aaaa361967343e2ca7dfa62632569 (patch)
treeca2c5d42d192bb0841b43b821f7cd1c95bbde609
parent3d866e89757b8aafe58489f9575f6895029090d1 (diff)
downloadvolse-hubzilla-70b8c57d220aaaa361967343e2ca7dfa62632569.tar.gz
volse-hubzilla-70b8c57d220aaaa361967343e2ca7dfa62632569.tar.bz2
volse-hubzilla-70b8c57d220aaaa361967343e2ca7dfa62632569.zip
basic per item rtl language support - issue ##1780
-rw-r--r--Zotlabs/Lib/ThreadItem.php3
-rw-r--r--include/language.php17
-rw-r--r--view/tpl/conv_item.tpl2
-rw-r--r--view/tpl/conv_list.tpl2
-rw-r--r--view/tpl/search_item.tpl2
5 files changed, 22 insertions, 4 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 14c9500ff..7fa621470 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -506,7 +506,8 @@ class ThreadItem {
'contact_id' => (($contact) ? $contact['abook_id'] : ''),
'moderate' => ($item['item_blocked'] == ITEM_MODERATED),
'moderate_approve' => t('Approve'),
- 'moderate_delete' => t('Delete')
+ 'moderate_delete' => t('Delete'),
+ 'rtl' => in_array($item['lang'], rtl_languages())
);
diff --git a/include/language.php b/include/language.php
index e7363cffb..d84f02a36 100644
--- a/include/language.php
+++ b/include/language.php
@@ -451,3 +451,20 @@ function lang_selector() {
return $o;
}
+function rtl_languages() {
+ return [
+ 'ar',
+ 'arc',
+ 'ckb',
+ 'dv',
+ 'fa',
+ 'ha',
+ 'he',
+ 'khw',
+ 'ks',
+ 'ps',
+ 'sd',
+ 'ur',
+ 'yi'
+ ];
+}
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 5f6c4f6c6..d4299812d 100644
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -89,7 +89,7 @@
{{/if}}
{{if $item.body}}
<div class="p-2 wall-item-content clearfix" id="wall-item-content-{{$item.id}}">
- <div class="wall-item-body e-content" id="wall-item-body-{{$item.id}}" >
+ <div class="wall-item-body e-content" id="wall-item-body-{{$item.id}}"{{if $item.rtl}} dir="rtl"{{/if}}>
{{$item.body}}
</div>
</div>
diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl
index 0024ec382..43133027f 100644
--- a/view/tpl/conv_list.tpl
+++ b/view/tpl/conv_list.tpl
@@ -89,7 +89,7 @@
{{/if}}
{{if $item.body}}
<div class="p-2 wall-item-content clearfix" id="wall-item-content-{{$item.id}}">
- <div class="wall-item-body e-content" id="wall-item-body-{{$item.id}}" >
+ <div class="wall-item-body e-content" id="wall-item-body-{{$item.id}}"{{if $item.rtl}} dir="rtl"{{/if}}>
{{$item.body}}
</div>
</div>
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index da5bac5dc..2c4aab9f4 100644
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -88,7 +88,7 @@
{{/if}}
{{if $item.body}}
<div class="p-2 clrearfix {{if $item.is_photo}} wall-photo-item{{else}} wall-item-content{{/if}}" id="wall-item-content-{{$item.id}}">
- <div class="wall-item-body" id="wall-item-body-{{$item.id}}" >
+ <div class="wall-item-body" id="wall-item-body-{{$item.id}}"{{if $item.rtl}} dir="rtl"{{/if}}>
{{$item.body}}
</div>
</div>