Download the PHP package arillo/silverstripe-deepl-translator without Composer

On this page you can find all versions of the php package arillo/silverstripe-deepl-translator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-deepl-translator

arillo/silverstripe-deepl-translator

Adds Deepl translation API to a Fluent translated SilverStripe CMS. For now it only adds UI-Elements to texty fields (TextField, TextareaField, HTMLEditorField) to translate their contents.

Installation

Configuration

Create a Deepl API key and add it to your .env:

If you are using the glossary feature, it is necessary, to set a unique name prefix in your .env. It will prevent old glossaries from deletion if their names do not start with that name prefix. This is handy if you are using the same API key in multiple instances (e.g. dev & prod).

Configure your DataObjects to display the Deepl translation handles.

NOTE: It is important, that this configurations happens AFTER fluent was added to these DataObjects. Otherwise the UI will not appear.

Let's assume you have the following fluent config, named myfluentcms:

Field-wise translator

Apply the deepl config after #myfluentcms:

Make URLSegmentFields translatable (CAUTION: is expirimental; JS implementation WIP):

Alternate field value gathering for field-wise translator

To preload current values for field-wise translations this module uses the following method $record->{$fieldName}. However, it is possible to specify an alternate data source by implementing a class method called deeplFieldValueFromRecord to overwrite the default behavior, e.g.:

Add translation features to selected fields only:

Below you see an example configuration that will only add field-wiese translation features to Title and Description for that App\Model\MyDataObject.

DataObject-wise translator

Automatically translates all translatable fields of a DataObject. Just add Arillo\Deepl\DataObjectWiseTranslationExtension to extensions of that DataObject class, e.g.:

Optionally you can define relations that also will be translated. Make sure that the according DataObject also use soem Fluent extensions.

To configure the wanted relations just use the deepl_dataobject_included_relations configuration, e.g.:

Glossary

If you want to use the glossary features of Deepl, you can manage your glossaries in SiteConfig.

There are two glossary modes available: editor (default) and external.

Editor mode (default)

In editor mode, glossary entries are managed through an inline editor directly in SiteConfig. This lets you create and edit glossary entries within the CMS.

This is the default mode and requires no additional configuration.

You need to set a glossary name prefix in your .env, like so:

These prefixes are useful if you run your app in different environments, e.g.: dev or live.

As of this writing, keep in mind that the deepl glossary API does not allow for updates of glossaries. So updates are deletes and creates. The purging mechanism takes the name prefixes into account. E.g.: If your env is set to mysite-prod it will only delete glossaries where the name starts with that prefix. This should help to prevent unwanted glossary deletes.

External mode

In external mode, glossaries are managed externally (e.g. via the Deepl web interface or API). SiteConfig displays a GridField where you can select existing Deepl glossary IDs for each source/target language pair.

To enable external mode, add this to your configuration:

Glossary records are auto-created for each language pair based on your Fluent locales. You then select the appropriate Deepl glossary ID from a dropdown populated by the glossaries available in your Deepl account for that language pair.

Style Rules

Deepl supports style rules that allow you to control the tone and style of translations per target language. Style rule records are automatically created for each target language based on your Fluent locales.

You can assign a style rule to each target language in SiteConfig under the "Deepl" tab. The available style rules are fetched from your Deepl account and shown in a dropdown per language.

CMS

In CMS you have to add USE_DEEPL permission to non-admin groups.

Alternatives

If you want to use Google Translate consider to use: bratiask/silverstripe-autotranslate


All versions of silverstripe-deepl-translator with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package arillo/silverstripe-deepl-translator contains the following files

Loading the files please wait ...