-
How to get the language's direction (rtl / ltr)? |
Beta Was this translation helpful? Give feedback.
Answered by
ivanhofer
Feb 3, 2023
Replies: 2 comments
-
You need to implement it yourself. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
omar2205
-
for anyone looking for a quicky: import type { Locales } from "./i18n-types";
type LanguageDirection = "ltr" | "rtl";
type LanguageDirectionMap = { [K in Locales]: LanguageDirection };
const languageDirection: LanguageDirectionMap = {
en: "ltr",
he: "rtl",
};
export function dir(locale: Locales) {
return languageDirection[locale];
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to implement it yourself.
typesafe-i18n
has no locale mapping built-in.