My patch adds some accessibility titles to date navigation output:
- provided prev/next link-title in day/week/year/month granularity
- provided (for mini-calendar) month link-title

CommentFileSizeAuthor
more_accessibile_date_navigation.patch2.23 KBthePanz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mgifford’s picture

I couldn't find any sub-directories within contributions/modules/date/theme/

So had trouble tracking down Attic/theme.inc

I did think that the main diff block could be shortened though:

+
+  $prev_title = t('Navigte to prev %granularity', array('%granularity' => $view->date_info->granularity));
+  $next_title = t('Navigte to next %granularity', array('%granularity' => $view->date_info->granularity));
+  $vars['prev_options'] += array('attributes' => array('rel' => 'nofollow'), 'title' => $prev_title);
+  $vars['next_options'] += array('attributes' => array('rel' => 'nofollow'), 'title' => $next_title);
-  $vars['prev_options'] += array('attributes' => array('rel' => 'nofollow'));
-  $vars['next_options'] += array('attributes' => array('rel' => 'nofollow'));

Wouldn't that do the trick?

Mike

thePanz’s picture

I created a patch using TortoiseCVS, I don't know what is that "Attic" inside the module direcotry.. I hope that KarenS could help us!

The need for a more detailed t() without the %granularity placeholder is for non-English languages where (maybe) the sentence construction isn't so easy and linear..

What do you think?

mgifford’s picture

Yes, I was thinking about that a bit. Tomorrow, next week, next year all could be done quite differently in different languages (unfortunately).

So this would accommodate that:

+
+  $prev_title = t('Navigte to prev ' . $view->date_info->granularity);
+  $next_title = t('Navigte to next ' . $view->date_info->granularity);
+  $vars['prev_options'] += array('attributes' => array('rel' => 'nofollow'), 'title' => $prev_title);
+  $vars['next_options'] += array('attributes' => array('rel' => 'nofollow'), 'title' => $next_title);
-  $vars['prev_options'] += array('attributes' => array('rel' => 'nofollow'));
-  $vars['next_options'] += array('attributes' => array('rel' => 'nofollow'));

Not 100% certain that's the best way to do it for i18n, but...

Mike

thePanz’s picture

String concats in t() is a wrong way to go: auto POT extraction can't guess the right string to provide as a translation template!

Are you using latest -dev release?

KarenS’s picture

Status: Needs review » Fixed

I agree with thePanz that the original patch will work best for translations. I also fixed a spelling error 'navigate' and added the full text for previous instead of prev. Since these are titles they don't take up any room on the page so there is plenty of space to spell things out.

So, committed. Thanks!

thePanz’s picture

Thank you KarenS! :)

Status: Fixed » Closed (fixed)
Issue tags: -Accessibility

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