Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michalsn/codeigniter-gettext
Use gettext with CodeIgniter 4 more easily
https://github.com/michalsn/codeigniter-gettext
codeigniter codeigniter4 gettext php php8
Last synced: 4 months ago
JSON representation
Use gettext with CodeIgniter 4 more easily
- Host: GitHub
- URL: https://github.com/michalsn/codeigniter-gettext
- Owner: michalsn
- License: mit
- Created: 2023-06-28T06:37:09.000Z (over 1 year ago)
- Default Branch: develop
- Last Pushed: 2024-02-06T08:58:49.000Z (about 1 year ago)
- Last Synced: 2024-10-01T11:06:31.055Z (4 months ago)
- Topics: codeigniter, codeigniter4, gettext, php, php8
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeIgniter Gettext
This library gives users the ability to use [gettext](https://www.php.net/manual/en/book.gettext.php) more friendly way.
[![PHPUnit](https://github.com/michalsn/codeigniter-gettext/actions/workflows/phpunit.yml/badge.svg)](https://github.com/michalsn/codeigniter-gettext/actions/workflows/phpunit.yml)
[![PHPStan](https://github.com/michalsn/codeigniter-gettext/actions/workflows/phpstan.yml/badge.svg)](https://github.com/michalsn/codeigniter-gettext/actions/workflows/phpstan.yml)
[![Deptrac](https://github.com/michalsn/codeigniter-gettext/actions/workflows/deptrac.yml/badge.svg)](https://github.com/michalsn/codeigniter-gettext/actions/workflows/deptrac.yml)![PHP](https://img.shields.io/badge/PHP-%5E8.0-blue)
![CodeIgniter](https://img.shields.io/badge/CodeIgniter-%5E4.3-blue)### Installation
#### Composer
composer require michalsn/codeigniter-gettext
#### Manually
In the example below we will assume, that files from this project will be located in `app/ThirdParty/gettext` directory.
Download this project and then enable it by editing the `app/Config/Autoload.php` file and adding the `Michalsn\CodeIgniterGettext` namespace to the `$psr4` array, like in the below example:
```php
APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
'Michalsn\CodeIgniterGettext' => APPPATH . 'ThirdParty/gettext/src',
];// ...
```### Example
```php
service('gettext')->setLocale('pl');
echo _('Hello');
```