/dc-extension-localization

Automatic translation based on localized fields

Primary LanguageJavaScriptApache License 2.0Apache-2.0

dc-extension-localization

Translate

Automatic translation based on localized fields.

How to install

Register Extension

This extension needs to be registered against a Hub with in the Dynamic Content application (Developer -> Extensions), for it to load within that Hub.

Setup

Setup

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

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

Sandbox permissions:

  • Allow same origin

Install parameters

Generate a Yandex API Key and pass it to the extension:

{
    "TRANSLATION_API_KEY": "<YOUR KEY>"
}

Example schema snippets

Here is a snippet so you can add your extension easily

{
    "title": "title",
    "description": "description",
    "allOf": [
        {
            "$ref": "http://bigcontent.io/cms/schema/v1/localization#/definitions/localized-string"
        }
    ],
    "ui:extension": {
        "name": "<your name of extension here>"
    }
}

Content Type Schema

Here is a basic schema just including the translate custom extension.

{
    "$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": "<your name of extension here>"
            }
        }
    },
    "propertyOrder": []
}

Development

This project requires Node 16.x to build. Tested with Node 16.16.0, NPM 8.11.0.

Running locally

$ npm run start

How to build

$ npm run build