From 0ee3e7153de4eb3ec2cd21d6a030c816bbb8c3e5 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 17 Jun 2024 22:17:28 -0700 Subject: [PATCH] Docs tweaks --- docs/widgets/authoring/index.md | 12 +++++------ docs/widgets/authoring/metadata.md | 2 +- docs/widgets/authoring/translations.md | 28 +++++++++++++++++--------- docs/widgets/authoring/tutorial.md | 20 ++---------------- 4 files changed, 26 insertions(+), 36 deletions(-) diff --git a/docs/widgets/authoring/index.md b/docs/widgets/authoring/index.md index 0070e52dd..297629b4c 100644 --- a/docs/widgets/authoring/index.md +++ b/docs/widgets/authoring/index.md @@ -14,22 +14,20 @@ If you are new to Homepage widgets, and are looking to create a new widget, plea All text and numerical content in widgets should be translated and localized. English is the default language, and other languages can be added via [Crowdin](https://crowdin.com/project/gethomepage). -The Homepage community prides itself on being multilingual, and we strongly encourage you to add translations for your widgets. - -If you are looking to learn more about translations, please refer to the guide here: [Translations Guide](translations.md). +To learn more about translations, please refer to the guide here: [Translations Guide](translations.md). ### Widget Component The widget component is the core of the widget. It is responsible for [fetching data from the API](api.md) and rendering the widget UI. Homepage provides a set of hooks and utilities to help you build your widget component. -If you are looking to learn more about widget components, please refer to the guide here: [Component Guide](component.md). +To learn more about widget components, please refer to the guide here: [Component Guide](component.md). ### Widget Metadata Widget metadata defines the configuration of the widget. It defines the API endpoint to fetch data from, the proxy handler to use, and any data mappings. -If you are looking to learn more about widget metadata, endpoint and data mapping, please refer to the guide here: [Metadata Guide](metadata.md). +To learn more about widget metadata, endpoint and data mapping, please refer to the guide here: [Metadata Guide](metadata.md). -If you are looking to learn more about proxy handlers, please refer to the guide here: [Proxies Guide](proxies.md). +To learn more about proxy handlers, please refer to the guide here: [Proxies Guide](proxies.md). -If you are looking to learn more making API calls from inside your widget, please refer to the guide here: [API Guide](api.md). +To learn more about making API calls from inside your widget, please refer to the guide here: [API Guide](api.md). diff --git a/docs/widgets/authoring/metadata.md b/docs/widgets/authoring/metadata.md index e67dc3962..63e464e11 100644 --- a/docs/widgets/authoring/metadata.md +++ b/docs/widgets/authoring/metadata.md @@ -56,7 +56,7 @@ Here are some examples of how to configure a widget's metadata object. }; ``` -A widgets metadata is quite powerful and can be configured in many different ways. +A widget's metadata is quite powerful and can be configured in many different ways. ## Configuration Properties diff --git a/docs/widgets/authoring/translations.md b/docs/widgets/authoring/translations.md index 06a6e39da..13473f05b 100644 --- a/docs/widgets/authoring/translations.md +++ b/docs/widgets/authoring/translations.md @@ -5,8 +5,6 @@ description: Tips and tricks for translating and localizing Homepage widgets. All text and numerical content in widgets should be translated and localized. English is the default language, and other languages can be added via [Crowdin](https://crowdin.com/project/gethomepage). -The Homepage community prides itself on being multilingual, and we strongly encourage you to add translations for your widgets. - ## Translations Homepage uses the [next-i18next](https://github.com/i18next/next-i18next) library to handle translations. This library provides a set of hooks and utilities to help you localize your widgets, and Homepage has extended this library to support additional features. @@ -32,15 +30,25 @@ Homepage uses the [next-i18next](https://github.com/i18next/next-i18next) librar } ``` -=== "en.json" +## Set up translation strings - ```json - "yourwidget": { - "key1": "Value 1", - "key2": "Value 2", - "key3": "Value 3" - } - ``` +Homepage uses translated and localized strings for **all text and numerical content** in widgets. English is the default language, and other languages can be added via [Crowdin](https://crowdin.com/project/gethomepage). To add the English translations for your widget, follow these steps: + +Open the `public/locales/en/common.js` file. + +Add a new object for your widget to the bottom of the list, like this: + +```json +"yourwidget": { + "key1": "Value 1", + "key2": "Value 2", + "key3": "Value 3" +} +``` + +!!! note + + Even if you natively speak another language, you should only add English translations. You can then add translations in your native language via [Crowdin](https://crowdin.com/project/gethomepage), once your widget is merged. ## Common Translations diff --git a/docs/widgets/authoring/tutorial.md b/docs/widgets/authoring/tutorial.md index 4d3ddbb5f..d9fef90b7 100644 --- a/docs/widgets/authoring/tutorial.md +++ b/docs/widgets/authoring/tutorial.md @@ -55,25 +55,9 @@ export default widget; All widgets that fetch data from dynamic endpoints should have either `mappings` or an `allowedEndpoints` property. -## Set up translation strings +## Including translation strings in your widget -Homepage uses translated and localized strings for **all text and numerical content** in widgets. English is the default language, and other languages can be added via [Crowdin](https://crowdin.com/project/gethomepage). To add the English translations for your widget, follow these steps: - -Open the `public/locales/en/common.js` file. - -Add a new object for your widget to the bottom of the list, like this: - -```json -"yourwidget": { - "key1": "Value 1", - "key2": "Value 2", - "key3": "Value 3" -} -``` - -!!! note - - Even if you nativly speak another language, you should only add English translations. You can then add translations in your native language via [Crowdin](https://crowdin.com/project/gethomepage), once your widget is merged. +Refer to the [translations guide](translations.md) for more details. The Homepage community prides itself on being multilingual, and we strongly encourage you to add translations for your widgets. ## Create the widget component