From 4ca96f1e44f67a5957631f3a2a9e480b40b1e983 Mon Sep 17 00:00:00 2001 From: William So Date: Thu, 4 Jan 2024 15:13:49 +0800 Subject: [PATCH] Format Markdown files Signed-off-by: William So --- .eslintrc.json | 13 +++++++++++++ CHANGELOG.md | 4 ++-- README.md | 37 +++++++++++++++++++++---------------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index be3e922..43b92b6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -437,6 +437,19 @@ ], "semi": "off" } + }, + { + "files": [ + "*.md" + ], + "parser": "eslint-plugin-markdownlint/parser", + "extends": [ + "plugin:markdownlint/recommended" + ], + "rules": { + "max-len": "off", + "markdownlint/md013": "off" + } } ], "parser": "espree", diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b95d0..f3d6d87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# @polyipseity/obsidian-plugin-library +# @polyipseity/obsidian-plugin-library ## 1.24.0 @@ -38,7 +38,7 @@ ### Minor Changes -- ab5a83c: Replace some `Record`s with `Map`s. (https://2ality.com/2012/01/objects-as-maps.html) +- ab5a83c: Replace some `Record`s with `Map`s. () - 19084bc: Create `AbstractSettingsManager` and `LocalSettingsManager` in `settings.ts`. - c0a3261: Use `localStorage` when storing temporary settings. diff --git a/README.md b/README.md index 3f3d806..560baf9 100644 --- a/README.md +++ b/README.md @@ -35,35 +35,40 @@ Translation files are under [`assets/locales/`](assets/locales/). Each locale ha To contribute translation for an existing locale, modify the files in the corresponding directory. For a new locale, create a new directory named with its language tag and copy [`assets/locales/en/translation.json`](assets/locales/en/translation.json) into it. Then, add an entry to [`assets/locales/en/language.json`](assets/locales/en/language.json) in this format: + ```JSONc { - // ... - "en": "English", - "(your-language-tag)": "(Native name of your language)", - "uwu": "Uwuish", - // ... + // ... + "en": "English", + "(your-language-tag)": "(Native name of your language)", + "uwu": "Uwuish", + // ... } ``` + Sort the list of languages by the alphabetical order of their language tags. Then modify the files in the new directory. There will be errors in [`assets/locales.ts`](assets/locales.ts), which you can ignore and we will fix them for you. You are welcome to fix them yourself if you know TypeScript. When translating, keep in mind the following things: + - Do not translate anything between `{{` and `}}` (`{{example}}`). They are __interpolations__ and will be replaced by localized strings at runtime. - Do not translate anything between `$t(` and `)` (`$t(example)`). They refer to other localized strings. To find the localized string being referred to, follow the path of the key, which is separated by dots (`.`). For example, the key [`youtu.be./dQw4w9WgXcQ`](https://youtu.be./dQw4w9WgXcQ) refers to: + ```JSONc { - // ... - "youtu": { - // ... - "be": { - // ... - "/dQw4w9WgXcQ": "I am 'youtu.be./dQw4w9WgXcQ'!", - // ... - }, - // ... - }, - // ... + // ... + "youtu": { + // ... + "be": { + // ... + "/dQw4w9WgXcQ": "I am 'youtu.be./dQw4w9WgXcQ'!", + // ... + }, + // ... + }, + // ... } ``` + - The keys under `generic` are vocabularies. They can be referred in translation strings by `$t(generic.key)`. Refer to them as much as possible to standardize translations for vocabularies that appear in different places. - It is okay to move interpolations and references to other localized strings around to make the translation natural. It is also okay to not use some references used in the original translation. However, it is NOT okay to not use all interpolations.