summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaim A <227396+naim94a@users.noreply.github.com>2023-05-19 17:49:16 +0300
committerGitHub <noreply@github.com>2023-05-19 16:49:16 +0200
commitd61a839188f6ba22bd2ed1acdedd561c95547ed6 (patch)
tree90da1952914794b914e1c208a03103e2dff32b62
parent74b818fe40cb9efeb7af09133f74360bf835c105 (diff)
resolve #510: reverse quote direction in RTL languages (#1183)
-rw-r--r--library/src/text/quotes.rs1
-rw-r--r--tests/ref/text/quotes.pngbin73727 -> 77389 bytes
-rw-r--r--tests/typ/text/quotes.typ3
3 files changed, 4 insertions, 0 deletions
diff --git a/library/src/text/quotes.rs b/library/src/text/quotes.rs
index 25d9cf88..d0798064 100644
--- a/library/src/text/quotes.rs
+++ b/library/src/text/quotes.rs
@@ -147,6 +147,7 @@ impl<'s> Quotes<'s> {
"es" if matches!(region, Some("ES") | None) => ("“", "”", "«", "»"),
"hu" | "pl" | "ro" => ("’", "’", "„", "”"),
"ru" | "no" | "nb" | "nn" | "ua" => ("’", "’", "«", "»"),
+ _ if lang.dir() == Dir::RTL => ("’", "‘", "”", "“"),
_ => return Self::default(),
};
diff --git a/tests/ref/text/quotes.png b/tests/ref/text/quotes.png
index 14bcc933..8d3702b2 100644
--- a/tests/ref/text/quotes.png
+++ b/tests/ref/text/quotes.png
Binary files differ
diff --git a/tests/typ/text/quotes.typ b/tests/typ/text/quotes.typ
index 05812e7c..ec8c5e6a 100644
--- a/tests/typ/text/quotes.typ
+++ b/tests/typ/text/quotes.typ
@@ -25,6 +25,9 @@
#set text(lang: "fi")
"Hevonen ei syö kurkkusalaattia" oli ensimmäinen koskaan 'puhelimessa' lausuttu lause.
+#set text(lang: "he")
+"הסוס לא אוכל סלט מלפפונים" היה המשפט ההראשון שנאמר ב 'טלפון'.
+
#set text(lang: "ro")
"Calul nu mănâncă salată de castraveți" a fost prima propoziție rostită vreodată la 'telefon'.