Skip to content

Commit

Permalink
Add migration for translate plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
luukbrauckmann committed Oct 22, 2024
1 parent 9eb7a85 commit 2066690
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
14 changes: 14 additions & 0 deletions config/datocms/migrations/1706200000_init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,18 @@ export default async function (client: Client) {
await client.plugins.create({
package_name: 'datocms-plugin-oembed',
});

console.log('Install plugin "Translate"');
const translatePlugin = await client.plugins.create({
package_name: 'datocms-plugin-translate-fields',
});
if (process.env.DEEPL_API_KEY) {
await client.plugins.update(translatePlugin.id, {
parameters: {
autoApply: true,
deeplApiKey: process.env.DEEPL_API_KEY,
translationService: { label: 'DeepL API Pro', value: 'deepl' }
},
});
}
}
20 changes: 0 additions & 20 deletions docs/cms-translation-plugin-setup.md

This file was deleted.

7 changes: 7 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ DATOCMS_READONLY_API_TOKEN=copy-read-only-token
DATOCMS_API_TOKEN=copy-full-access-token
```

- (optional) If you have a DeepL API key, you can add it to your `.env` file as well.

```dotenv
# .env
DEEPL_API_KEY=copy-deepl-api-key
```

- Add all models and settings in to your new CMS by running our [migrations](../config/datocms/migrations/) in a new [environment](https://www.datocms.com/docs/scripting-migrations/introduction) called `start` using the DatoCMS CLI: `npx datocms migrations:run --destination=start --fast-fork`.
- Promote the new `start` environment to primary environment: `npx datocms environments:promote start` Alternatively you can go to Project Settings > Environments (`/project_settings/environments`) and 'Promote' the `start` environment to primary.
- In your CMS, you can now safely remove the original environment via Project Settings > Environments (`/project_settings/environments`).
Expand Down

0 comments on commit 2066690

Please sign in to comment.