Skip to content

Commit 6ac93f9

Browse files
committed
refactor: use parenthesis for third level of list in arabic (#513)
Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
1 parent 4fa06d6 commit 6ac93f9

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

OUDS/Core/Components/Sources/ContentDisplay/BulletList/Internal/Bullet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ struct OrderedBullet: View {
192192

193193
static func levelTwoBullet(for index: UInt8) -> String {
194194
if OUDSUtils.isArabicLanguageInUse() {
195-
OUDSUtils.cyclicArabicLetter(at: index) + "." // NOTE: . won't be leading but trailing, arabic alphabet in use
195+
"(" + OUDSUtils.cyclicArabicLetter(at: index) + ")" + "." // NOTE: . won't be leading but trailing, arabic alphabet in use
196196
} else {
197197
OUDSUtils.cyclicLatinLetter(at: index, isUppercase: false) + "."
198198
}

OUDS/Foundations/Sources/OUDSUtils.swift

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,35 @@ public enum OUDSUtils {
6666
/// - Returns: A letter or group of letters
6767
public static func cyclicArabicLetter(at index: UInt8) -> String {
6868
let arabicLetters: [String] = [
69-
"ا", "ب", "ت", "ث", "ج", "ح", "خ", "أ",
70-
"ذ", "ر", "ز", "س", "ش", "ص", "ض", "ط",
71-
"ظ", "ع", "غ", "ف", "ق", "ك", "ل", "م",
72-
"ن", "ه", "و", "ي",
73-
] // WARNING: The first symbol "ا" is not good but it seems Xcode does not manage the suitable letter
69+
"أ",
70+
"ب",
71+
"ت",
72+
"ث",
73+
"ج",
74+
"ح",
75+
"خ",
76+
"د",
77+
"ذ",
78+
"ر",
79+
"ز",
80+
"س",
81+
"ش",
82+
"ص",
83+
"ض",
84+
"ط",
85+
"ظ",
86+
"ع",
87+
"غ",
88+
"ف",
89+
"ق",
90+
"ك",
91+
"ل",
92+
"م",
93+
"ن",
94+
"ه",
95+
"و",
96+
"ي",
97+
]
7498

7599
let alphabetSize = arabicLetters.count
76100
var idx = Int(index)

0 commit comments

Comments
 (0)