1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1x 1x 1x 1x 1x 2x 2x | /** * Expose ltr and rtl strings */ export enum Direction { ltr = "ltr", rtl = "rtl" } export interface ILocaleDirectionMapping { [key: string]: Direction; } export const localeDirectionMapping: ILocaleDirectionMapping = { "en": Direction.ltr, "en-rtl": Direction.rtl }; export default function isRTL(locale: string): boolean { Eif (localeDirectionMapping[locale]) { return localeDirectionMapping[locale] === Direction.rtl; } return false; } |