-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: content delivery + webhooks (#501)
Co-authored-by: Jan Cizmar <[email protected]>
- Loading branch information
Showing
35 changed files
with
1,079 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
slug: tolgee-content-delivery-and-webhooks | ||
title: 'Boost localization automation with Content Delivery and Webhooks' | ||
description: A new content delivery feature allows you to keep your localization files outside of your code. It's a part of our long-term goal to make localization as easy as possible. | ||
authors: [sgranat] | ||
tags: ['tolgee', 'cloud', 'content-delivery', 'webhooks'] | ||
image: '/img/blog/content-delivery/content-delivery.webp' | ||
--- | ||
|
||
Recently, we've received many requests from our users to simplify the update of translations on production, and now we have an answer. Say Hi to Tolgee **Content Delivery**, a fast and reliable way to keep your translations independent of your code! Also introducing **Webhooks** for more automation options. | ||
|
||
![Content delivery](/img/blog/content-delivery/content-delivery.webp) | ||
|
||
<!-- truncate--> | ||
|
||
import { ScreenshotWrapper } from '../platform/shared/_ScreenshotWrapper'; | ||
|
||
## Load your translations from the cloud | ||
|
||
Introducing [Tolgee Content Delivery](/platform/projects_and_organizations/content_delivery), the solution to simplify your translation updates seamlessly. With automatic uploading of localization files to secure cloud storage, your translations remain independent from your codebase, ensuring effortless updates. | ||
|
||
### We prioritize Speed and Reliability | ||
|
||
Utilizing Content Delivery Network (CDN), Tolgee Content Delivery guarantees **lightning-fast access** to your translated content worldwide. Our caching system ensures reliability and speed, across different geographical locations. | ||
|
||
> Because the content is heavily cached, it can take up to 15 minutes to propagate changes. | ||
### Tailored Export Settings | ||
|
||
Customize your translation exports effortlessly. Users have the freedom to configure file formats and other export settings, adapting the process to their unique workflows. | ||
|
||
<ScreenshotWrapper src="/img/blog/content-delivery/add-content-delivery.png" alt="Add content delivery" /> | ||
|
||
We also support **deployment to multiple storages** with different settings, if you have different use cases or platforms to target. | ||
|
||
> Read more in [Content Delivery documentation](/platform/projects_and_organizations/content_delivery) | ||
## Take automation to a new level (Business and Enterprise plans) | ||
|
||
Content delivery is part of our long-term effort to make localization easier and more autonomous. And so with this release, we've added also more low-level options for automation. | ||
|
||
### Webhooks | ||
|
||
Do you want to react to certain events, that happen in Tolgee Platform? Now you can. Just set up a webhook and Tolgee will tell you what is happening! In the request body, you'll receive an event type (like Translation edit, new comment, new language added, etc.) and you can connect it to your automation. | ||
|
||
> Read more in [Webhooks documentation](/platform/projects_and_organizations/webhooks) | ||
### Custom Content Storage | ||
|
||
Do you want to have translations in your own protected storage? Easy thing, you can now set this up directly in the Tolgee Platform for each Content Delivery configuration. | ||
|
||
[![Join Tolgee Now!](/img/blog/content-delivery/banner-automation.svg)](https://app.tolgee.io/sign_up) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
In production mode, you should never use localization data from Tolgee REST API and never leak your API key. | ||
You should use data exported from the Tolgee platform. | ||
To get exported localization files, see [exporting translations](/platform/projects_and_organizations/export). | ||
You should use data exported from the Tolgee platform or use Tolgee Content Delivery load localizations reliably. | ||
|
||
Then provide the data via Tolgee configuration options described in [Providing static data](/providing_static_data.mdx). | ||
> Check [Providing static data](/providing_static_data.mdx) section. |
115 changes: 115 additions & 0 deletions
115
platform/projects_and_organizations/content_delivery.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
id: content_delivery | ||
title: Content Delivery | ||
sidebar_label: Content Delivery | ||
--- | ||
|
||
import { ScreenshotWrapper } from '../shared/_ScreenshotWrapper'; | ||
|
||
Content Delivery will deploy your localization files to reliable and fast cloud storage so you can confidently use them in your application. This way, the updates in your localization files can be reflected without changes to your code or rebuilding the application. | ||
|
||
:::info Feature availability | ||
In the free and pay-as-you-go plans, you can use only one content delivery configuration, | ||
and you cannot use custom storage. | ||
|
||
Multiple content delivery configurations and custom storages are introduced in the business and enterprise plans. [Upgrade your plan](/pricing) to use this feature. | ||
|
||
If you use the self-hosted version, you need to [set up the license](/platform/self_hosting/licensing) to use this feature. | ||
::: | ||
|
||
## Setting up the Content Delivery | ||
|
||
You can set up Content Delivery in the `Developer settings` section of the Tolgee platform. | ||
|
||
1. Go to Developer Settings | ||
|
||
<ScreenshotWrapper src="/img/docs/platform/content-delivery/developer-settings.png" alt="Developer Settings" /> | ||
|
||
2. Click the `+ Conent delivery button` | ||
|
||
You'll have to provide a name to the content delivery config and export settings. The content delivery uses the same export | ||
settings as described is the [export section](/platform/projects_and_organizations/export) | ||
|
||
When the `Publish automatically` option is enabled, your localization files will be published automatically after every | ||
change in your localization data. If you deselect the checkbox, you will have to publish your localization files | ||
manually. | ||
|
||
<ScreenshotWrapper src="/img/docs/platform/content-delivery/add-content-delivery.png" alt="Add Content Delivery" /> | ||
|
||
3. Use the Content Delivery link | ||
|
||
Copy the link to your Content Delivery. | ||
|
||
<ScreenshotWrapper src="/img/docs/platform/content-delivery/content-delivery-link.png" alt="Content Delivery link" /> | ||
|
||
The easiest way to connect Content Delivery with Tolgee SDK is through `BackendFetch` plugin. | ||
|
||
```tsx | ||
const tolgee = Tolgee() | ||
... | ||
.use(BackendFetch({ prefix: 'https://cdndev.tolg.ee/i18n/b53fb7fb98a57fd1f2ffc85ef5ee7b03' })) | ||
... | ||
``` | ||
|
||
|
||
This way, your localization files are stored outside your application, so you can update them independently from your release cycle. | ||
|
||
:::info | ||
Content delivery is made to be rapidly available all around the world, so we prioritize caching and using CDN over fast deployment. This means it can take up to 15 minutes (usually faster) for your changes to be published. | ||
::: | ||
|
||
> Read more about [providing Tolgee SDK with static data](/js-sdk/providing-static-data). | ||
## Manual publishing | ||
|
||
If you opted out of automatic publishing, you can do so manually in the list of content deliveries by `Publish` button. | ||
|
||
<ScreenshotWrapper src="/img/docs/platform/content-delivery/manual-publish.png" alt="Manual publish" /> | ||
|
||
|
||
## Storage file structure | ||
|
||
Your localization files are simply named by the language tags in the root folder of your storage link with the file extension (depending on your settings): | ||
|
||
``` | ||
├── <your Content Delivery link> | ||
│ ├── cs.json | ||
│ └── en.json | ||
``` | ||
|
||
If you use namespaces, it should look like this: | ||
|
||
``` | ||
├── <your Content Delivery link> | ||
│ └── common | ||
│ ├── en.json | ||
│ └── de.json | ||
``` | ||
|
||
## Using custom storage | ||
:::info Feature availability | ||
|
||
Custom delivery storages are available in the Business and Enterprise plans. [Upgrade your plan](/pricing) to use this feature. | ||
|
||
If you use the self-hosted version, you need to [set up the license](/platform/self_hosting/licensing) to use this feature. | ||
::: | ||
|
||
You can also connect the content delivery to your custom storage. | ||
|
||
1. Open Content Storage settings | ||
|
||
<ScreenshotWrapper src="/img/docs/platform/content-delivery/content-storage.png" alt="Content Storage" /> | ||
|
||
2. Add new storage | ||
|
||
Tolgee supports S3 buckets and Azure blob storage. Fill in the settings that you obtain from your provider. | ||
|
||
You can also test if your configuration is valid with the `Test` button. | ||
|
||
<ScreenshotWrapper src="/img/docs/platform/content-delivery/add-content-storage.png" alt="Add Content Storage" /> | ||
|
||
3. Select the storage in the Content Delivery | ||
|
||
After you create custom storage, the `Storage` field will appear in Content Delivery settings, so you can select your storage over the default one. | ||
|
||
<ScreenshotWrapper src="/img/docs/platform/content-delivery/content-storage-select.png" alt="Content Storage select" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.