@oxyhq/core 1.11.13 → 1.11.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -156,3 +156,24 @@ export function normalizeLanguageCode(lang) {
156
156
  };
157
157
  return map[lang] || lang;
158
158
  }
159
+ /**
160
+ * RTL language detection.
161
+ *
162
+ * Returns `true` when the given BCP-47 tag or bare language code is one
163
+ * of the right-to-left scripts we ship UI for. Apps use this to drive
164
+ * `I18nManager.allowRTL(true)` / `forceRTL(...)` on React Native and the
165
+ * `<html dir="rtl">` attribute on web.
166
+ *
167
+ * Includes Arabic (`ar`), Hebrew (`he` / legacy `iw`), Persian (`fa`),
168
+ * Urdu (`ur`) plus their common region variants. Unknown tags are
169
+ * treated as LTR.
170
+ */
171
+ const RTL_LANGUAGE_BASES = new Set(['ar', 'he', 'iw', 'fa', 'ur']);
172
+ export function isRTLLocale(locale) {
173
+ if (!locale)
174
+ return false;
175
+ const base = locale.toLowerCase().split('-')[0];
176
+ if (!base)
177
+ return false;
178
+ return RTL_LANGUAGE_BASES.has(base);
179
+ }