Download the PHP package craffft/contao-translation-fields without Composer

On this page you can find all versions of the php package craffft/contao-translation-fields. 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 contao-translation-fields

Contao extension Translation Fields

What is Translation Fields?

Translation Fields is a library for Contao developers to get nice translation fields in the Contao Open Source CMS. Every translation field gets a language flag and can be translated by changing the flag to another language. The translations will be saved in the table tl_translation_fields and a key from this table will be stored in the field self.

Dependencies

Troubleshooting

Directly on github! See https://github.com/Craffft/contao-translation-fields/issues

Documentation

Input types

There are three input types that you can use in the back end.

How to define a field in the DCA

To use the translation fields, you have to do the following changes in your DCA code.

Each field uses different settings. You can see this in the following codes.

Examples

Text Field

The original field:

`

The field after the changes:

Textarea Field

The original field:

The field after the changes:

Input Unit Field

The original field:

The field after the changes:

How to translate the field values

To translate the key from your current field, you can use the following methods

Translate value

Translates the field key to the translation value in the current language.

Optional you can add a force language to the translateValue method.

Translate DataContainer object

Translates all translation field values in the data container object to a translated value.

Translate DCA

Translates all translation field values in the data container array to a translated value.

Runonce

If you already have content in your application fields, you have to ensure that translation fields doesn't remove your content data. Therefore you have to create a runonce which inserts the current values into the tl_translation_fields table and associate the key with the field.

You can do this like in the following code:

E.g. you can have a look at the runconce.php from my extension Photoalbums2: https://github.com/Craffft/contao-photoalbums2/blob/master/config/runonce.php


All versions of contao-translation-fields with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
contao/core-bundle Version ^3.2 || ^4.2
contao-community-alliance/composer-plugin Version ^2.4.0 || 3.*
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 craffft/contao-translation-fields contains the following files

Loading the files please wait ....