Download the PHP package bestit/contentful-translation-bundle without Composer
On this page you can find all versions of the php package bestit/contentful-translation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bestit/contentful-translation-bundle
More information about bestit/contentful-translation-bundle
Files in bestit/contentful-translation-bundle
Package contentful-translation-bundle
Short Description A Translation bundle for loading messages from contentful
License MIT
Informations about the package contentful-translation-bundle
bestit/contentful-translation-bundle
A Translation bundle for loading messages from contentful
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
Step 3: Configure the Bundle
Simple configuration. Here a yaml example:
Step 4: Configure contentful
You need a translation content type in your contentful space. Just create one and set the field id in your config mapping (see above). The content type need three fields: key, value and domain. You can use a localized field as value.
Example configuration as json:
Step 5: Use translations
The symfony translator expects a translation file. So you have to create a 'contentful' translation file -
as you already know it through yml, xml or xliff: /Resources/translations/messages.de.contentful
The filename defines the domain and locale as usual in Symfony. The file content can remain empty - the translations are fetched via contentful.
Please note that Symfony cache the translations. So you have to clear the cache after changes in Contentful.