Search code examples
sharepointcalendaraccessibilitysharepoint-2013alt

in SharePoint Calendar, How to add alternative text for next and previous button in other language?


SharePoint Calendar in multilingual page. The next and previous navigation links of calendar does not add alternative text to image in other language (for example in Arabic) which is an issue and does not compliance with accessibility guidelines.

In English it shows like

<a id="WPQ2_nav_next_a" href="javascript:MoveToDate('2\u002f16\u002f2020','WPQ2');" title="Next Month"><img id="WPQ2_nav_next_img" src="/_layouts/15/1033/images/calnext.png" width="19" height="19" alt="Next button"></a>

In Arabic it shows

<a id="WPQ2_nav_next_a" href="javascript:MoveToDate('16\u002f02\u002f2020','WPQ2');" title="الشهر القادم"><img id="WPQ2_nav_next_img" src="/_layouts/15/1025/images/calnext.png" width="19" height="19"></a>

please advise.


Solution

  • The above solution is fine, but after investigation more, found that there is a bug in the SharePoint calendar Previous button. It add ')' within the image tag which generate the issue. To resolve that applied below,

    jQuery("[id$='nav_prev_img']").removeAttr(')');
    jQuery("[id$='nav_next_img']").attr('alt', 'Next button');
    jQuery("[id$='nav_prev_img']").attr('alt', 'Previous button');
    

    Thanks