Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Mark Hebrew locale as RTL
Mike Cao0b31d3a274f6
diff --git a/src/lib/lang.test.ts b/src/lib/lang.test.tsindex e4c01a7a4..e60fa6dc4 100644--- a/src/lib/lang.test.ts+++ b/src/lib/lang.test.ts@@ -20,17 +20,10 @@ describe('getTextDirection', () => {test('returns rtl for right-to-left languages', () => {expect(getTextDirection('ar-SA')).toBe('rtl');expect(getTextDirection('fa-IR')).toBe('rtl');+ expect(getTextDirection('he-IL')).toBe('rtl');expect(getTextDirection('ur-PK')).toBe('rtl');});- // NOTE: Hebrew (he-IL) is a right-to-left language but is NOT marked with- // `dir: 'rtl'` in `languages`, so getTextDirection returns 'ltr'. This asserts- // the current (suspected buggy) behavior. If the source is fixed to add- // `dir: 'rtl'` for he-IL, update this expectation to 'rtl'.- test('does not mark Hebrew as rtl (suspected source bug)', () => {- expect(getTextDirection('he-IL')).toBe('ltr');- });-test('returns ltr for left-to-right languages', () => {expect(getTextDirection('en-US')).toBe('ltr');expect(getTextDirection('fr-FR')).toBe('ltr');diff --git a/src/lib/lang.ts b/src/lib/lang.tsindex f874640c4..20737a334 100644--- a/src/lib/lang.ts+++ b/src/lib/lang.ts@@ -67,7 +67,7 @@ export const languages = {'fo-FO': { label: 'Føroyskt' },'fr-FR': { label: 'Français', dateLocale: fr },'ga-ES': { label: 'Galacian (Spain)', dateLocale: es },- 'he-IL': { label: 'עברית', dateLocale: he },+ 'he-IL': { label: 'עברית', dateLocale: he, dir: 'rtl' },'hi-IN': { label: 'हिन्दी', dateLocale: hi },'hr-HR': { label: 'Hrvatski', dateLocale: hr },'hu-HU': { label: 'Hungarian', dateLocale: hu },