From 09f27033e23880b314a3c2972f0d583500da8591 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 7 Feb 2024 13:43:44 +0100 Subject: [PATCH 1/6] Mention Weblate in the README --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index f2201d4..be800cd 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,29 @@ If you _really_ have to use Docker, there is **I will not** provide support for Docker-based deployments in the observable future. +## Contribute + +### Source code + +TL;DR: `pnpm install && pnpm dev` + +See [contributing guide](CONTRIBUTING.md#improving-code) for instructions on how to contribute +source code to the project, including adding new Fediverse projects. + +### Translations + +Share₂Fedi uses Hosted Weblate for translations. [You can edit translations using it's practical interface.](https://hosted.weblate.org/engage/share2fedi/). You also could do it manually by editing files in `src/i18n/translations`, but this is NOT recommended. + + +Translation status + + +> [!NOTE] +> New languages do not become automatically available. For this, a separate change to our ad-hoc i18n engine has to be made. +> See [contributing guide](CONTRIBUTING.md#translating) for instructions + +_We thank Weblate for providing Libre hosting!_ + ## See also **[📯 Shareon](https://shareon.js.org)** (lightweight, stylish, and ethical From 5fabf5768ec3e27eb2faca71cc4b89fe178e7af3 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 7 Feb 2024 12:54:28 +0000 Subject: [PATCH 2/6] Fix formatting --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index be800cd..d88f5b5 100644 --- a/README.md +++ b/README.md @@ -144,20 +144,24 @@ future. TL;DR: `pnpm install && pnpm dev` -See [contributing guide](CONTRIBUTING.md#improving-code) for instructions on how to contribute -source code to the project, including adding new Fediverse projects. +See [contributing guide](CONTRIBUTING.md#improving-code) for instructions on how +to contribute source code to the project, including adding new Fediverse +projects. ### Translations -Share₂Fedi uses Hosted Weblate for translations. [You can edit translations using it's practical interface.](https://hosted.weblate.org/engage/share2fedi/). You also could do it manually by editing files in `src/i18n/translations`, but this is NOT recommended. +Share₂Fedi uses Hosted Weblate for translations. +[You can edit translations using it's practical interface.](https://hosted.weblate.org/engage/share2fedi/). +You also could do it manually by editing files in `src/i18n/translations`, but +this is NOT recommended. Translation status -> [!NOTE] -> New languages do not become automatically available. For this, a separate change to our ad-hoc i18n engine has to be made. -> See [contributing guide](CONTRIBUTING.md#translating) for instructions +> [!NOTE] New languages do not become automatically available. For this, a +> separate change to our ad-hoc i18n engine has to be made. See +> [contributing guide](CONTRIBUTING.md#translating) for instructions _We thank Weblate for providing Libre hosting!_ From 8d060bfd888e5e4982bf2e80e2188799240711ae Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 7 Feb 2024 13:05:09 +0000 Subject: [PATCH 3/6] Update contributing guide --- CONTRIBUTING.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad2470c..d8615c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,15 +87,35 @@ form of JSON-based dictionaries. There are two ways you can add/edit translations: -1. The JSON files under `src/i18n/translations` represent dictionaried for +1. [Weblate](https://hosted.weblate.org/engage/share2fedi/), a web-based tool + that simplifies this process. + - we use Hosted Weblate. You can login using any account. Make sure to set + the correct email so that the changes can be attributed to you! + - Weblate handles PRs automatically. You do not need to do anything other + than use it to edit translations +2. The JSON files under `src/i18n/translations` represent dictionaried for different languages. The two-letter codes correspond to the ISO 639-1 language codes. - to edit translations, just edit the files. Refer to [the coding guide](#improving-code) for more information on how to do this. -2. [Weblate](https://translate.codeberg.org/engage/share2fedi/), a web-based - tool that simplifies this process. - - we use Codeberg's Weblate instance, which requires a Codeberg account. If - you have one, this is the easiest way to edit translations. + +### Adding new languages + +You may notice that adding a new language in Weblate or in the code does not add +it to the language dropdown. This is due to the i18n needing to define the +languages for the dropdown. + +To add a new language, edit the `src/i18n/translations.ts` file. Import the JSON +file with the translations and add a new entry to the `languages` mapping. + +> [!IMPORTANT] For the language name, use a **capitalized autonym**. An autonym +> is the name of the language in the language itself. You can consult CLDR or +> Wikipedia for this. It should be capitalized, if it makes sense in the +> language. It should NOT include the word "language" unless it's common to use +> it ("Bahasa Indonesia", but "Русский", not "русский язык") +> +> A good rule of thumb is to take the value that Wikipedia uses in their +> [language list](https://www.wikipedia.org/#js-lang-lists). ## Reporting bugs From 13c4bab2ef65fcd90948e76f80047f0aba0a820e Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 7 Feb 2024 14:07:07 +0100 Subject: [PATCH 4/6] Fix formatting in CONTRIBUTING.md --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d8615c8..cba7c50 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,8 @@ languages for the dropdown. To add a new language, edit the `src/i18n/translations.ts` file. Import the JSON file with the translations and add a new entry to the `languages` mapping. -> [!IMPORTANT] For the language name, use a **capitalized autonym**. An autonym +> [!IMPORTANT] +> For the language name, use a **capitalized autonym**. An autonym > is the name of the language in the language itself. You can consult CLDR or > Wikipedia for this. It should be capitalized, if it makes sense in the > language. It should NOT include the word "language" unless it's common to use From c2cc47a0da23b15f0768757de7727cb83ac788f2 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 7 Feb 2024 14:07:26 +0100 Subject: [PATCH 5/6] Fix formatting in README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d88f5b5..e7d1476 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,8 @@ this is NOT recommended. Translation status -> [!NOTE] New languages do not become automatically available. For this, a +> [!NOTE] +> New languages do not become automatically available. For this, a > separate change to our ad-hoc i18n engine has to be made. See > [contributing guide](CONTRIBUTING.md#translating) for instructions From 2ce8c0fcb854d2016ffb243ba2c827d9eb7ae0ee Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Wed, 7 Feb 2024 14:31:42 +0100 Subject: [PATCH 6/6] Disable prose wrap for Prettier --- CHANGELOG.md | 3 +-- package.json | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0d2ed6..4b59969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -279,5 +279,4 @@ Initial release of the site [1.1.2]: https://github.com/kytta/share2fedi/compare/v1.1.1...v1.1.2 [1.1.1]: https://github.com/kytta/share2fedi/compare/v1.1.0...v1.1.1 [1.1.0]: https://github.com/kytta/share2fedi/compare/v1.0.0...v1.1.0 -[1.0.0]: - https://github.com/kytta/share2fedi/compare/e85aa15400bcdbcccf655d331f72df8304744b85...v1.0.0 +[1.0.0]: https://github.com/kytta/share2fedi/compare/e85aa15400bcdbcccf655d331f72df8304744b85...v1.0.0 diff --git a/package.json b/package.json index ca8a79c..0791c4e 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,6 @@ "assets/*.{png,svg}": "pnpm run build:icons" }, "prettier": { - "proseWrap": "always", "singleAttributePerLine": true }, "stylelint": {