Skip to content

Commit

Permalink
Format Markdown files
Browse files Browse the repository at this point in the history
Signed-off-by: William So <[email protected]>
  • Loading branch information
polyipseity committed Jan 4, 2024
1 parent 8b9aea0 commit 4ca96f1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @polyipseity/obsidian-plugin-library
# @polyipseity/obsidian-plugin-library <!-- markdownlint-disable MD024 -->

## 1.24.0

Expand Down Expand Up @@ -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. (<https://2ality.com/2012/01/objects-as-maps.html>)
- 19084bc: Create `AbstractSettingsManager` and `LocalSettingsManager` in `settings.ts`.
- c0a3261: Use `localStorage` when storing temporary settings.

Expand Down
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 4ca96f1

Please sign in to comment.