Skip to content
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

Use translatable string for aria-labels on next/previous buttons #39

Open
danchamp opened this issue Jun 22, 2021 · 0 comments
Open

Use translatable string for aria-labels on next/previous buttons #39

danchamp opened this issue Jun 22, 2021 · 0 comments
Assignees

Comments

@danchamp
Copy link
Collaborator

<a href="{{ path('entity.node.canonical', {'node': prev_step_nid }) }}" class="btn btn-carbon" aria-label="Previous step: {{ prev_step_title }}"><span class="fa fa-chevron-left"></span>{{ prev_step_link_text }}</a>

<a href="{{ path('entity.node.canonical', {'node': next_step_nid }) }}" class="btn btn-primary" aria-label="Next step: {{ next_step_title }}"><span class="fa fa-chevron-right"></span>{{ next_step_link_text }}</a>

The module provides prev_step_link_text and next_step_link_text variables for this purpose:

$variables['prev_step_link_text'] = t('Previous Step');

$variables['next_step_link_text'] = $is_first_step ? t('Next Step') : t('Next Step');

@danchamp danchamp self-assigned this Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant