1. Go to this page and download the library: Download geniv/nette-locale library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
geniv / nette-locale example snippets
use Locale\Locale;
$locale = $this->context->getByType(ILocale::class);
// or
/** @var Locale\ILocale @inject */
public $locale;
// methods implements `ILocale`:
getListName(): array;
getListId(): array;
getLocales(): array;
getCode(bool $upper = false): string
setCode(string $code)
// is correct locale set? with method: setCode()
// true if driver is DevNullDriver
isReady(): bool
getId(): int
getIdDefault(): string
getCodeDefault(bool $upper = false): string
isDefaultLocale(): bool
getPlural(): string
getIdByCode(string $code): int
public function onRequest(Application $application, Request $request) {}