yii2-excel-message 7

Translate messages via Excel files

codemix/yii2-excel-message

Written in PHP by 1 contributor

Contribute

Need Support?


we offer maintenance, support and development services for all our open source projects.

Contact Us

Yii2 Excel Message

Latest Stable Version Total Downloads Latest Unstable Version License

Translate messages via Excel files.

Features

With this extension you can export messages from PHP message files to Excel, send them to your translators and read them back into your message files.

Note: To read and write to and from Excel file, we use the excellent PHPExcel package.

Installation

Install the package with composer.

composer require codemix/yii2-excel-message

Then update your console configuration:

<?php
return [
    'controllerMap' => [
        'excel-message' => [
            'class' => 'codemix\excelmessage\ExcelMessageController'
        ]
    ]
    // ...
];

Creating Excel files with new translations

To create Excel files with new translations, you need to supply the Yii2 message configuration and the output directory where the files should be written to:

./yii excel-message messages/config.php /output/dir

This will create one file per language (filename == language) with one sheet per category. The source messages are listed in column A. Translators should add their translations to column B.

The files will be in Excel2007 format with xlsx extension.

If you want a file with all translations instead, pass all as 3rd argument. You can also export only certain languages or categories:

./yii excel-message --languages=de,fr --categories=nav,app messages/config.php /output/dir

Update PHP message files from Excel files

After you receive the Excel files back from your translators you can update your PHP message files. Again you need to supply the Yii2 message configuration and the directory path where your Excel files are:

./yii excel-message/import messages/config.php /input/dir

This will add the new translations to your PHP message files. Yes it's really that simple.

You can also pass a third parameter with the file extension, the default is xlsx as used by Excel2007 files. PHPExcel should also autodetect other Excel formats

Note: The files must be provided in the same format as they where created by the export:

  • One file per language with language code as filename
  • One sheet per category
  • Source messages in column A, translations in column B
  • First line is skipped.

Options

You can use the following options.

Option Description
--languages=aa,bb,cc Comma separated list of languages to process.
--categories=cat1,cat2 Comma separated list of categories to process.
--ignoreLanguages=aa,bb,cc Comma separated list of languages to ignore. This option is ignored if --languages is used.
--ignoreCategories=cat1,cat2 Comma separated list of categories to ignore. This option is ignored if --categories is used.
--lineHeight=x export only: The line height to set on the excel file. The default is auto but this does not work if the file is openend in LibreOffice Calc. So you can set a fixed line height like 50 here as a workaround.




43 other PHP projects


phpwkhtmltopdfPHP 716

A slim PHP wrapper around wkhtmltopdf with an easy to use and clean OOP interface

php-pdftkPHP 213

A PDF conversion and form utility based on pdftk

yii2-localeurlsPHP 189

Automatic locale/language management for URLs

YiiRedisPHP 131

A set of wrappers for different data types in redis

yiipasswordPHP 81

Password strategies for Yii

yii2-dockerizedPHP 64

A template for docker based Yii 2 applications

YiiSolrPHP 50

A wrapper for the pecl solr library that provides common Yii constructs, such as models, data providers etc

php-shellcommandPHP 48

A simple object oriented interface to execute shell commands in PHP

Yii-Docs-GeneratorPHP 47

Generates HTML documentation for Yii applications

YiiGitPHP 36

A git wrapper for Yii, allows access to all git commands programatically

YiiElasticSearchPHP 32

Elastic Search client for Yii

YiiCurlPHP 30

A curl library for Yii

YiiStateMachinePHP 28

A state machine behavior for Yii

yii2-streamlogPHP 19

A Yii 2 log target for streams in URL format

oauth2yiiPHP 18

An OAuth2 client / server extension for the Yii framework

packagecompressorPHP 16

A Javascript/CSS compressor based on Yii's package system

restyiiPHP 16

A RESTful extension for Yii.

localeurlsPHP 12

Automatic locale/language management for URLs

php-excel-readerPHP 12

It reads the binary format of XLS files directly and can return values and formats from any cell. This project is the fork of http://code.google.com/p/php-excel-reader/ that, apparently, is no longer maintained.

pdfablePHP 10

A Yii extension to create PDFs with PHPWkHtmlToPdf/wkhtmltopdf

yii-api-vimPHP 8

Yii API manual plugin for VIM

yii2-bs3activeformPHP 7

A Bootstrap 3 enhanced ActiveForm for Yii 2

xcrudcontrollerPHP 7

A base class to quickly build customized CRUD interfaces.

handlebarsphpPHP 6

Transpiles handlebars templates into native PHP templates

Yii-Package-ManagerPHP 6

A package manager for Yii

php-tmpfilePHP 6

A convenience class for temporary files

yii2-apidoc-vimPHP 5

Yii2 apidoc as Vim helpfiles

php-orientdbPHP 5

A fast PHP driver for the OrientDB binary protocol.

YiiUsersPHP 4

User management for Yii

translatablePHP 4

Transparent attribute translation for ActiveRecords

flushablePHP 3

Yii dependency that allows to flush records from the cache

Yii-Resource-ManagerPHP 3

Helpers to allow Yii to interact with resources (files) of different types

bs3activeformPHP 2

A lightweight utility to render Bootstrap 3 forms in Yii

YiiEmailerPHP 2

Emailing functions for Yii

AccessRestrictablePHP 2

A Yii ActiveRecordBehavior that automatically applies conditions for access restriction to every query.

defaultpersisterPHP 1

Yii extension to save and restore model values in user session.

hybridauthmanagerPHP 1

An AuthManager for Yii that stores the hierarchy in a flat PHP file and the assignments in DB

YiiLinkablePHP 1

A simple extension for Yii allowing easy and consistent access to model URLs and appropriate anchor text.

YiiYaaPHP 1

YAA is an additional abstraction layer for Yii that aggregates a number of child models into a clean single model that is easy to cache

xreturnablePHP

Yii extension to create URLs that allow to return to a page by storing its GET Parameters on a stack.

YiiAbstractArrayModelPHP

Work with PHP files in Active Record way

yii2-base-appPHP

An alternative Yii2 application template for purists

twittonioPHP

simple useless twitter client