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