mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Docs tweaks
This commit is contained in:
parent
11cc4a15cf
commit
0ee3e7153d
@ -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).
|
||||
|
@ -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
|
||||
|
||||
|
@ -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,7 +30,13 @@ Homepage uses the [next-i18next](https://github.com/i18next/next-i18next) librar
|
||||
}
|
||||
```
|
||||
|
||||
=== "en.json"
|
||||
## Set up translation strings
|
||||
|
||||
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": {
|
||||
@ -42,6 +46,10 @@ Homepage uses the [next-i18next](https://github.com/i18next/next-i18next) librar
|
||||
}
|
||||
```
|
||||
|
||||
!!! 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
|
||||
|
||||
Homepage provides a set of common translations that you can use in your widgets. These translations are used to format numerical content, dates, and other common elements.
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user