From d2f85c972140778308afd45f5298020fbbebc6ab Mon Sep 17 00:00:00 2001 From: Majid Shajari Date: Fri, 15 Aug 2025 18:36:22 +0330 Subject: [PATCH] fix(layout): correct persian_farsi and persian_standard layouts, also add persian colemak layouts (@MajidShajari) (#6876) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description update layouts persian_farsi and persian_standard with correct position of key and shift modifier add colemak layouts for personal favorite layout and help to who config this layout to keyboard can training persian word and quotes (Me 😁) ### Checks - [ ] Adding quotes? - [ ] Make sure to include translations for the quotes in the description (or another comment) so we can verify their content. - [ ] Adding a language? - Make sure to follow the [languages documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md) - [ ] Add language to `packages/schemas/src/languages.ts` - [ ] Add language to exactly one group in `frontend/src/ts/constants/languages.ts` - [ ] Add language json file to `frontend/static/languages` - [ ] Adding a theme? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md) - [ ] Add theme to `packages/schemas/src/themes.ts` - [ ] Add theme to `frontend/src/ts/constants/themes.ts` - [ ] Add theme css file to `frontend/static/themes` - [ ] Add some screenshot of the theme, especially with different test settings (colorful, flip colors) to your pull request - [x] Adding a layout? - [x] Make sure to follow the [layouts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md) - [x] Add layout to `packages/schemas/src/layouts.ts` - [x] Add layout json file to `frontend/static/layouts` - [X] Update layout json file to `frontend/static/layouts` - [ ] Adding a font? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md) - [ ] Add font file to `frontend/static/webfonts` - [ ] Add font to `packages/schemas/src/fonts.ts` - [ ] Add font to `frontend/src/ts/constants/fonts.ts` - [ ] Check if any open issues are related to this PR; if so, be sure to tag them below. - [ ] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [ ] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. Closes # --- frontend/static/layouts/persian_farsi.json | 66 +++++++-------- .../static/layouts/persian_farsi_colemak.json | 62 ++++++++++++++ frontend/static/layouts/persian_standard.json | 82 +++++++++---------- .../layouts/persian_standard_colemak.json | 62 ++++++++++++++ packages/schemas/src/layouts.ts | 4 +- 5 files changed, 201 insertions(+), 75 deletions(-) create mode 100644 frontend/static/layouts/persian_farsi_colemak.json create mode 100644 frontend/static/layouts/persian_standard_colemak.json diff --git a/frontend/static/layouts/persian_farsi.json b/frontend/static/layouts/persian_farsi.json index 93f9e4f14..92f01c230 100644 --- a/frontend/static/layouts/persian_farsi.json +++ b/frontend/static/layouts/persian_farsi.json @@ -5,7 +5,7 @@ "row1": [ ["÷", "×"], ["1", "!"], - ["@", "2"], + ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], @@ -18,43 +18,43 @@ ["=", "+"] ], "row2": [ - ["ً", "ض"], - ["ٌ", "ص"], - ["ٍ", "ث"], - ["ق", "ق"], - ["،", "ف"], - ["؛", "غ"], - [",", "ع"], - ["]", "ه"], - ["[", "خ"], - ["ح"], - ["}", "ج"], - ["{", "چ"], - ["|", "پ"] + ["ض", "ً"], + ["ص", "ٌ"], + ["ث", "ٍ"], + ["ق"], + ["ف", "،"], + ["غ", "؛"], + ["ع", ","], + ["ه", "]"], + ["خ", "["], + ["ح", "\\"], + ["ج", "}"], + ["چ", "{"], + ["پ", "|"] ], "row3": [ - ["َ", "ش"], - ["ُ", "س"], - ["ِ", "ی"], - ["ّ", "ب"], - ["ۀ", "ل"], - ["آ", "ا"], - ["ـ", "ت"], - ["«", "ن"], - ["»", "م"], - [":", "ک"], + ["ش", "َ"], + ["س", "ُ"], + ["ی", "ِ"], + ["ب", "ّ"], + ["ل", "ۀ"], + ["ا", "آ"], + ["ت", "ـ"], + ["ن", "«"], + ["م", "»"], + ["ک", ":"], ["گ", "\""] ], "row4": [ - ["ة", "ظ"], - ["ي", "ط"], - ["ژ", "ز"], - ["ؤ", "ر"], - ["إ", "ذ"], - ["أ", "د"], - ["ء", "ئ"], - ["<", "و"], - [">", "."], + ["ظ", "ة"], + ["ط", "ي"], + ["ز", "ژ"], + ["ر", "ؤ"], + ["ذ", "إ"], + ["د", "أ"], + ["ئ", "ء"], + ["و", "<"], + [".", ">"], ["/", "؟"] ], "row5": [[" "]] diff --git a/frontend/static/layouts/persian_farsi_colemak.json b/frontend/static/layouts/persian_farsi_colemak.json new file mode 100644 index 000000000..aa7a59b1c --- /dev/null +++ b/frontend/static/layouts/persian_farsi_colemak.json @@ -0,0 +1,62 @@ +{ + "keymapShowTopRow": false, + "type": "ansi", + "keys": { + "row1": [ + ["÷", "×"], + ["1", "!"], + ["2", "@"], + ["3", "#"], + ["4", "$"], + ["5", "%"], + ["6", "^"], + ["7", "&"], + ["8", "*"], + ["9", ")"], + ["0", "("], + ["-", "_"], + ["=", "+"] + ], + "row2": [ + ["ض", "ً"], + ["ص", "ٌ"], + ["ب", "ّ"], + ["ح", "\\"], + ["ل", "ۀ"], + ["ت", "ـ"], + ["م", "»"], + ["ع", ","], + ["غ", "؛"], + ["ک", ":"], + ["ج", "}"], + ["چ", "{"], + ["پ", "|"] + ], + "row3": [ + ["ش", "َ"], + ["ق"], + ["س", "ُ"], + ["ف", "،"], + ["ی", "ِ"], + ["ا", "آ"], + ["د", "أ"], + ["ث", "ٍ"], + ["ه", "]"], + ["خ", "["], + ["گ", "\""] + ], + "row4": [ + ["ظ", "ة"], + ["ط", "ي"], + ["ز", "ژ"], + ["ر", "ؤ"], + ["ذ", "إ"], + ["ن", "«"], + ["ئ", "ء"], + ["و", "<"], + [".", ">"], + ["/", "؟"] + ], + "row5": [[" "]] + } +} diff --git a/frontend/static/layouts/persian_standard.json b/frontend/static/layouts/persian_standard.json index d224d79c1..16c70e271 100644 --- a/frontend/static/layouts/persian_standard.json +++ b/frontend/static/layouts/persian_standard.json @@ -4,57 +4,57 @@ "keys": { "row1": [ ["`", "~"], - ["1", "!"], - ["2", "@"], - ["3", "#"], - ["4", "$"], - ["5", "%"], - ["6", "^"], - ["7", "&"], - ["8", "*"], - ["9", "("], - ["0", ")"], - ["-", "_"], + ["۱", "!"], + ["۲", "٬"], + ["۳", "٫"], + ["۴"], + ["۵", "٪"], + ["۶", "×"], + ["۷", "،"], + ["۸", "*"], + ["۹", ")"], + ["۰", "("], + ["-", "ـ"], ["=", "+"] ], "row2": [ - ["ض"], - ["ص"], - ["ث"], - ["ق"], - ["ف"], - ["غ"], - ["ع"], - ["ه"], - ["خ"], - ["ح"], - ["ج"], - ["چ"], - ["\""] + ["ض", "ْ"], + ["ص", "ٌ"], + ["ث", "ٍ"], + ["ق", "ً"], + ["ف", "ُ"], + ["غ", "ِ"], + ["ع", "َ"], + ["ه", "ّ"], + ["خ", "]"], + ["ح", "["], + ["ج", "}"], + ["چ", "}"], + ["\\", "{"] ], "row3": [ - ["ش"], - ["س"], - ["ی"], - ["ب"], - ["ل"], + ["ش", "ؤ"], + ["س", "ئ"], + ["ی", "ي"], + ["ب", "إ"], + ["ل", "أ"], ["ا", "آ"], - ["ت"], - ["ن"], - ["م"], - ["ک"], - ["گ"] + ["ت", "ة"], + ["ن", "»"], + ["م", "«"], + ["ک", ":"], + ["گ", "؛"] ], "row4": [ - ["ظ"], - ["ط"], + ["ظ", "ك"], + ["ط", "ط"], ["ز", "ژ"], - ["ر"], + ["ر", "ٰ"], ["ذ"], - ["د"], - ["پ"], - ["و"], - ["."], + ["د", "ٔ"], + ["پ", "ء"], + ["و", ">"], + [".", "<"], ["/", "?"] ], "row5": [[" "]] diff --git a/frontend/static/layouts/persian_standard_colemak.json b/frontend/static/layouts/persian_standard_colemak.json new file mode 100644 index 000000000..7c57e764b --- /dev/null +++ b/frontend/static/layouts/persian_standard_colemak.json @@ -0,0 +1,62 @@ +{ + "keymapShowTopRow": true, + "type": "ansi", + "keys": { + "row1": [ + ["گ", "؛"], + ["۱", "!"], + ["۲", "٬"], + ["۳", "٫"], + ["۴"], + ["۵", "٪"], + ["۶", "×"], + ["۷", "،"], + ["۸", "*"], + ["۹", ")"], + ["۰", ")"], + ["-", "ـ"], + ["=", "+"] + ], + "row2": [ + ["ض", "ْ"], + ["ص", "ٌ"], + ["ب", "إ"], + ["ح", "["], + ["ل", "أ"], + ["ت", "ة"], + ["م", "«"], + ["ع", "َ"], + ["غ", "ِ"], + ["ک", ":"], + ["\\", "|"], + ["ج", "}"], + ["چ", "{"] + ], + "row3": [ + ["ش", "ؤ"], + ["ق", "ً"], + ["س", "ئ"], + ["ف", "ُ"], + ["ی", "ي"], + ["ا", "آ"], + ["د", "ٔ"], + ["ث", "ٍ"], + ["ه", "ّ"], + ["خ", "]"], + ["گ", "؛"] + ], + "row4": [ + ["ظ", "ك"], + ["ط", "ط"], + ["ز", "ژ"], + ["ر", "ٰ"], + ["ذ", "‌"], + ["ن", "»"], + ["پ", "ء"], + ["و", ">"], + [".", "<"], + ["/", "؟"] + ], + "row5": [[" "]] + } +} diff --git a/packages/schemas/src/layouts.ts b/packages/schemas/src/layouts.ts index e20d0c2e4..01ecbba3a 100644 --- a/packages/schemas/src/layouts.ts +++ b/packages/schemas/src/layouts.ts @@ -219,7 +219,9 @@ export const LayoutNameSchema = z.enum([ "tarmak_3", "tarmak_4", "rulemak", - ], + "persian_farsi_colemak", + "persian_standard_colemak", + ], { errorMap: customEnumErrorHandler("Must be a supported layout"), }