PHPackages                             wernerkrauss/silverstripe-fluent-export-import - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. wernerkrauss/silverstripe-fluent-export-import

ActiveSilverstripe-vendormodule[Localization &amp; i18n](/categories/localization)

wernerkrauss/silverstripe-fluent-export-import
==============================================

File export and import for SilverStripe Fluent

2.0.1(1y ago)4504[6 issues](https://github.com/wernerkrauss/silverstripe-fluent-export-import/issues)[2 PRs](https://github.com/wernerkrauss/silverstripe-fluent-export-import/pulls)MITPHPPHP ^8.2CI failing

Since Nov 14Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/wernerkrauss/silverstripe-fluent-export-import)[ Packagist](https://packagist.org/packages/wernerkrauss/silverstripe-fluent-export-import)[ RSS](/packages/wernerkrauss-silverstripe-fluent-export-import/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (13)Used By (0)

Silverstripe Fluent Export / Import
===================================

[](#silverstripe-fluent-export--import)

An extension for silvertripe/fluent

- export and import translations with yml files
- automatically translate content using ChatGPT.

Installation
------------

[](#installation)

```
composer require wernerkrauss/silverstripe-fluent-export-import
```

### Silverstripe CMS Versions

[](#silverstripe-cms-versions)

Version 2 of this module is for Silverstripe CMS 6

Use Version 1 for Silverstripe 5

### Silverstripe 6 requirements workaround

[](#silverstripe-6-requirements-workaround)

Currently some required modules are not released as a new SS6 compatible version. If you encounter errors, that some modules are not available in the required Version, try this workaround in your *composer.json*:

```
"repositories": [
    {
        "type": "git",
        "url": "https://github.com/wernerkrauss/silverstripe-pure-modal.git"
    },
    {
        "type": "git",
        "url": "https://github.com/wernerkrauss/silverstripe-cms-actions.git"
    }
],
"require": {
    "lekoala/silverstripe-pure-modal": "dev-silverstripe6 as 2.0",
    "lekoala/silverstripe-cms-actions": "dev-silverstripe6 as 2.0"
},
```

Important notice
----------------

[](#important-notice)

I take no warranty for any data loss. Please backup your database before importing translations.

There is only a check if the yml file has the same locale as you plan to import. Using the import funcitonality will overwrite the related content in the database.

Please validate the yml files before importing them. Take care to escape apostrophs.

Import / Export
---------------

[](#import--export)

### Export

[](#export)

Run `dev/tasks/fluent-export` to export all translations as a zip of yml files.

You can also go to the LocaleAdmin and click on the export button.

Now you can translate the content and import it again.

### Import

[](#import)

Translations are imported in LocaleAdmin. Hit the import button and select the zip or yml file you want to import.

### Configuration

[](#configuration)

You can configure fields you don't want to export, e.g. SiteTree's URLSegment:

```
SilverStripe\CMS\Model\SiteTree:
  translate_ignore:
    - URLSegment
```

Automatic Translation
---------------------

[](#automatic-translation)

You can use the ChatGPT API to translate your content. To do so, you need to set the API key in your .env file:

```
CHATGPT_API_KEY=your-api-key

```

Next add extension to all classes you want to translate:

```
# SiteTree has already fluent applied
SilverStripe\CMS\Model\SiteTree:
  extensions:
    autotranslate: Netwerkstatt\FluentExIm\Extension\AutoTranslate

My\Namespace\Model\Foo:
    extensions:
        fluent: TractorCow\Fluent\Extension\FluentExtension
        autotranslate: Netwerkstatt\FluentExIm\Extension\AutoTranslat
# if you have configured translations, make sure to add IsAutoTranslated and LastTranslation manually
    translate:
        - IsAutoTranslated
        - LastTranslation
```

The `AutoTranslate` extension adds a flag `IsAutoTranslated` to the class and a field `LastTranslation` to each locale. It's meant to be controlled by an editor, if the translation is correct.

⚠️ Be aware, that some extensions of other modules might add `translated` config to a class. Then you have to add `IsAutoTranslated` and `LastTranslation` to the `translated` config as well.

### Configuring ChatGPT

[](#configuring-chatgpt)

You can configure the ChatGPT API in your config.yml:

```
Netwerkstatt\FluentExIm\Translator\ChatGPTTranslator:
  gpt_model: gpt-4o-mini
  # %s will be replaced with the target locale
  gpt_command: 'You are a professional translator. Translate the following text to %s language. Please keep the json format intact.'
```

If you need to configure the gpt\_command more dynamically, you can use the following code in an Extension to `ChatGPTTranslator`:

```
public function updateGptCommand(&$command, $locale)
{
    $command = 'You are a professional translator. Translate the following text to ' . $locale . ' language. Please keep the json format intact.';
}
```

#### How to find available GPT models

[](#how-to-find-available-gpt-models)

In ssshell you can run the following commands to find out, which models are currently available for your API key:

```
$api_key = Environment::getEnv('CHATGPT_API_KEY');
$gpt = new Netwerkstatt\FluentExIm\Translator\ChatGPTTranslator($api_key);
$gpt->getModels();
```

### fluent-ai-autotranslate task

[](#fluent-ai-autotranslate-task)

When everything is configured properly you can run the task `sake tasks:FluentAIAutoTranslate --du_publish=1` to translate all content to the desired locale.

If IsAutoTranslated of LastTranslation is missing in localised fields, the task will throw a RuntimeException.

Notice: the task can only publish translated content, if you use `FluentVersionedExtension` instead of `FluentExtension` on the versioned DataObjects.

#### Parameters:

[](#parameters)

- `do_publish` (required, shortcut: `p`): If set to 1, the task will publish the translated content.
- `force_translation` (optional): If set to 1, the task will translate all content that is untranslated or marked as previoulsy auto translated, even if it was already translated.
- `locale_from` (optonal, shortcut: `l`): set the source locale for translations
- `locales_to` (optional, shortut: `t`): limit translations to this locales; expects a semicolon separated list, e.g. `--locales_to="en_US;es_ES"`

See `sake tasks:FluentAIAutoTranslate --help` for all available commands.

Troubleshooting / FAQ
---------------------

[](#troubleshooting--faq)

### \[Emergency\] Uncaught RuntimeException: My\\Namespace\\HomePage does not have IsAutoTranslated as translatable field

[](#emergency-uncaught-runtimeexception-mynamespacehomepage-does-not-have-isautotranslated-as-translatable-field)

It seems, your `SiteTree` (or the main class where you applied the AutoTranslate extension) has defined the `translate` fields manually. While the above config works in many cases, you need to define the translated fields required by this extension manually:

```
# SiteTree has already fluent applied
SilverStripe\CMS\Model\SiteTree:
  extensions:
    autotranslate: Netwerkstatt\FluentExIm\Extension\AutoTranslate
    translate:
        - IsAutoTranslated
        - LastTranslation
```

This should fix the issues.

Todo
----

[](#todo)

### File Import/Export

[](#file-importexport)

- Export translations to YML
- Import translations from YML
- Import translations from a zip containing yml files
- other file adapters for import/export like json or xliff
- better UI, e.g. in LocaleAdmin
- use AI on export to translate content; export original and translated content

AI Translation
--------------

[](#ai-translation)

- documentation how to ask ChatGPT to translate in a correct way
- implement other translation services like DeepL

Thanks to
---------

[](#thanks-to)

Thanks to [Nobrainer](https://www.nobrainer.dk/) and [Adiwidjaja Teamworks](https://www.adiwidjaja.com/) for sponsoring this module ❤️.

A special thank you to [Lekoala](https://github.com/lekoala) for the support with his CMS-Actions and PureModal modules.

Thanks to TractorCow and all contributors for the great [fluent module](https://github.com/tractorcow-farm/silverstripe-fluent). And thanks to the folks at Silverstripe for their great work.

Need Help?
----------

[](#need-help)

If you need some help with your Silverstripe project, feel free to [contact me](mailto:werner.krauss@netwerkstatt.at) ✉️.

See you at next [StripeCon](https://stripecon.eu) 👋

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Total

9

Last Release

372d ago

Major Versions

0.2.1 → 1.02025-06-27

1.x-dev → 2.02025-06-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff3ee546a6d1b1092f1badf68523ba30f28dec7fce11254a8cb3aeb57c6202de?d=identicon)[wernerkrauss](/maintainers/wernerkrauss)

---

Top Contributors

[![wernerkrauss](https://avatars.githubusercontent.com/u/1043925?v=4)](https://github.com/wernerkrauss "wernerkrauss (64 commits)")[![adiwidjaja](https://avatars.githubusercontent.com/u/280394?v=4)](https://github.com/adiwidjaja "adiwidjaja (1 commits)")[![Zazama](https://avatars.githubusercontent.com/u/7694808?v=4)](https://github.com/Zazama "Zazama (1 commits)")

---

Tags

i18nsilverstripemultilingualfluentextension

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/wernerkrauss-silverstripe-fluent-export-import/health.svg)

```
[![Health](https://phpackages.com/badges/wernerkrauss-silverstripe-fluent-export-import/health.svg)](https://phpackages.com/packages/wernerkrauss-silverstripe-fluent-export-import)
```

###  Alternatives

[tractorcow/silverstripe-fluent

Simple localisation for Silverstripe

91437.9k29](/packages/tractorcow-silverstripe-fluent)[silverstripe/translatable

Allows translation of DataObject and SiteTree records into multiple languages

52199.3k8](/packages/silverstripe-translatable)[yeesoft/yii2-multilingual

Yii2 Multilingual Module

177.4k1](/packages/yeesoft-yii2-multilingual)[devgroup/yii2-multilingual

Allows building yii2 apps for multiple languages using regional URL's and domains

152.6k2](/packages/devgroup-yii2-multilingual)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
