2017 © Pedro PelĆ”ez
 

library codeigniter-gettext

image

joel-depiltech/codeigniter-gettext

  • Sunday, April 1, 2018
  • by defro
  • Repository
  • 2 Watchers
  • 4 Stars
  • 111 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 9 Forks
  • 0 Open issues
  • 12 Versions
  • 8 % Grown

The README.md

CodeIgniter Gettext

Latest Stable Version Build Status Code Coverage Scrutinizer Code Quality License, (*1)

This is CodeIgniter PHP framework package for dealing with Gettext., (*2)

This package is a fork from Marko Martivović library., (*3)

Please use Composer to install it and include it as a package in your CodeIgniter application., (*4)

Instructions

Please note that following steps assume that you have correctly installed gettext and configured Codeigniter on your server., (*5)

  1. Use composer to install this package

composer require joel-depiltech/codeigniter-gettext, (*6)

  1. Add this package to auto-load packages array (application/config/autoload.php)

$autoload['packages'] = array(FCPATH . 'vendor/joel-depiltech/codeigniter-gettext/src');, (*7)

or include it with Loader library, (*8)

$this->load->add_package_path(FCPATH . 'vendor/joel-depiltech/codeigniter-gettext/src');, (*9)

  1. Add default configuration file to auto-load config array (application/config/autoload.php)

$autoload['config'] = array('gettext');, (*10)

or include it with Loader library, (*11)

$this->load->config('gettext');, (*12)

  1. Add the library to auto-load library array (application/config/autoload.php)

$autoload['library'] = array('gettext');, (*13)

or include it with Loader library, (*14)

$this->load->library('gettext');, (*15)

  1. Add the helper to auto-load library array (application/config/autoload.php)

$autoload['helper'] = array('gettext');, (*16)

or include it with Loader library, (*17)

$this->load->helper('gettext');, (*18)

  1. Create gettext locales directory according to your gettext_locale_dir (application/language/locales by default). Inside that directory create locale_name/LC_MESSAGES path for each of your locales and place your .mo files inside.

This is an example how to load Library overwriting default configuration:, (*19)

load->library(
            'gettext',
            array(
                'gettext_text_domain' => 'my-project',
                'gettext_locale' => 'fr_FR.UTF-8',
                'gettext_locale_dir' => 'language/gettext'
            )
        );
   }
}
?>

Issues

If you have some issues with this package or is not working properly, please check your CodeIgniter log files. 'INFO' message is just for giving informations about the process, pay attention to 'ERROR' message which help you to resolve your issues., (*20)

Submit a new issue if you can't solve your problem and help us to enhance this package., (*21)

Additional Usage

If you want to use URIs in i18n Style, you can easily add a Post-Controller-Hook like the sample below. Place the following code inside your application/config/hooks.php., (*22)


$hook['post_controller_constructor'] = function() { /** * Localisation Strings Windows: * @link https://msdn.microsoft.com/en-us/library/cdax410z(v=vs.90).aspx * @link https://msdn.microsoft.com/en-us/library/39cwe7zf(v=vs.90).aspx * Localisation Strings Unix: * Verify that the selected locales are available by running `locale -a`. * * in addition take a look at * @link http://avenir.ro/create-cms-using-codeigniter-3/create-multilanguage-site-codeigniter/ **/ $locale = Array( "de" => Array( 'de_DE.UTF-8', 'de_DE@euro', 'de_DE', 'german', 'ger', 'deu', 'de' ), "en" => Array( "en_GB.UTF-8", "en_GB@euro", "en_GB", "english", "eng", "gbr", "en" ) ); $CI = &get_instance(); $lang = $this->uri->segment(1); if(isset($locale[$lang])){ $getTextConfig = Array( 'gettext_catalog_codeset' => 'UTF8', 'gettext_text_domain' => 'example', 'gettext_locale_dir' => './language/locale/'; 'gettext_locale' => $locale[$lang] ); $CI->load->library('gettext', $getTextConfig); } else { $CI->load->library('gettext'); } };

The Versions

01/04 2018

0.0.1

0.0.1.0

  Sources   Download

23/12 2016

dev-master

9999999-dev https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6
  • ext-gettext *

 

The Development Requires

language translation codeigniter i18n gettext

23/12 2016

dev-oscarotero-getttext

dev-oscarotero-getttext https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by DƩpil Tech

language translation codeigniter i18n gettext

23/12 2016

0.0.2

0.0.2.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework library for dealing with gettext.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.2

 

The Development Requires

codeigniter i18n gettext

23/12 2016

0.0.3

0.0.3.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.2

 

The Development Requires

codeigniter i18n gettext

23/12 2016

0.1.0

0.1.0.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6

 

The Development Requires

language translation codeigniter i18n gettext

23/12 2016

0.1.1

0.1.1.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6

 

The Development Requires

language translation codeigniter i18n gettext

23/12 2016

0.2.0

0.2.0.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6

 

The Development Requires

language translation codeigniter i18n gettext

23/12 2016

0.2.1

0.2.1.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6

 

The Development Requires

language translation codeigniter i18n gettext

23/12 2016

0.3.0

0.3.0.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6
  • ext-gettext *

 

The Development Requires

language translation codeigniter i18n gettext

23/12 2016

1.0.0

1.0.0.0 https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6
  • ext-gettext *

 

The Development Requires

language translation codeigniter i18n gettext

23/12 2016

dev-graphic-resources

dev-graphic-resources https://github.com/joel-depiltech/codeigniter-gettext

A Codeigniter PHP framework package for dealing with gettext as a Composer requirement.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6
  • ext-gettext *

 

The Development Requires

language translation codeigniter i18n gettext