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

Fix for multi-country locales supported by Translatable #926

Merged
merged 2 commits into from
Jul 20, 2021

Conversation

antonioribeiro
Copy link
Member

@antonioribeiro antonioribeiro commented May 22, 2021

Description

If we install Laravel and Twill and don't configure Translatable right away, this error will happen:

Screenshot 2021-05-23 at 00 20 59

Because Twill doesn't support multi-countries locales present on Translatable:

'locales' => [
    'en',
    'fr',
    'es' => [
        'MX', // mexican spanish
         'CO', // colombian spanish
    ],
],

This PR basically fix this by changing the i18_helpers->getLocales() to support them and return:

[
    "en",
    "fr",
    "es-MX",
    "es-CO",
]

It also replaces some instances of config('translatable.locales') by the helper.

@ifox
Copy link
Member

ifox commented May 27, 2021

Hi @antonioribeiro, that's great to support it! For context, Twill publishes its own version of the translatable.php config file with only 'en' in the locales by default. Did you publish from the translatable package itself? Still I'm going to test this and merge it!

Heqma
Heqma previously approved these changes Jul 7, 2021
@ifox ifox merged commit c5b341d into area17:2.x Jul 20, 2021
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

Successfully merging this pull request may close these issues.

3 participants