PHP Classes


Recommend this page to a friend!
  Classes of Joseluis Laso   Tradukoj PHP Po File Generator   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Tradukoj PHP Po File Generator
Convert locale CSV file to PO and send to Tradukoj
Author: By
Last change: Update of
Date: 1 month ago
Size: 2,504 bytes


Class file image Download

Latest Stable Version Total Downloads Latest Unstable Version License


This is an alone program that allows to synchronize your po files with tradukoj remote server

First of all, you need

- Clone this project whenever you want in your computer - launch `composer install` - Create an account in and create a project - copy the file config.ini.dis as config.ini and copy the data of project into it




git clone tradukoj-po-mo-sync
cd tradukoj-po-mo-sync
composer install  # to install dependencies

You can also add the module by composer.json, adding in require clause:

    "jlaso/tradukoj-po-mo-module": "*"

This is the content of the standard config.ini.dis

project_id = ?
key = ?
secret = ?
url = ''
managed_locales = ?

You need to copy this file as config.ini, and substitute the ? symbol by the ones provided by tradukoj.

Invoke the command

cd tradukoj-po-mo-sync
php sync.php --help / to obtain help
php sync.php --upload=yes --dir=path-to-your-locale-files

Tool to transform csv files to po files

php csv2po.php --input=sample.csv

Look inside sample.csv to know the correct format that the tools expects.


In the folder structure there is a example with LOCALE files and a test program in order to check if gettext is installed in the system.

You can check the test program with this command:

php examples/php/test.php [locale]

The output of this command for en locale is:

testing gettext
general.no_records_found: No records found.
general.one_record_found: Total one record found
general._d_records_found: Total 10 records found