Skip to content

Commit

Permalink
Add arabic locale
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Oct 25, 2023
1 parent b7ff84f commit 1278465
Show file tree
Hide file tree
Showing 4 changed files with 644 additions and 2 deletions.
17 changes: 16 additions & 1 deletion components/DateRangePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import fr from 'date-fns/locale/fr'
import is from 'date-fns/locale/is'
import ru from 'date-fns/locale/ru'
import tr from 'date-fns/locale/tr'
import ar from 'date-fns/locale/ar'
import pt from 'date-fns/locale/pt'
import th from 'date-fns/locale/th'
import vi from 'date-fns/locale/vi'
import zh from 'date-fns/locale/zh-CN'
import zhHant from 'date-fns/locale/zh-HK'

const StyledDatetime = styled.div`
z-index: 99999;
Expand Down Expand Up @@ -58,16 +63,26 @@ const getDateFnsLocale = locale => {
return es
case 'fa':
return fa
case 'ar':
return ar
case 'fr':
return fr
case 'is':
return is
case 'pt-BR':
return pt
case 'ru':
return ru
case 'tr':
return tr
case 'zh':
case 'th':
return th
case 'vi':
return vi
case 'zh-CN':
return zh
case 'zh-Hant':
return zhHant
default:
return en
}
Expand Down
1 change: 1 addition & 0 deletions components/withIntl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useRouter } from 'next/router'
export const getDirection = locale => {
switch (locale) {
case 'fa':
case 'ar':
return 'rtl'
default:
return 'ltr'
Expand Down
Loading

1 comment on commit 1278465

@vercel
Copy link

@vercel vercel bot commented on 1278465 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

explorer – ./

explorer-ooni1.vercel.app
explorer-git-master-ooni1.vercel.app
explorer-one.vercel.app

Please sign in to comment.