Download the PHP package ao/translation-bundle without Composer

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

AOTranslationBundle Overview

This bundle provides doctrine as translations storage and a nice web gui accessible from the profiler for easy translation.

Build Status

Features

Installation

Require vendor libraries

Require ao/translation-bundle & stof/doctrine-extensions-bundle in composer.json:

"require": {
  "symfony/symfony": "2.1.*",
  "_comment": "other packages",
  "stof/doctrine-extensions-bundle": "1.1.*@dev",
  "ao/translation-bundle": "1.0.*@dev"
}

Then install or update composer bundles with:

php composer.phar install

or

php composer.phar update

Add bundles to your application kernel

In app/AppKernel.php add:

// app/AppKernel.php
public function registerBundles()
{
    return array(
        //...
        new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
        new AO\TranslationBundle\AOTranslationBundle()
        //...
    );
}

Configure translator

# app/config/config.yml
# enable translation component
framework:
    translator: ~

# use AOTranslationBundle as translator
parameters:
    translator.class: AO\TranslationBundle\Translation\Translator

# configure locales avaliable for translation 
ao_translation:
    locales:
        en: ~
        de:
          label: German
        fr: ~

Configure doctrine extensions bundle

Timestampable behavior has to be enabled.

# app/config/config.yml
stof_doctrine_extensions:
    orm:
        default:
            timestampable: true

Update your db schema

If you use migrations:

app/console doctrine:migrations:diff
app/console doctrine:migrations:migrate

Otherwise:

app/console doctrine:schema:update

Add routing information

# app/config/routing.yml
ao_translation:
    resource: "@AOTranslationBundle/Controller/"
    type:     annotation
    prefix:   / 

Usage

Use translation methods like described in Symfony Translations documentation.

Translations panel

You can access translations panel by clicking on Translations in the web debug toolbar.

Translations web debug toolbar

Now you can edit all your translation messages. Message parameters can be inserted directly into translation by clicking on the link in Parameters (2) column. After you are done click the Save Translations button (1).

As the translator needs to know which messages are used in each action, it stores this relation in a cache table. Therefore, when a message is not used anymore it will still be visible in the translations panel. To clear the cached messages use the Reset action cache (3) button, which will clear the cache for current action. Alternatively use the Reset cache (4) button, which will clear cache for all actions. The cache will be rebuilt with the next execution of an action.

Translations panel

Translations backend

In order to use translations backend you need to install SonataAdminBundle and SonataDoctrineORMAdminBundle. Please refer to their installation guide. After installation and configuration the backend will be available under /admin/ao/translation/message/list.

Additional features

Using separate database connection for storing translations

In case you need to share the translations database (eg. when multiple developers collaborate) you can configure separate entity manager for the bundle.

# app/config/config.yml
doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                ...
            # configure translations database connection
            translations:
                ...

orm:
    ...
    default_entity_manager: default
    entity_managers:
        default:
            connection: default
            mappings:
                ...
        translations:
            connection: translations
            mappings:
                AOTranslationBundle: ~

ao_translation:
    entity_manager: translations

stof_doctrine_extensions:
    orm:
        ...
        # enable timestampable behavior for translations entity manager
        translations:
            timestampable: true

To create translations schema add use --em parameter like:

app/console doctrine:schema:create --em=translations

All versions of translation-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
symfony/framework-bundle Version ~2.1
stof/doctrine-extensions-bundle Version ~1.1
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 ao/translation-bundle contains the following files

Loading the files please wait ....