https://github.com/alaca/php-localization
PHP Localization Library
https://github.com/alaca/php-localization
i18n internationalization localization multilanguage php php-localization translation
Last synced: 19 days ago
JSON representation
PHP Localization Library
- Host: GitHub
- URL: https://github.com/alaca/php-localization
- Owner: alaca
- Created: 2016-05-18T18:02:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T22:44:09.000Z (over 6 years ago)
- Last Synced: 2025-04-06T22:31:18.690Z (29 days ago)
- Topics: i18n, internationalization, localization, multilanguage, php, php-localization, translation
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Localization Library
### Setting it up config.php
```phpreturn [
'path' => 'translations', // translation files directory path | translations is default
'input' => 'language', // url parameter | language is default
'languages' => [ // languages, first language is default
'en' => 'English',
'de' => 'Deutsch',
'it' => 'Italiano'
]
];```
### Translating strings
```php
echo __('Site title');echo __('Site %s', ['title']);
echo Localization::instance()->translate('Site %s', ['title']);
```