-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UHF-8707 other languages bugs #750
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some missing lang and dir attributes found, otherwise the code looks good and works as it should.
templates/component/accordion.twig
Outdated
@@ -28,7 +28,7 @@ | |||
{{ content|default('Missing content'|t) }} | |||
|
|||
<button type="button" class="accordion-item__button accordion-item__button--close" aria-controls="{{ controlled_content_id }}" aria-labelledby="{{ close_button_labelled_by_id }}"> | |||
<span class="is-hidden" id="{{ close_button_labelled_by_id }}">{{ 'Close element: '|t({}, {'context': 'The helper text for close accordion visibility button'}) }}{{ heading|default('Missing heading'|t) }}</span> | |||
<span class="is-hidden" id="{{ close_button_labelled_by_id }}"><span {{ alternative_language ? create_attribute(({ 'lang': lang_attributes.fallback_lang })) }}>{{ 'Close element: '|t({}, {'context': 'The helper text for close accordion visibility button'}) }}</span>{{ heading|default('Missing heading'|t) }}</span> | |||
{{ 'Close'|t({}, {'context': 'The text for close accordion visibility button'}) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This row is still missing a proper lang
attribute. This "Close" word will be read with rally-ukrainian or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrapped this with a <span lang="en" dir="ltr">
.
templates/component/accordion.twig
Outdated
@@ -28,7 +28,7 @@ | |||
{{ content|default('Missing content'|t) }} | |||
|
|||
<button type="button" class="accordion-item__button accordion-item__button--close" aria-controls="{{ controlled_content_id }}" aria-labelledby="{{ close_button_labelled_by_id }}"> | |||
<span class="is-hidden" id="{{ close_button_labelled_by_id }}">{{ 'Close element: '|t({}, {'context': 'The helper text for close accordion visibility button'}) }}{{ heading|default('Missing heading'|t) }}</span> | |||
<span class="is-hidden" id="{{ close_button_labelled_by_id }}"><span {{ alternative_language ? create_attribute(({ 'lang': lang_attributes.fallback_lang })) }}>{{ 'Close element: '|t({}, {'context': 'The helper text for close accordion visibility button'}) }}</span>{{ heading|default('Missing heading'|t) }}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This row is missing dir
-attribute for the fallback language. If the page is for example in arabic, this code could fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the dir
-attribute.
templates/misc/component.twig
Outdated
@@ -56,7 +56,7 @@ Example usage: | |||
|
|||
<div class="component__container"> | |||
{% if hasTitle %} | |||
<{{ component_title_level|default('h2') }} class="component__title"> | |||
<{{ component_title_level|default('h2') }} class="component__title" {{ use_component_title_lang_fallback ? create_attribute(({ 'lang': lang_attributes.fallback_lang })) }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This row is missing dir
-attribute for the fallback language. If the page is for example in arabic, this code could fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the dir
attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works as it shoud! Approved for merge 🥳
UHF-8707
What was done
How to install
git pull origin dev
make fresh
composer require drupal/hdbt:dev-UHF-8707_other-languages-bugs
make drush-cr
How to test
<span lang="en">
.lang="en"
.Designers review
Other PRs