Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
locale.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Aug 2012 at 12:37 UTC
Updated:
29 Jul 2014 at 21:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidComment #3
gábor hojtsyGood find, thanks will review later when I have time.
Comment #4
dave reidOk, I shouldn't have tried to change the file upload field to a managed_file field.
Comment #5
dave reidOk this one should work.
Comment #6
dave reidOne more time. :)
Comment #7
bforchhammer commentedI'll have a look at this...
Comment #8
bforchhammer commentedPatch works as advertised. I tested it with a german translation file, and "German" is automatically selected in the language dropdown.
The patch also improves the help message for file-validation criteria by switching to
theme_file_upload_helpand adds the "maximum file size". Nice :)Code looks clean and should be ready as far as I can tell.
Comment #9
webchickAwesome UX improvement!
I found this comment confusing:
"+ * This only works if the file is named something.locale-code.po."
I think it should be more like:
"+ * This only works if the file name ends with "LANGCODE.po."
And then it occurred to me that we don't have a thing called "localeCode" and so this should be changed to "langCode" throughout to be consistent.
I asked nod_ & seutje to take a look at the new JS and they said:
seutje: if that behavior is executed again, it would have 2 identical change handlers, won't it?
nod_: yep
nod_: webchick: well, it's the right Drupal.stuff at least, code could use some work to make it prettier
Asked them to follow-up here with more details, they did emphasize it doesn't necessarily have to hold up the patch but if we can get it all in one go, then woot.
Comment #10
nod_For the future, If there is some js touched or added by a patch please add the JavaScript tag to the issue :)
Here is a reroll with kinda better JS. I added classes to the inputs as well, easier js selectors.
Comment #11
penyaskitoChanged localeCode for LANGCODE in js documentation.
Switched behavior name from importLocaleCodeSelector to importLanguageCodeSelector.
Comment #12
gábor hojtsyComment #13
dave reidThe JS here seemed to regress because if you upload a file with a language code that does not match the any of the available options, it will select the first option in the list. The expected result is that it should *not* change the option that is selected.
Comment #14
nod_which browser?
Comment #15
dave reidChrome 21 and Firefox. We should not call .val() on an element which does not actually have that value. Why was that removed?
Comment #16
nod_nevermind, fixed, sorry about that. That'll teach me to try to be too smart :p
Comment #17
gábor hojtsyLooks good again! :)
Comment #18
dries commentedA quick screenshot would be nice! :)
Comment #19
gábor hojtsyScreenshot:

Comment #20
dries commentedThanks. That helps. This looks handy, and code looks good so committed to 8.x. Thanks!
Comment #21
gábor hojtsyRemoving from sprint. I don't think this should get a changelog entry or change notice, it is such a tiny improvement. Thanks all though!