2017 © Pedro Peláez
 

library silex-translation-bundle

Silex bundle that allows .json files to be translated between multiple languages.

image

devture/silex-translation-bundle

Silex bundle that allows .json files to be translated between multiple languages.

  • Friday, March 17, 2017
  • by spantaleev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 293 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 0 % Grown

The README.md

Description

Finds all {sourceLanguage}.json files (example: en.json) in a given base directory (base_path) and allows these files to be translated to all given languages (locales)., (*1)

A {targetLanguage}.json file is generated and saved next to {sourceLanguage}.json for each locale, whenever the translations for it are saved., (*2)

A {targetLanguage}.json.hash file is also saved in the same directory. It contains "hints" telling the translation system which source translation string a given translation is derived from. This is so that a translation can be considered outdated if the source translation string changes. At this moment, such outdated translations are considered new and untranslated., (*3)

Installation

Permissions

Since the translation system needs to save translation files in the project, we need to grant file-writing privileges to the web server user., (*4)

Example:, (*5)

$ find /srv/http/my-project/src -type d -name translations | xargs chown :http
$ find /srv/http/my-project/src -type d -name translations | xargs chmod g+w

Configuration

TranslationBundle config:, (*6)

"TranslationBundle": {
    "source_language_locale_key": "en",
    "base_path": "%app_base_path%",
    "locales": "%locales%"
}

TranslationBundle config example:, (*7)

"TranslationBundle": {
    "source_language_locale_key": "en",
    "base_path": "/srv/http/my-project/src",
    "locales": {
        "en": {"key": "en", "name": "English"},
        "bg": {"key": "bg", "name": "Bulgarian"},
        "ja": {"key": "ja", "name": "Japanese"}
    }
}

Initialization

Only set-up during debug to protect the production environment:, (*8)

if ($app['debug']) {
    $app->register(new \Devture\Bundle\TranslationBundle\ServicesProvider('devture_translation', $app['config']['TranslationBundle']));
    $app->mount('/admin/{locale}/translation/', $app['devture_translation.controllers_provider.management']);
    $app['devture_user.access_control']->requireRoleForRoutePrefix('devture_translation.', 'devture_translation');
}

The main route would be devture_translation.manage (assuming the devture_translation namespace was used, as done above)., (*9)

The Versions

17/03 2017

dev-master

9999999-dev

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

silex bundle translation internationalization

17/03 2017

3.0

3.0.0.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

silex bundle translation internationalization

17/03 2017

2.0

2.0.0.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

silex bundle translation internationalization

20/02 2017

1.2.4

1.2.4.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

silex bundle translation internationalization

04/02 2016

1.2.3

1.2.3.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

02/02 2016

1.2.2

1.2.2.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

29/01 2016

1.2.1

1.2.1.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

19/09 2015

1.2

1.2.0.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

04/09 2015

1.1.1

1.1.1.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

26/08 2015

1.1

1.1.0.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

24/08 2015

1.0.5

1.0.5.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

24/08 2015

1.0.4

1.0.4.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

26/07 2015

1.0.3

1.0.3.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

16/04 2015

1.0.2

1.0.2.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

25/03 2015

1.0.1

1.0.1.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev

09/03 2015

1.0

1.0.0.0

Silex bundle that allows .json files to be translated between multiple languages.

  Sources   Download

The Requires

 

by Slavi Pantaleev