Problem/Motivation
Analysis CSV isn't completely translated and current code is messy.
Proposed resolution
- Refactor component localizations to component spesific files, similarly to what's happening in webform/components/*.inc files
- Add missing translations where needed
Remaining tasks
Code this
User interface changes
none
API changes
New webform style "component hooks".
Original report by @mikran
Similarly to #2187583: String translations are not applied to webform result analysis page strings data export headers and select values are not translated.
I'll start working on this.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | refactor-2209419-22.patch | 17.02 KB | joseph.olstad |
Comments
Comment #1
GDrupal commented@mikran Great! Note that automated testing is enabled at least covering localization by string translation. If you could include a test + feature will be super cool.
Comment #2
mikran commentedBlocker issue #2210433: hook_webform_csv_header_alter() does not really allow any alterations opened to webform issue queue.
Comment #3
mikran commentedThis isn't ready yet by far and requires patch from above issue to function even partially. It takes quite a bit longer to fix this than I initially thought. But here is what I got so far.
Comment #4
GDrupal commentedGreat Job mikran! Just wait for quicksketch feedback...and take from there.
Comment #5
GDrupal commentedComment #6
mikran commentedrerolled & small updates
Comment #7
mikran commentedThis is stupid to add
ifs for each component type. I'll refactor the component translations completelyComment #8
mikran commentedAttached patch does the refactoring, and adds 3 new "component hooks":
_webform_localization_csv_header_component(),_webform_localization_csv_data_component()and_webform_localization_analysis_data_component().Comment #9
mikran commentedSelect element is now fully localized in CSV exports. That's all I'm adding for now.
Comment #10
mikran commentedsyntax error fixed
Comment #11
joseph.olstadI'm guessing that with recent changes the patch will need a reroll as it probably won't apply.
but try anyway.
Comment #16
joseph.olstadSame patch as mikran rerolled , simpletest needs a new file to review.
Comment #18
joseph.olstadrefactored due to a small change in webforms_localization.test that was done recently (during the fury of fixing head tests)
$admin_userwas changed to$adminuserand
$normal_userwas changed to$normaluserComment #20
joseph.olstadOk, patch 18 gets us down to only 24 fails and 0 exceptions (from 36 fails and 10 exceptions on patch 16)
still some work to do.
Comment #21
joseph.olstadmy last patch was missing a bunch of new files that was in patch 10 , I just created a new patch with all the files and the minor fix from the last patch.
Lets try this again.
Comment #23
joseph.olstadComment #25
joseph.olstadThanks mikran, great work! just had to do some minor refactoring to get it to pass testing.
Committed and attributed.