Download the PHP package asm/translation-loader-bundle without Composer

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

TranslationLoaderBundle

Build Status Latest Stable Version Total Downloads Scrutinizer Code Quality SensioLabsInsight

knpbundles.com phpci build status

TranslationLoaderBundle allows you to do several cool things with your symfony standard edition translations. It relies mostly on the Translator component and doctrine. So you can...

Installation

  1. Add asm/translation-loader-bundle as a dependency of your project:

  2. Register the bundle in the kernel:

  3. If you want the admin gui, add routing config:

How does it work?

It's quite simple. For every cache clear you do, the translation dumper is generating a MessageCatalogue in your cache directory from which the application later retrieves all your translations and according fallbacks. So far, so good... We're not changing that but moving the translations from files to a flat database table, so they're (in some cases) easier to change and maintain. After installing and following the setup steps, your cache MessageCatalogue will be created directly from the database.

Getting started

EntityManager

You can tell the bundle to use an EntityManager other than your default manager. Therefore you need to add a configuration node to your app/config/config.yml

History

If enabled, the history feature listens on doctrine actions and adds an entry for each change, adding the name of the currently logged-in user.

Setup the translation table

This will create the translation table for you, so you can start importing.

Importing all translations to database

Be careful: The import might take a while, since the process checks for each translation if it's already present and then either inserts or updates. I'm open to suggestions here ;-) This command also has a "-c" so you can clear the database first. might be a bit faster for larger imports if your table is already filled.

Generate dummy translation files or using configuration

Since the TranslationLoader bases on files, you'd have to create empty files like "messages.en_US.db" for each language you want to use with your translation database. I have not yet found a nice way around that, so for the time being, you can use the dummy file generator which creates such a file for each message domain/locale you have in your db. The files will be placed in app/Resources/translations/* The other option is configuring the loader for specific locales and message domains:

Delete your old translation files

After checking your translation table, you should delete all translation files from your custom bundle's directories. Type a short

and check your symfony cache dir for the brand new MessageCatalogue we've now filled from the db :-)

Funstuff

If you're tired of database-translations, don't despair: Just use the file dumper and re-generate your files!

Check out your translation files in app/Resources/translations and if you remove all *.db files, your're back on file-mode!

Testing

I've not yet completed my test-setup and be glad to get a little contribution here ;-)

Contributions

Great thanks got to xabbuh for supporting with refactorings and testing (implementation)! Anyone who wants to contribute is greatly welcome!

License

AsmTranslationLoaderBundle is licensed under the MIT license. See the LICENSE for the full license text.

Free Software, Hell Yeah!


All versions of translation-loader-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
doctrine/orm Version ~2.2,>=2.2.3
symfony/config Version ~2.2
symfony/console Version ~2.2
symfony/dependency-injection Version ~2.2
symfony/event-dispatcher Version ~2.2
symfony/filesystem Version ~2.2
symfony/finder Version ~2.2
symfony/http-kernel Version ~2.2
symfony/translation Version ~2.2
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 asm/translation-loader-bundle contains the following files

Loading the files please wait ....