PHP Classes

Tradukoj PHP Po File Generator: Convert locale CSV file to PO and send to Tradukoj

Recommend this page to a friend!
  Info   View files Documentation   View files View files (19)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-06-15 (Yesterday) RSS 2.0 feedStarStarStarStar 66%Total: 116 All time: 9,549 This week: 488Up
Version License PHP version Categories
tradukoj-po 1.13MIT/X Consortium ...5.3Localization, PHP 5, Files and Folders, W...
Description 

Author

This package can convert locale CSV file to PO and send to Tradukoj.

There is a class that can read application translation texts from a file in the .csv format and convert it to the .po format.

Another class can upload the .po files to the Tradukoj.com translation repository site so it can be used by any application using the gettext libraries in PHP or other programming languages.

Innovation Award
PHP Programming Innovation award nominee
November 2014
Number 3


Prize: PhpStorm IDE personal permanent license
The .PO format is often used by applications that have translations in multiple languages.

This class can generate files in the .PO format from files in the .CSV format.

Additionally it can send to the Tradukoj.com repository, so the translation files can be made available by different parts of an application running on different machines or even using code written in different programming languages.

Manuel Lemos
Picture of Joseluis Laso
  Performance   Level  
Name: Joseluis Laso <contact>
Classes: 16 packages by
Country: Spain Spain
Innovation award
Innovation award
Nominee: 6x

Winner: 2x

Documentation

Latest Stable Version Total Downloads Latest Unstable Version License

tradukoj-po-mo-module

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 tradukoj.com and create a project - copy the file config.ini.dis as config.ini and copy the data of project into it

Version

1.0.2

Installation

git clone https://github.com/jlaso/tradukoj-po-mo-module 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

[jlaso_translations_api_access]
project_id = ?
key = ?
secret = ?
url = 'https://www.tradukoj.com/api/'
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.

Example

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:

en_GB
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

License

MIT


  Files folder image Files  
File Role Description
Files folder imageClasses (3 files)
Files folder imageexamples (1 directory)
Accessible without login Plain text file Changelog Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file config.ini.dis Data Auxiliary data
Accessible without login Plain text file csv2po.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file sample.csv Data Auxiliary data
Accessible without login Plain text file Shortlog Data Auxiliary data
Accessible without login Plain text file sync.php Appl. Application script
Accessible without login Plain text file VERSION Data Auxiliary data

  Files folder image Files  /  Classes  
File Role Description
  Accessible without login Plain text file ClientSocketService.php Class Class source
  Accessible without login Plain text file PoClass.php Class Class source
  Accessible without login Plain text file Tools.php Class Class source

  Files folder image Files  /  examples  
File Role Description
Files folder imagephp (1 file, 1 directory)

  Files folder image Files  /  examples  /  php  
File Role Description
Files folder imagei18n (1 file, 2 directories)
  Accessible without login Plain text file test.php Aux. Example script

  Files folder image Files  /  examples  /  php  /  i18n  
File Role Description
Files folder imageen_GB (1 directory)
Files folder imagees_ES (1 directory)
  Accessible without login Plain text file i18n.php Aux. Example script

  Files folder image Files  /  examples  /  php  /  i18n  /  en_GB  
File Role Description
Files folder imageLC_MESSAGES (2 files)

  Files folder image Files  /  examples  /  php  /  i18n  /  en_GB  /  LC_MESSAGES  
File Role Description
  Accessible without login Plain text file default.mo Data Auxiliary data
  Accessible without login Plain text file default.po Data Auxiliary data

  Files folder image Files  /  examples  /  php  /  i18n  /  es_ES  
File Role Description
Files folder imageLC_MESSAGES (2 files)

  Files folder image Files  /  examples  /  php  /  i18n  /  es_ES  /  LC_MESSAGES  
File Role Description
  Accessible without login Plain text file default.mo Data Auxiliary data
  Accessible without login Plain text file default.po Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:116
This week:0
All time:9,549
This week:488Up
User Ratings User Comments (1)
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:83%StarStarStarStarStar
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:66%StarStarStarStar
Rank:512