diff --git a/frontend/common/lang.js b/frontend/common/lang.js index 0bacbc9b0d..bafc1afb13 100644 --- a/frontend/common/lang.js +++ b/frontend/common/lang.js @@ -8,6 +8,7 @@ import { deutsch, ellinika, english, + farsi, french, nederlands, norsk_bokmål, @@ -31,6 +32,9 @@ i18next.use(LanguageDetector).init({ en: { translation: without_empty_keys(english), }, + fa: { + translation: without_empty_keys(farsi), + }, fi: { translation: without_empty_keys(suomi), }, @@ -90,6 +94,10 @@ export const getCurrentLanguage = () => { return i18next.language } +export const getWritingDirection = () => { + return t("t_language_direction") === "rtl" ? "rtl" : "ltr" +} + /** * Like t, but you can interpolate Preact elements. * @param {string} key diff --git a/frontend/common/lang_imports.js b/frontend/common/lang_imports.js index aa6be6cad1..bfd19e205a 100644 --- a/frontend/common/lang_imports.js +++ b/frontend/common/lang_imports.js @@ -8,6 +8,7 @@ export { default as deutsch } from "../lang/deutsch.json" with { type: "json" } export { default as ellinika } from "../lang/ellinika.json" with { type: "json" } export { default as english } from "../lang/english.json" with { type: "json" } +export { default as farsi } from "../lang/farsi.json" with { type: "json" } export { default as french } from "../lang/french.json" with { type: "json" } export { default as nederlands } from "../lang/nederlands.json" with { type: "json" } export { default as norsk_bokmål } from "../lang/norsk_bokmål.json" with { type: "json" } diff --git a/frontend/components/CellInput.js b/frontend/components/CellInput.js index 3c38d55e51..e43fc1c7bd 100644 --- a/frontend/components/CellInput.js +++ b/frontend/components/CellInput.js @@ -1024,7 +1024,13 @@ const InputContextMenu = ({ > ${open ? html`