Git Product home page Git Product logo

translationeditorbundle's Introduction

TranslationEditorBundle

The TranslationEditorBundle is a Symfony2 bundle that provides web base UI to manage Symfony2 translations.

The following command line tools are provided:

  • Import translation files

    ./app/console locale:editor:import [--dry-run] [filename]

Import translation files into MongoDB. If no files is specified, the command will search for files in translations directories in src/

  • Export to translation files

    ./app/console locale:editor:export [--dry-run] [filename]

Export translations to translation files from MongoDB. If no files is specified, the command will search for files in translations directories in src/

Screenshot

Installation:

Download or clone the bundle. If you use deps file add it like this:

[TranslationEditorBundle]
	git=git://github.com/servergrove/TranslationEditorBundle.git
	target=/bundles/ServerGrove/Bundle/TranslationEditorBundle

Then run ./bin/vendors install

Add ServerGrove namespace to app/autoload.php:

$loader->registerNamespaces(array(
	...
	'ServerGrove' => __DIR__.'/../vendor/bundles',
	...
));

Enable it in your app/AppKernel.php (we recommend that you do it only for the dev environments)

public function registerBundles()
{
	...

    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    	...
        $bundles[] = new ServerGrove\Bundle\TranslationEditorBundle\ServerGroveTranslationEditorBundle();
    }

	...
}

Configuration:

We recommend that you only enable this bundle for the development environments, so only add the configuration in config_dev.yml

The collection parameter allows you to define the collection that will contain the translations for the project, so you can have multiple Symfony2 projects in the same mongodb server.

A sample Doctrine ORM configuration (in your config_dev.yml):

server_grove_translation_editor:
  storage:
    type: server_grove_translation_editor.storage.orm
    manager: default

Doctrine MongoDB configuration (in your config_dev.yml):

server_grove_translation_editor:
  storage:
    type: server_grove_translation_editor.storage.mongodb
    manager: default

Add the routing configuration to app/config/routing_dev.yml

SGTranslationEditorBundle:
	resource: "@ServerGroveTranslationEditorBundle/Resources/config/routing.yml"
	prefix:   /translations

Usage:

  1. Import translation files into mongodb

    ./app/console locale:editor:import

  2. Load editor in browser, edit your translations

    http://your-project.url/translations/editor

  3. Export changes to translation files

    ./app/console locale:editor:export

WARNING

PLEASE Backup your translation files before using the editor. Use a source control system like git, even svn is ok. We are not responsible for lost information.

TODO

  • Import strings from twig files
  • Ability to edit key
  • Add Google Translate API interface

Pull requests are welcome! We open sourced this bundle hoping people find it useful. Please contribute back any enhancements.

Notice: This bundle has been developed with very short time availability so it does not contain tests, comments, etc, so don't look at it to see how things are done. Instead of complaining of the ugly code, please contribute pull requests with enhancements :)

More information:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.