Problem/Motivation
Config translation form source labels are in English even if the site is installed in French and translating to Spanish. The target label should also be translated - I'm not sure whether this should be to French or Spanish.
For example here is translating the System information config:
Proposed resolution
tbd
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#17 | interdiff.txt | 1.74 KB | Gábor Hojtsy |
#17 | 2697291-17.patch | 5.2 KB | Gábor Hojtsy |
#15 | interdiff-13-15.txt | 801 bytes | maxocub |
#15 | 2697291-15.patch | 5.2 KB | maxocub |
#13 | interdiff-8-13.txt | 2.04 KB | maxocub |
Comments
Comment #2
tstoecklerHeh, that's a good question. Some thinking out loud:
So having written that my personal stance would be that both labels should be in the current interface language (i.e. French in your example). I'm guessing that was probably the intended behavior - maybe even the previous behavior that was never tested and broken at some point due to refactoring of the language override functionality (that's just a guess though, not actually blaming anyone (but for myself for not writing tests for this ;-))). The only other possible solution I personally see is to also display both labels in the current interface language but link to the translation form in the interface language of the target language (i.e. Spanish in your example; concretely: make the link point to
/es/admin/.../translations/add/es
instead of/admin/.../translations/add/es
) to be consistent with Content Translation, but - again - I personally don't think that's a pattern we should be spreading.Comment #3
Gábor HojtsyI think all labels on this form (both "columns") should be in the interface language for the page. If they are not currently, that is hopefully due to them not being translated yet on your site? The labels from config schema are certainly exported in potx for translation to my best knowledge.
Comment #4
alexpottThe labels are translated :( so we have a bug here. I think the roots of which are in how the config translation form elements are built.
Comment #5
Gábor HojtsySo the labels are only translated for plural variant elements apparently. Don't know how this happened :D
Untested patch attached, but based on the PluralVariant.php code, it should work. Definitely needs tests. Can someone help with that? :)
Comment #6
Gábor HojtsyComment #7
Gábor HojtsyAt leas that did not fail anything. Anybody can help with testing?
Comment #8
maxocub CreditAttribution: maxocub commentedAdds a test to check that the labels are translated.
Comment #10
alexpottThe assertion message here is wrong - you;re checking that the test is found - plus it is unnecessary the default message is better.
I also think we should assert that the english label is not present.
Comment #11
alexpottI also think we need to test a case were the interface and target languages are different.
Comment #12
maxocub CreditAttribution: maxocub commented@alexpott: Thanks for the review, I'll make the corrections.
Comment #13
maxocub CreditAttribution: maxocub commentedComment #14
alexpottWe need one more test like this...
Just to check the form in the default language. Unless this check is done elsewhere in the test.
Comment #15
maxocub CreditAttribution: maxocub commented@alexpott: No, it wasn't done anywhere else in the test, so here it is.
Comment #16
Gábor HojtsyAmazing, looks great except all the sentences in the tests missing a period at their end. :)
Comment #17
Gábor HojtsyHere it is, so I don't just complain :D RTBC since adding a few periods is very minor.
Comment #18
alexpottCommitted 3c88f61 and pushed to 8.1.x and 8.2.x. Thanks!
Comment #22
Gábor HojtsyYay, thanks!
Comment #23
maxocub CreditAttribution: maxocub as a volunteer and commented