Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After enabling the content translation module, if you go to (/admin/config/regional/content-language), this text is displayed:
"Before you can translate content, there must be at least two languages added on the languages administration page.Change language settings for content types, taxonomy vocabularies, user profiles, or any other supported element on your site."
Notice that there is no space between the two sentences.
Comment | File | Size | Author |
---|---|---|---|
#7 | after-patch-7-space-only.png | 9.03 KB | Anonymous (not verified) |
#7 | after-patch-7.png | 9.29 KB | Anonymous (not verified) |
#7 | after-patch-2.png | 9.36 KB | Anonymous (not verified) |
#7 | before.png | 9.03 KB | Anonymous (not verified) |
#7 | interdiff-2-7.txt | 1.03 KB | Anonymous (not verified) |
Comments
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commented"Change language settings..." appeared here, and we have not reason use it without
<p>
wrapper. Also this patch solves Drupal Coding StandardAvoid backslash escaping in translatable strings when possible, use "" quotes instead
Comment #3
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedPatch with correct format uploaded , working and tested.
Comment #4
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #6
cilefen CreditAttribution: cilefen commentedFor me, with the patch, there are two spaces between the paragraphs.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedOriginal:
After patch 2:
After patch 7:
After patch 7-space-only:
Comment #8
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commented#7 looks good.
Comment #9
xjmComment #10
alexpottWhich patch is rbtc? I think the patch called 2845644-7.patch is more correct. Adding a space at the end of the sentence just hanging there is really odd. It also means that there is no translatable string change and the issues around RTL languages are better.
Can someone please clarify and think about what's best here.
Comment #11
xmacinfoIt looks like we are aiming for 2845644-7.patch :-)
@vaplas: can you confirm that you rolled 2845644-7.patch against Drupal 8.4.x-dev?
Comment #12
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedSorry for the confusion in #7 , "2845644-7.patch" : tested this patch , works fine in both 8.3.x and 8.4.x . So marking it back as RTBC. It changes the way the info is displayed to very clean way.
Comment #13
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedabsolutely +1 to 2845644-7.patch. Sorry for the noise with 2845644-7-space-only.patch
Comment #15
xjmSo I reviewed #7 (the first one) with
git diff --color-words
and confirmed that it properly wraps paragraphs in<p>
tags, rather than using the<br />
which is nonstandard. That also means it does not change any translatable strings by fixing the markup, which is good.However, it is also changing the quoting on the second string from single to double quotes. This avoids having to escape the apostrophe, but is slightly out of scope. I can't remember whether the translatable strings are parsed by PHP or not right now (i.e., will changing the
\'
to'
be picked up as a string change that translators need to retranslate). Checking on that now.The patch does not affect grammar, only whitespace.
Comment #16
xjmOkay, I actually dug into potx to answer this question:
http://cgit.drupalcode.org/potx/tree/potx.inc#n709
Strings with no placeholders are identified by looking for
T_CONSTANT_ENCAPSED_STRING
. Then:So, they should end up as the same thing, but that wasn't a sure thing.
In the future though, probably best to avoid changing the string's quotation method in another fix, to avoid out of scope changes. See https://www.drupal.org/core/scope for lots of background information on why scope is important, even for small things.
Comment #18
xjmWrapping any paragraph in paragraph tags ensures that HTML handles the whitespace, and is our standard, so agreed that it is the best fix. In the future let's be sure to upload the intended fix as the last attachment to the issue and avoid even small changes to code that is not part of the fix.
Since this ended up just being a small markup bugfix, without a translatable string change, and since we are still in alpha, I backported it to 8.3.x also to avoid unnecessary divergence.
Thanks everyone! Committed to 8.4.x and 8.3.x.
Comment #20
xjmSorry, d.o ate the credit I had saved for this issue, so reverting and recommitting.
Comment #22
xjmComment #25
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedI don't understand why there is inconsistency in using single and double quotes in help text for content translation and language module. Shouldn't this also be standardised ?