Download the PHP package saeven/zf2-circlical-trans without Composer

On this page you can find all versions of the php package saeven/zf2-circlical-trans. 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-circlical-trans

zf3-twig-trans

Build Status Codacy Badge Codacy Badge Total Downloads

Magic glue to create the expected experience when developing with ZfcTwig, the MvcTranslator (e.g., from within your controllers), and your twig templates using a custom {% trans %} that this module provides. Usage is very simple! With this package included, "trans" becomes available in your templates.

New! This module supports text domains!

Inspired by ZfcTwig and its extensions project at https://github.com/twigphp/Twig-extensions

Requirements

Item Version
PHP 7+
Zend Framework 3.*
Gettext PHP Module *

Installation

Configuration

Loading the module: application.config.php

In your module's application.config.php, make sure you've got these modules loaded:

'ZfcTwig',
'CirclicalTwigTrans'

By loading CirclicalTwigTrans, you will be setting an alias from 'translator' to 'MvcTranslator'. If you have an existing translator alias in your system, please remove it.

Managing Locale: Your Application's Module.php

It's assumed that you are managing locale in your app's bootstrap. For example, in your Application module's onBootstrap:

Proper Language File Setup

gettext imposes a certain file structure; language folders for a module would look like so:

The .mo files are truly the ones that matter. The .po files, are the source files that are used to compile the .mo files with msgfmt.

The nomenclature, default.mo, indicates that that file contains text strings for the 'default' text domain. In other words, the name of the files is vital to proper functionality.

You need to tweak your translator configuration to support this file structure, it's very simple. Per module:

Very important: there's a critical difference between Zend's translator implementations, and gettext's implementation. The Zend translator will allow you to use multiple .mo files for a same domain, but gettext does not support this behavior. To ensure that both the Twig translations, and your in-app translations (e.g., $translator->translate('foo')) work properly, your domain names must be unique. A good practice is to name your domain, after your module.

Usage

Included tests support all flavors of trans, adding direct support for domain overrides from within the template. These syntax structures all work:

Translate 'Sorry' from text-domain 'errors'

Translate 'Home' from the 'default' domain

Translate "A 404 error occurred" from the 'default' domain

Translate with pluralization from the 'default' domain

Translate with pluralization from the 'errors' domain

Translate with notes

Controllers

Usage in controllers doesn't change.

You can test it with the ZF3 Skeleton, by translating "Home" to "fr_CA" which becomes "Acceuil" (good test).

Enjoy!

Let me know if you find any issues. I use this module as well in production, so definitely want to hunt bugs down!


All versions of zf2-circlical-trans with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-gettext Version *
kokspflanze/zfc-twig Version ^4.0.0
twig/twig Version ^3.0.1
symfony/twig-bridge Version @stable
laminas/laminas-servicemanager Version @stable
laminas/laminas-mvc-i18n Version @stable
laminas/laminas-mvc Version @stable
laminas/laminas-view Version @stable
laminas/laminas-dependency-plugin Version ^2.1
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-circlical-trans contains the following files

Loading the files please wait ....