Skip to content

Commit

Permalink
docs: forgot instruction for translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li authored Jan 17, 2024
1 parent c1a81f6 commit fe24bbf
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Will set the value for desktop and mobile to different amount of time.

After changing the setting, you need to reload the plugin.

---
-
# Installation

- [x] From Obsidian's community plugins
Expand All @@ -129,17 +129,22 @@ After changing the setting, you need to reload the plugin.
- In Obsidian settings, reload the plugin
- Enable the plugin

# Translations
# 🎼 Translation

- [x] English
- [x] French

To add a translation:
- Fork the repository
- Add a new file in `plugin/i18n/locales` with the name of the language (ex: `de.ts`)
- Copy the content of [`plugin/i18n/locales/en.ts`](src/i18n/locales/en.json) in the new file
- Translate the content of the file
- Create a pull request
1. Fork the repository
2. Add the translation in the `src/i18n/locales` folder with the name of the language (ex: `fr.json`).
- You can get your locale language from Obsidian using [obsidian translation](https://github.com/obsidianmd/obsidian-translations) or using the commands (in templater for example) : `<% tp.obsidian.moment.locale() %>`
- Copy the content of the [`en.json`](./src/i18n/locales/en.json) file in the new file
- Translate the content
3. Edit `i18n/i18next.ts` :
- Add `import * as <lang> from "./locales/<lang>.json";`
- Edit the `ressource` part with adding : `<lang> : {translation: <lang>}`

---

# Credit
Many thanks to @SilentVoid13 and @RafaelGB for their [Templater](https://github.com/SilentVoid13/Templater) and [dbFolder](https://github.com/RafaelGB/obsidian-db-folder), where some part of the code where taken.
Expand Down

0 comments on commit fe24bbf

Please sign in to comment.