Skip to content

Commit

Permalink
Docs tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed Jun 18, 2024
1 parent 11cc4a1 commit 0ee3e71
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 36 deletions.
12 changes: 5 additions & 7 deletions docs/widgets/authoring/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
2 changes: 1 addition & 1 deletion docs/widgets/authoring/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 18 additions & 10 deletions docs/widgets/authoring/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
20 changes: 2 additions & 18 deletions docs/widgets/authoring/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0ee3e71

Please sign in to comment.