2017-25 © Pedro Peláez
 

library skeleton-i18n

Translation and internationalization for Skeleton

image

tigron/skeleton-i18n

Translation and internationalization for Skeleton

  • Monday, July 16, 2018
  • by tigron
  • Repository
  • 2 Watchers
  • 0 Stars
  • 4,182 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 9 % Grown

The README.md

skeleton-i18n

Description

This library enables internationalization and translation features in Skeleton., (*1)

Installation

Installation via composer:, (*2)

composer require tigron/skeleton-i18n

Run the migrations to update the database schema:, (*3)

skeleton migrate:up

Howto

Translate a Skeleton App:, (*4)

/**
 * Create a translator object
 */
$translator = new \Skeleton\I18n\Translator($application->name);

/**
 * Attach a storage
 */
$translator_storage_po = new \Skeleton\I18n\Translator\Storage\Po();
$translator_storage_po->set_configuration([
    'storage_path' => $root_path . '/po/'
]);
$translator->set_translator_storage($translator_storage_po);

/**
 * Use an extractor to extract translations from templates
 */
$translator_extractor_twig = new \Skeleton\I18n\Translator\Extractor\Twig();
$translator_extractor_twig->set_template_path($application->template_path);
$translator->set_translator_extractor($translator_extractor_twig);

/**
 * Save the translator
 */
$translator->save();

/**
 * To translate, get the translation object and ask for a translation
 */
$translation = $translator->get_translation( Language::get_by_name_short('nl') );
echo $translation->translate('This is a test');

Translator\Storage objects can have a default configuration. This configuration will be used for any newly created Translator\Storage object., (*5)

\Skeleton\I18n\Translator\Storage\Po::set_default_configuration([
    'storage_path' => $root_path . '/po/'
]);

/**
 * Optional:
 * Set another Language interface
 */
\Skeleton\I18n\Config::$language_interface = '\Language';

Use it:, (*6)

Via a twig template rendered by skeleton-template-twig:, (*7)

{% trans "To be translated" %}

The Versions

16/07 2018

dev-master

9999999-dev

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tigron BVBA

16/07 2018

v1.0.7

1.0.7.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

08/06 2018

v1.0.6

1.0.6.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

04/05 2018

v1.0.5

1.0.5.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

05/04 2018

v1.0.4

1.0.4.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

03/04 2018

v1.0.3

1.0.3.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

03/04 2018

v1.0.2

1.0.2.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

29/03 2018

v1.0.1

1.0.1.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

29/03 2018

v1.0.0

1.0.0.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

17/11 2017

v0.0.9

0.0.9.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

14/12 2016

v0.0.8

0.0.8.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

14/12 2016

v0.0.7

0.0.7.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

14/12 2016

v0.0.6

0.0.6.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

28/09 2016

v0.0.5

0.0.5.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

09/02 2016

v0

0.0.0.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

09/02 2016

v0.0.4

0.0.4.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

25/01 2016

v0.0.3

0.0.3.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

09/11 2015

v0.0.2

0.0.2.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

14/08 2015

v0.0.1

0.0.1.0

Translation and internationalization for Skeleton

  Sources   Download

MIT

The Development Requires

by Tigron BVBA