Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amplience/dc-extension-localization
Automatic translation based on localized fields
https://github.com/amplience/dc-extension-localization
Last synced: about 2 months ago
JSON representation
Automatic translation based on localized fields
- Host: GitHub
- URL: https://github.com/amplience/dc-extension-localization
- Owner: amplience
- License: apache-2.0
- Created: 2019-12-18T12:00:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T00:31:49.000Z (about 1 year ago)
- Last Synced: 2024-07-13T14:35:11.508Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.2 MB
- Stars: 0
- Watchers: 17
- Forks: 1
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dc-extension-localization
![Translate](media/translate.gif)
> Automatic translation based on localized fields.
## How to install
### Register Extension
This extension needs to be [registered](https://amplience.com/docs/development/registeringextensions.html) against a Hub with in the Dynamic Content application (Developer -> Extensions), for it to load within that Hub.
#### Setup
![Setup](media/setup.png)
* Category: Content Field
* Label: Localization _(this will appear as the tab title in the Dashboard)_
* Name: localization _(needs to be unique with the Hub)_
* URL: [https://localization.extensions.content.amplience.net](https://localization.extensions.content.amplience.net)To use the application the following permissions must be enabled:
Note:
You can use our deployed version of this extension (builds from the "production" branch) -[https://localization.extensions.content.amplience.net](https://localization.extensions.content.amplience.net)
_As this is an open source project you're welcome to host your own "fork" of this project. You can use any standard static hosting service (Netlify, Amplify, Vercel, etc.) if you wish._
##### Permissions
![Permissions](media/permissions.png)
Sandbox permissions:
- Allow same origin#### Install parameters
Generate a [Yandex API Key](https://translate.yandex.com/developers/keys) and pass it to the extension:
```json
{
"TRANSLATION_API_KEY": ""
}
```## Example schema snippets
### Here is a snippet so you can add your extension easily
```json
{
"title": "title",
"description": "description",
"allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/localization#/definitions/localized-string"
}
],
"ui:extension": {
"name": ""
}
}
```## Content Type Schema
Here is a basic schema just including the translate custom extension.
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://localise.com","title": "Title",
"description": "Description","allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"
}
],"type": "object",
"properties": {
"localise": {
"title": "title",
"description": "description",
"allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/localization#/definitions/localized-string"
}
],
"ui:extension": {
"name": ""
}
}
},
"propertyOrder": []
}
```## Development
This project requires Node 16.x to build. Tested with Node 16.16.0, NPM 8.11.0.
### Running locally
```bash
$ npm run start
```### How to build
```bash
$ npm run build
```