When using Jira translate for plugins in any language, datePicker field fails

Hi,
We are working on Turkish language pack for jira server and jira data center. We have noticed that when we hover a date at datepicker an error is showing.


We tried to solve this bug and found out that calendar plugin causes that bug. For datepicker, under atlassian-jira/includes/lib/calendar/lang directory there are js files to translate several languages. All these js files have Calendar._TT[“TT_DATE_FORMAT”] variable that has different string. This variable controls to format when a user hover a date at date picker. Under atlassian-jira\includes\lib\calendar directory Calendar-min.js file has a function called Date.prototype.print. This function converts TT_DATE_FORMAT into displayable time when a user hovers a date on datepicker. In this function there is an array “i”, this array keeps some date format.

If an expression in Calendar._TT[“TT_DATE_FORMAT”] variable does not found in that array it returns as null. If all the expressions in this variable returns null that causes an error. In calendar-tr.js file
Calendar._TT[“TT_DATE_FORMAT”] = “d MM y, DD”;
The “i” array in Calendar-min.js file does not contain any values for “d”, “MM”, “y”, “DD” so the C variable in this js file becomes null.

Consequently, C.length will cause an error. This error is shown at Calendar-tr.js, Calendar-el.js, Calendar-hr.js languages.
We have created a js file called calendar-tr.js, and copied all the codes from atlassian-jira/includes/lib/calendar/lang/calendar-tr.js
We changed Calendar._TT[“TT_DATE_FORMAT”] = “%a, %b %e”; as in calendar-en.js
And we add

<web-resource key="calendar-tr" i18n-name-key="admin.web.resources.plugin.calendar.tr.name" name="Calendar"
                  state='enabled'>
        <resource type="download" name="calendar-tr.js" location="/js/calendar-tr.js">
            <param name="source" value="webContextStatic"/>
        </resource>
    </web-resource>

this code to atlassian-plugin.xml
But, this js file does not activate when a user hovers a date on datepicker. The datepicker still takes the all paramaters from calendar-tr module in Web Resources Plugin (jira.webresources).


How can we override the calendar-tr.js file? Is there a way to disable the calendar-tr in Web Resources Plugin and activate to our configured calendar-tr.js file?

2 Likes