Problem/Motivation

Both "Context" and "Behavior" of the perspective tabs are not translatable text.

Proposed resolution

Make them translatable.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yongt9412 created an issue. See original summary.

johnchque’s picture

Status: Active » Needs review
FileSize
1.09 KB

Adding t to the tabs text.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

Berdir’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
@@ -1050,7 +1050,7 @@ class ParagraphsWidget extends WidgetBase {
       if ($items->getEntity()->getEntityTypeId() != 'paragraph') {
-        $tabs = '<ul class="paragraphs-tabs tabs primary clearfix"><li id="content" class="tabs__tab"><a href="#' . $field_prefix . '-values">Content</a></li><li id="behavior" class="tabs__tab"><a href="#' . $field_prefix . '-values">Behavior</a></li></ul>';
+        $tabs = '<ul class="paragraphs-tabs tabs primary clearfix"><li id="content" class="tabs__tab"><a href="#' . $field_prefix . '-values">' . $this->t('Content') . '</a></li><li id="behavior" class="tabs__tab"><a href="#' . $field_prefix . '-values">' . $this->t('Behavior') . '</a></li></ul>';
       }

Lets add 'paragraphs' or maybe 'paragraphs widget' as translation context, so these specific instances of Content and Behaviors can be translated differently here.

There are existing translations for those and they might not make sense for our UI.

Berdir’s picture

I think just paragraphs as context is fine, maybe we should also add it in other places where we use Behaviors, e.g. the paragraphs type settings form? not sure.

johnchque’s picture

Status: Needs work » Needs review
FileSize
2.15 KB
2.03 KB

This should be fine, there are no other usages of the word Behavior in the module.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Committed. :-)

Status: Fixed » Closed (fixed)

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