Missing translation in product variant selection upon order creation
Description
"Please enter 3 or more characters" alert is not translated:
Steps to Reproduce
- From the back office, create a new order
- When adding a product, hit the "Select a variant" dropdown
Severity
S4
Your Environment
- Version used: v1.22.0
I think we said internatinalisation issues like translation issue would go directly to dev ready, should be solved quickly as quick things and annoying for local users in other instances. So I put it to dev ready :-)
I looked into this one and had some fun pinning it down:
- I searched the project for "please enter 3 or more characters" and didn't find it
- I searched our version of spree and didn't find it
- I searched foundation and didn't find it
- I googled the phrase and got this: https://github.com/translate/pootle/issues/6461. So the text comes from the gem select2-rails.
- I searched for select2 in our repo, found its declaration in its gem (.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/select2-rails-3.5.10/vendor/assets/javascripts/select2.js), searched there for the target text, and found it:

So that's the text that isn't translating. The gem includes a translation file for French in the same directory, so either select2 isn't receiving our locale properly, or this version of the gem has a bug. I looked through the source history in their repo and determined that they've overhauled their translation system since this version. I wasn't able to simply update the gem, so I investigated and found the following dependencies:

I welcome any suggestions at this point!
Where's that file you shared in the screenshot @haseleyi ? I can't find it. I think there's not much more we can do other than providing the translations ourselves like that screenshot.
It's in the select2-rails gem. Mine is here: .rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/select2-rails-3.5.10/vendor/assets/javascripts/select2.js I found this by finding an instance of "select2" in our code (in variant_autocomplete.js.coffee). Visiting its declaration took me to select2.js. Is it possible to translate a string coming from outside OFN and outside Spree?
interesting, the select2 dependency comes with locale files with the translations, for example, select2_locale_fr.js we probably need to activate that in some way. and maybe also add the select2 locale files to our js assets...
I'm interesting in resolving this issue! Could someone please assign me?
Of course! Here you go, @brittneyhoneycutt! Looking forward to your contributions! :partying_face:
I can take this up, can someone assign me this issue?
Thank you @anoosh96 🎉 Welcome!
Hello @anoosh96 I hope this message finds you well. Are you still working on this issue? I'm just checking in, no pressure ;)
Dear @anoosh96 I've unassigned you from this issue, feel free to ask us if you want to work on it!