Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels not working when using country code #3

Open
Eseperio opened this issue Oct 10, 2017 · 1 comment
Open

Labels not working when using country code #3

Eseperio opened this issue Oct 10, 2017 · 1 comment

Comments

@Eseperio
Copy link

When using country code (en-GB, es-ES, pt-BR...) the labels does not display. Country code is needed for locale number and currency formatters.

A simple solution could be appending the country code at the end of the label.
Ending with something like this:
English GB
English US
Portuguese PT
Portuguese BR

@kmergen
Copy link
Owner

kmergen commented Oct 22, 2017

Please override public static function label().

Please check also if it possible for you to use codemix\localurls\UrlManager to set your languages. you can do it in your config file.

'urlManager' => [
            'class' => 'codemix\localeurls\UrlManager',
            'enableLanguagePersistence' => false,
            'enableLanguageDetection'  => false,
            // List all supported languages here
            // Make sure, you include your app's default language.
            'languages' => ['de', 'en', 'es', 'ru'],
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'enableStrictParsing' => false,
            'cache' => null,
            'rules' => [
                [
                    'class' => 'yii\rest\UrlRule',
                    'controller' => ['api/v1/hunderasse', 'api/fische'],
                    'pluralize' => false,
//                    'tokens' => [
//                        '{id}' => '<id:\\w+>'
//                    ]
                ],
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ],
        ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants