What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

In *stores.php* we have locales like this: Here in this array, key 'en' and 'de', what does it re

U035GSLDLVD
U035GSLDLVD Posts: 90 πŸ§‘πŸ»β€πŸš€ - Cadet

In stores.php we have locales like this: Here in this array, key 'en' and 'de', what does it represent?

'locales' => [
            // first entry is default
            'en' => 'en_US',
            'de' => 'de_DE',
        ],

Is it used for country? or we can add anything as key and key is not used anywhere? I have 5+ locales available for multiple countries like fr_CA, en_CA and es_CA.

Comments

  • U03H06V0LAY
    U03H06V0LAY Posts: 39 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2022

    This is default language used for API, not sure how its effected by you adding further locales as i have not tried, but the first locale in array is the default. So if β€˜de_DE’ was moved to the first position it would make your default responses from Glue API return in German

  • U035GSLDLVD
    U035GSLDLVD Posts: 90 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2022

    ok. Thanks @U03H06V0LAY

    if I have three locales like en_US, en_GB and en_AU, I can not keep the same en key right?

  • U03H06V0LAY
    U03H06V0LAY Posts: 39 πŸ§‘πŸ»β€πŸš€ - Cadet

    no, i’d imagine the key must be unique, so using the postfix of β€˜GB’ or β€˜AU’ might be the way to go in that scenario

  • U035GSLDLVD
    U035GSLDLVD Posts: 90 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok. Thanks @U03H06V0LAY It means i have to keep unique key regardless of multiple locale in one county. in glue that key will be used to return particular locale value?

  • U03H06V0LAY
    U03H06V0LAY Posts: 39 πŸ§‘πŸ»β€πŸš€ - Cadet

    the key will be used to determine the language used in the Glue response

  • U035GSLDLVD
    U035GSLDLVD Posts: 90 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ok @U03H06V0LAY Thanks for the help!