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

Change i18n selection for select2 #2804

Closed

Conversation

afdev82
Copy link
Contributor

@afdev82 afdev82 commented Jul 19, 2018

I have a problem with the locale "en-US".
The select2 doesn't find the translations.
This PR it's a way to fix the problem.

@kennyadsl
Copy link
Member

is en-US the only locale that you are using?

@afdev82
Copy link
Contributor Author

afdev82 commented Jul 19, 2018

No, I'm using also 'de', 'en', 'fr'

@kennyadsl
Copy link
Member

Which version of solidus and solidus_i18n are you using?

@kennyadsl
Copy link
Member

Anyway, what about creating a new select2_locale_en-US.js file here instead?

@afdev82
Copy link
Contributor Author

afdev82 commented Jul 19, 2018

Solidus is the v2.4.2, but the same code is also in the master.
Solidus_18n is the v1.2.0.

@afdev82
Copy link
Contributor Author

afdev82 commented Jul 19, 2018

Because I don't need different settings for my locale, in general the locale of the store is set to "en-US" because I need different currency formats, but for select2 it should fallback to en.
IMHO it's not handled correctly in the code, the fix is not completely general, because if I wanted to have the js file for "en-US" it doesn't work, but as far as I saw the files are only simply translations in different languages and I think it's fine in this way.

Anyway, what about creating a new select2_locale_en-US.js file here instead?

Anyway, I'm using custom forks of the two projects with small changes. This PR was only to contribute.

@kennyadsl
Copy link
Member

Anyway, I'm using custom forks of the two projects with small changes. This PR was only to contribute.

Thanks for contributing but I think that, as you said, this change is going to make life harder if someone just want have different content in their en-US file. I think we can try another way that is good for everyone. If you want/have time to find alternatives please go ahead, otherwise I'll try to take a deeper look at this soon. Thanks again.

@afdev82
Copy link
Contributor Author

afdev82 commented Jul 19, 2018

Ok, I get the point ;)
In the end it could be more general just to add the file, as you already said.
For me it would be unnecessary, but since we don't have a fallback mechanism, it would be fine for all.

@afdev82
Copy link
Contributor Author

afdev82 commented Jul 19, 2018

See #2805

@afdev82 afdev82 closed this Jul 19, 2018
@afdev82 afdev82 deleted the change_i18n_selection_select2 branch July 19, 2018 10:34
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.

2 participants