Internationalization and localization your app with a minimum effort.

v0.1.2 2019-08-01 08:36 UTC

This package is auto-updated.

Last update: 2020-06-12 18:49:34 UTC


This package helps you to deal with regions with different languages, currencies and countries. It could be helpful even if you have single region project.


The best way to install 68publishers/i18n is using Composer:

composer require 68publishers/i18n

then you can register extension into DIC:

    i18n: SixtyEightPublishers\i18n\DI\I18nExtension


            language: [ sk_SK, en_GB, de_DE, pl_PL ]
            currency: [ EUR, PLZ, GBP ]
            country: [ SK, GB, DE, PL ]
            domain: [ 'europe\.example\.com' ] # regex
            language: en_US
            currency: USD
            country: US
			domain: 'example\.com\/na'
			enabled: no # default is `yes`
		default: # If the default profile doesn't exists, the first profile is taken as default
			language: cs_CZ
			currency: CZK
			country: CZ
	debugger: yes # adds Tracy panel, default is parameter %debugMode%
		enabled: yes # enable integration with kdyby/translation, default is `no`
		use_default: yes # use language of default's profile if profile is not detected, default is `no`
	# if you want to use custom profile storage or profile detector:
	storage: My\Custom\ProfileStorage
	detector: My\Custom\Detector

Integration with Kdyby\Translation

This feature provides automatic evaluation of the locale parameter for kdyby\translation based on profile settings in the extension. Default profile's language can be used if setting translations.use_default is set to TRUE. If is this setting set to FALSE default language will not be used and other resolvers will be invoked. Also if you change language via method SixtyEightPublishers\i18n\Profile\ActiveProfile::changeLanguage(), locale in Translator will be changed too.


Before committing any changes, don't forget to run

vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run


vendor/bin/tester ./tests