-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
select2 add i18n for other locale #3598
Conversation
fix all select2
change to single line and better js view display during initial obj, the language parameter is need.
@if (app()->getLocale() !== 'en') | ||
language: "{{ $str_replace('_', '-', app()->getLocale()); }}", | ||
@endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shiroamada is this part necessary?
Because until now we didn't use it, by only loading the script of the language .../i18n/pt.js
it would load the language.
Can you confirm this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shiroamada, you were right, without that it doesn't work. Meanwhile I moved it to element attributes.
Thank you for you help 🙌
Hmm this is interesting @shiroamada . Maybe there's room here to clear up which format we should use for the language string. It's always been one of those questions in Laravel that I didn't know the answer to. And I think you can tell by our
Also, the only relevant standards I could find are RFC 5646 and [https://tools.ietf.org/html/rfc4646](RFC 4646), both of which encourage dash (not underscore). PHP also gives the same thing as an example. So I guess the question becomes: why did you choose to make your language The reason I'm asking is that... since the JS library already uses RFC 5646, if you'd use Thanks for the PR - really appreciate it. Just trying to get a handle of it since I don't work with dash-languages very often. |
Hello @shiroamada , thanks for the PR. 👍 @tabacitu this is something we are already aware, more info at: #3537 We should fix this in next version, or in this one using aliases ? |
Thanks for your reply. I didn't notice that there is a RFC standard on it. Another popular Laravel-Lang, I believe is created by Chinese, because of the readme also given Chinese explanation. I went to China Laravel website, they also have people discuss about it. Another part is I use for underscore(_), because of I use Carbon datime format.
I also no idea which one is the correct solution. Something new to me. This one I think should be putting in debate :) Or the best Backpack can support both~ |
Wow - thanks for the detailed explanation @shiroamada . I had no idea things were so divided. Using @pxpm I believe we can support both in 4.1 already, with copy-pasted folders. It'll be duplicate code, but hey... at least we help those people... Then in Backpack 4.2 we can delete the |
The inspection completed: No new issues |
@tabacitu in my opinion this PR is ready 👌 Meanwhile, you've closed #3537, and that is another task, a BC for 4.2, clean those duplicated locale folders. |
WHOOP-WHOOP! Congrats, your first PR on this repo has officialy been merged. You should also receive an email inviting you to the Community Members team. That's where we, commited community members, debate new features and decide what's in the Backpack roadmap. Feel free to ignore the invitation if you're not interested :-) If you want to help out the community in other ways, you can:
Again. Thank you for the PR. You are a wonderful person. Keep 'em coming :-) -- P.S. Help in the Backpack community is rewarded with free Backpack commercial licenses. It's the least we can do. If you feel you've helped the community with PRs, help & other stuff, please apply for free licenses and mention this PR. You scratch my back, I scratch your back. Thank you! |
Great! Thanks again @shiroamada - merged, will be tagged and available with a @promatik - note to self. In the future we should consider creating helpers to get the app language in these two formats. Something like... |
@tabacitu I agree with that if we have more cases like |
for select2 blade file, I added language parameter when initial the select2 element.
Added for language support