Download the PHP package saeven/zf2-poeditor without Composer

On this page you can find all versions of the php package saeven/zf2-poeditor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zf2-poeditor

Zend Framework 2 Gettext File Editor

Want a PHP/Twig file parser that's local to your project, with a web GUI to deal with gettext intricacies? This project is it!

How it works

This project combines a parser, an PHP PO file editor, and gettext CLI commands to do what programs like PoEdit do at the surface. You use translation markers in your code like:

Then, when you use the web GUI you'll see a set of fields where you can edit all of your translatable-text.

Installation

To install the packages:

composer require saeven/zf2-poeditor

Then add these modules to your ZF2 application config:

CirclicalTranslationEditor

Access /translate to confirm that it's set up. If you don't have a Twig/Trans bridge in there already, you can also load

CirclicalTwigTrans

To gain {% trans %} for Twig

You have to make sure that you have gettext installed as well. Check your system with these commands:

which msgfmt
which gettext
which xgettext
which msguniq

If they all exist, you are in business. Otherwise, Google how to get gettext binaries installed on your system.

Configuration

Once you have downloaded the Composer package, copy the autoload config to your project:

cp ./vendor/saeven/zf2-poeditor/config/autoload/circlical.translator.local.php ./config/autoload

In that file, you'll see these config keys:

Key Name Description
xgettext Full path to your xgettext executable.
msgcat Full path to your msgcat executable.
msgfmt Full path to your msgfmt executable.
backup_dir The folder where .po files are backed up with each pass. must be writable
cache_dir The cache folder where the temporary .pot files are stored during compilation. must be writable
stub_functions See 'Stubs' below
stub_filters See 'Stubs' below

Stubs

If you are coming from the camp that combines PoEdit with a Twig extractor, you'll remember those instances where you'd get a giant error message but no reason why. 90% of the time, it's because a developer had added a custom filter or helper that wasn't registered with the extractor. The outcome is breakage: the extractor dies, PoEdit can't ferry the error, and you're stuck cutting and pasting messages to identify the culprit.

Enter stubs.

When you are using this package, the Twig errors will be reported in plain sight if you meet this circumstance.

![Error Sample] (http://i.imgur.com/GW2LmIr.png)

In that image, you can see that the GrilledCheese helper is not registered (what a shame, so tasty). Somewhere in the Twig files, there's a {{ GrilledCheese }} that's causing the problem. To fix this:

Filters work similarly, the error message will guide you properly.

Some Instructions!

Locale Discovery

Locale discovery depends on the proper set up of gettext message folders within your modules. These would like like:

module/Application/language/en_US/LC_MESSAGES module/Application/language/fr_CA/LC_MESSAGES

You'll have to set these up or there'll be no locales in the dropdown within the translator.

Scan Mode

The system scans your module folders only, for PHP and Twig files.

Compile Trigger

The pot files are compiled when you select a locale.

Configuration Required!

If you don't configure the languages that you work on, then you won't get the right PO headers in place. If this happens, then compilation from po to mo is not possible. Be sure to configure your file with the language team, charset, and plural form for your language.

Sanity Check

You can check your ./data/cache/translator folder for these files while you're working. Their presence lets you know things should be working:

Contributing

This is a first release, but it works very well. It's my hope to PSR-7 this with Expressive so that all frameworks can benefit from its use. Throwing out to the world can only make it better! Have an idea or an issue you can solve? PR it up, let's make this tool a solid alternative to PoEdit together!

Thanks in advance!


All versions of zf2-poeditor with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
saeven/circlical-po-editor Version dev-master
saeven/circlical-twig-extractor Version dev-master
zendframework/zend-mvc Version @stable
zendframework/zend-config Version @stable
zendframework/zend-view Version @stable
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package saeven/zf2-poeditor contains the following files

Loading the files please wait ....