Download apps/readest-app/src/utils/rtl.ts from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/utils/rtl.ts
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/utils/rtl.ts
-
curl -L -o rtl.ts https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/utils/rtl.ts
433 Bytes
| import { getUserLang } from './misc'; | |
| export const getDirFromLanguage = (lang: string) => { | |
| if (!lang) return 'auto'; | |
| const rtlLanguages = new Set(['ar', 'he', 'fa', 'ur', 'dv', 'ps', 'sd', 'yi']); | |
| const primaryLang = lang.split('-')[0]!.toLowerCase(); | |
| return rtlLanguages.has(primaryLang) ? 'rtl' : 'auto'; | |
| }; | |
| export const getDirFromUILanguage = () => { | |
| const lang = getUserLang(); | |
| return getDirFromLanguage(lang); | |
| }; | |