Skip to content

Commit a7f4a65

Browse files
committed
add fa-num to language list
1 parent 70ae911 commit a7f4a65

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

‎.storybook/preview.tsx‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ const preview: Preview = {
3838
i18n.addEventListener("localeChange",()=>{
3939
setKey(context.globals.locale);
4040
})
41-
document.documentElement.lang = context.globals.locale;
41+
if(context.globals.locale == 'fa-num'){
42+
document.documentElement.lang = 'fa';
43+
i18n.setLocale(new Intl.Locale('fa',{calendar: 'persian',numberingSystem:'arabext'}))
44+
}else{
45+
document.documentElement.lang = context.globals.locale;
46+
}
4247
}
4348
},[context.globals.locale])
4449
return <Story key={key}/>
@@ -54,6 +59,7 @@ const preview: Preview = {
5459
items: [
5560
{ value: 'en', right: '🇺🇸', title: 'English' },
5661
{ value: 'fa', right: '🇮🇷', title: 'Farsi(Persian)' },
62+
{ value: 'fa-num', right: '🇮🇷', title: 'Farsi with fa Numbers' },
5763
],
5864
},
5965
},

0 commit comments

Comments
 (0)