0

I'm trying to add a new language file in Craft Control Panel admin site. I have created app.php inside translations/vi folder like this:

-my app folder
|-- translations
|----- vi
|-------- app.php

The translation will only appear when i create a vi folder in vendor/craftcms/cms/src/translations.

Is there any solutions other than adding a folder inside vendor?

what I have tried:

  • Adding this to the config/app.php
    return [
        'components' => [
            'i18n' => [
                'translations' => [
                    'app' => [
                        'class' => craft\i18n\PhpMessageSource::class,
                        'sourceLanguage' => 'vi',
                        'basePath' => dirname(__DIR__) . '/translations',
                        'allowOverrides' => true,
                    ],
                ],
            ],
        ],
    ];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.