trekksoft/potomoco

Simple gettext compiler (.po to .mo)

Installs: 36 821

Dependents: 2

Suggesters: 0

Security: 0

Stars: 5

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/trekksoft/potomoco

1.0.0 2015-03-09 09:01 UTC

This package is not auto-updated.

Last update: 2025-09-27 19:02:01 UTC


README

potomoco is a gettext msgfmt implementation in PHP. It compiles .po files to binary .mo files.

Requirements

  • PHP 5.3+
  • PSR-0 autoloading

Use

<?php
use TrekkSoft\Potomoco\Compiler;

$compiler = new Compiler();

// Generates '/path/to/your/file.mo'
$compiler->compile('/path/to/your/file.po');

// Generates '/path/to/other/compiled.mo'
$compiler->compile('/path/to/your/file.po', '/path/to/other/compiled.mo');

You can also use your own parser (default parser is TrekkSoft\Potomoco\Parser).

$compiler->setParser(new YourParser());

Custom parsers need to implement the TrekkSoft\Potomoco\ParserInterface and return an array with TrekkSoft\Potomoco\Message objects.