https://github.com/domprojects/ci-localize
https://github.com/domprojects/ci-localize
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/domprojects/ci-localize
- Owner: domProjects
- License: mit
- Created: 2024-09-24T10:01:40.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T12:49:33.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T03:41:35.570Z (about 1 year ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeIgniter Localize
Allows you to easily change and manage the language of your CodeIgniter project.
## Getting Started
### Prerequisites
Usage of Localize requires the following:
- A [CodeIgniter 4.5.0+](https://github.com/codeigniter4/CodeIgniter4/) based project
- [Composer](https://getcomposer.org/) for package management
- PHP 8.1+
### Installation
Installation is done through Composer.
```console
composer require domprojects/ci-localize
```
#### Filters setup
In the **app/Config/Filters.php** file, add the following line:
```php
public array $aliases = [
// ...
'localize' => \App\Filters\Localize::class,
];
```
Still in the same file:
```php
public array $globals = [
'before' => [
// ...
'localize',
],
];
```
#### App setup
In the **app/Config/App.php** file, modify the following line:
```php
public bool $negotiateLocale = false;
```
by
```php
public bool $negotiateLocale = true;
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.