2017 © Pedro Peláez
 

symfony-bundle static-translations

This is a Symfony Bundle that helps you to generate translations for static/hardcoded strings from Excel files, thanks to the PHPExcel library

image

kunicmarko/static-translations

This is a Symfony Bundle that helps you to generate translations for static/hardcoded strings from Excel files, thanks to the PHPExcel library

  • Saturday, September 9, 2017
  • by kunicmarko20
  • Repository
  • 2 Watchers
  • 2 Stars
  • 64 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Symfony Static Translations Bundle

This bundle helps you generate translation for static strings in symfony application., (*1)

Total Downloads Latest Stable Version Latest Unstable Version License, (*2)

This bundle uses PHPOffice/PHPExcel bundle, (*3)

PHPExcel bundle Requirements

  • PHP version 5.2.0 or higher
  • PHP extension php_zip enabled (required if you need PHPExcel to handle .xlsx .ods or .gnumeric files)
  • PHP extension php_xml enabled
  • PHP extension php_gd2 enabled (optional, but required for exact column width autocalculation)

Installation

1. Add to composer.json to the require key, (*4)

composer require --dev kunicmarko/static-translations

2. Register the bundle in app/AppKernel.php, (*5)

if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
    // ...
    $bundles[] =  new KunicMarko\StaticTranslationsBundle\StaticTranslationsBundle();
}

Command

php app/console generate:static:translations /path/to/excel/file languages, (*6)

Command accepts 2 parameters, you can run it without parameters and then you get interactive console with help on how to use command, (*7)

Parameters

1. Excel file, (*8)

Provide path to your Excel file that has to end with .xlsx, (*9)

Formating of Excel file ( can also be found here ):, (*10)

A B
1 English German
2
3 About Us Über uns label.about
4 Contact Kontakt
5 Imprint Impressum form.imprint, default.language.source

We expect words for translation to start from line 3, (*11)

You can add more languages, we only expect labels to be at last position, (*12)

Labels are optional, there can be more than one label for same word, they just have to be divided by comma (,), (*13)

If you add labels, label names will be used for source tags in xml, (*14)

If you want to use default language word for source and use labels for same word, you can use reserved word default.language.source and add it in labels part, (*15)

2. Languages, (*16)

We expect array of language codes, divided by space e.g. en de fr, use same order as in your excel file., (*17)

First language in array is source language and will be used for all source tags., (*18)

The Versions

09/09 2017

dev-master

9999999-dev https://github.com/kunicmarko20/static-translation

This is a Symfony Bundle that helps you to generate translations for static/hardcoded strings from Excel files, thanks to the PHPExcel library

  Sources   Download

MIT

The Requires

 

translations symfony translation symfony2 bundle static

18/04 2017

1.0.5

1.0.5.0 https://github.com/kunicmarko20/static-translation

This is a Symfony Bundle that helps you to generate translations for static/hardcoded strings from Excel files, thanks to the PHPExcel library

  Sources   Download

MIT

The Requires

 

translations symfony translation symfony2 bundle static

09/02 2017

v1.0.4

1.0.4.0 https://github.com/kunicmarko20/static-translation

This is a Symfony Bundle that helps you to generate translations for static/hardcoded strings from Excel files, thanks to the PHPExcel library

  Sources   Download

MIT

The Requires

 

translations symfony translation symfony2 bundle static