Skip to content

Locales aren't migrated to sites as expected #90

Description

@FrittenKeeZ

In v2 our site/settings/system.yaml has these locales:

locales:
  da:
    name: Danish
    full: da_DK
    url: "{env:APP_URL}/"
  en:
    name: English
    full: en_US
    url: "{env:APP_URL}/en/"
  sv:
    name: Swedish
    full: sv_SE
    url: "{env:APP_URL}/sv/"

In v3 these are migrated to config/statamic/sites.php as:

    'sites' => [

        'default' => [
            'name' => 'Danish',
            'locale' => 'da_DK',
            'url' => '{env:APP_URL}/',
        ],

        'en' => [
            'name' => 'English',
            'locale' => 'en_US',
            'url' => '{env:APP_URL}/en/',
        ],

        'sv' => [
            'name' => 'Swedish',
            'locale' => 'sv_SE',
            'url' => '{env:APP_URL}/sv/',
        ],

    ],

I'd expect the key for Danish to be da instead of default.

A nice addition and helping hand, could be to convert the {env:APP_URL} part of URLs:

$url = preg_replace('/{env:([A-Z0-9_]+)}/', '{env(\'$1\')}', $url);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions