Problem

1. Enable Locale module.
2. Add a couple languages.
3. Go to the interface translation screen.
4. Enter one translation string.
5. *All of them* will be marked as changed.

This is due to the locale table getting the changed class and the row also getting it.

Proposal

The selector for the changed class should be more specific.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Title: Two bugs following table style updates » Two language table bugs following table style updates
LewisNyman’s picture

Issue tags: +styleguide
YesCT’s picture

Issue tags: +frontend

tagging front end so it shows on the multilingual hub front page when people are looking for tasks matching their skills.

RainbowArray’s picture

I'm trying to help review this issue, but I'm running into problems in duplicating this issue.

  • When I install d8, I don't see a Locale module. I tried enabling the Language module, as somebody on IRC suggested
  • I also enabled the content translation and interface translation modules
  • When I tried to add a language, I was unable to do so. I tried the config link for language on the extend page as well as looking on the configuration page, under regional and language. I am not seeing anywhere that I can add a new language.

Sorry if it is silly that I can't get this to work. I stopped by the Drupal core mentoring office hours and was shown this issue as an option to tackle. I did review the patch in #1986400: Table style update. At first glance, I didn't see anything that should trigger a problem with checkboxes, but it's hard to test without enabling the modules.

If you can point me in the right direction, I'd be glad to take another look!

Gábor Hojtsy’s picture

Indeed. The locale module is called the interface translation module on the user interface. Then you can configure languages under Configuration > Regional and Language > Languages. See the blue "add language" button on that page at the top.

Hope this helps. Thanks for looking into this issue.

RainbowArray’s picture

For the locale changed bug, I'm not sure that the patch listed caused the bug. However, the culprit appears to be the following lines in locale.admin.css

.locale-translate-edit-form .changed {
  background: #ffb;
}

Both the table and the row have the class changed applied to them, so the CSS should probably be rewritten as:

.locale-translate-edit-form tr.changed {
  background: #ffb;
}

One other somewhat unrelated note. If with the new style guide we are getting rid of zebra striping on tables, do we really need odd and even classes on each table row?

RainbowArray’s picture

For the content translation bug, I don't see any CSS lines being applied to the column-settings class (or the field-settings class) on the table row for the image field columns, which is why there's no indentation.

Is this specific to content translation? I don't see anything specifically tied to that module, so I wonder if this is a more general issue with table styles.

Again, I don't see any connection between this bug and the table style update patch.

RainbowArray’s picture

Assigned: Unassigned » RainbowArray
RainbowArray’s picture

Here's a patch to fix the user interface bug. Now only the row color should change, rather than the whole table.

RainbowArray’s picture

Status: Active » Needs review
RainbowArray’s picture

Tested the patch, appears to do the trick.

Screenshots, or it didn't happen.

Before:
pre-patch-all-changed.png

After:
post-patch-one-changed.png

RainbowArray’s picture

FileSize
83.25 KB
59.68 KB

Here's a screenshot of the duplication of part two of this issue, where there's no indentation for image items.
no-indentation.png

When you inspect element on one of the items, like alt, you can see that the table row has the class of column-settings, and the table cell has a class of column.
td-column.png

However, as far I can see there are no special styles being applied to the column-setting or column classes that would create any indentation.

So for there to be indentation, there needs to be some styles to create that indentation.

Is this a problem specific to Locale? Are there other tables that have similar indentation that we could use as a model to determine what sort of indentation should be applied here? Or if there is a generic class that can provide indentation that could be added?

Gábor Hojtsy’s picture

#1807692: Introduce a column synchronization capability and use it to translate alt and titles through the image field widget added the image field feature. It did these changes to introduce the column indent:

--- a/core/modules/translation_entity/translation_entity.admin.css
+++ b/core/modules/translation_entity/translation_entity.admin.css
@@ -11,12 +11,18 @@
   font-weight: bold;
 }
 
-#language-content-settings-form table .field {
+#language-content-settings-form table .field,
+#language-content-settings-form table .column {
   width: 24%;
   padding-left: 3em;
 }
 
-#language-content-settings-form table .field label {
+#language-content-settings-form table .column {
+  padding-left: 5em;
+}
+
+#language-content-settings-form table .field label,
+#language-content-settings-form table .column label {
   font-weight: normal;
 }

I looked at the blame log for the file but this is still there: http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/modul...

So either the form ID changed or the table structure changed or there are conflicting rules that apply.

RainbowArray’s picture

Hmm. I don't see a translation_entity module in the version of 8.x I have downloaded, and I'm pretty sure I'm on the latest version. Is that a contributed module?

RainbowArray’s picture

I've learned that the cause of the second error is that when the content translation module was renamed, the CSS filename was not renamed, and the module info file calls the wrong file. I've created a bug report on this and will be uploading a patch there.

#2059719: Content translation admin CSS file not renamed from translation_entity.admin.css

Gábor Hojtsy’s picture

Title: Two language table bugs following table style updates » Locale string change styles applied too excessively
Status: Needs review » Reviewed & tested by the community

Now needed to retitle this issue since you broke out the fix for one of the problems. This fix looks good too.

Gábor Hojtsy’s picture

Issue tags: +Quick fix
Gábor Hojtsy’s picture

Tagging as quick fix too.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the before/after screenshots in #11. Very helpful!

Committed and pushed to 8.x. Thanks!

Gábor Hojtsy’s picture

Issue tags: -sprint

Woot, thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Update for current scope