зеркало из https://github.com/mozilla/pjs.git
Checked in attachment #136664 for bug 215431: Unlocalizeable strings
This commit is contained in:
Родитель
ee6e9df6d4
Коммит
0a4a9e29f8
|
@ -1248,25 +1248,35 @@ function updateAdvancedRepeatDayOfMonth()
|
|||
|
||||
var weekNumber = getWeekNumberOfMonth();
|
||||
|
||||
document.getElementById( "advanced-repeat-dayofmonth" ).setAttribute( "label", document.getElementById( "onthe-text" ).getAttribute( "value" )+dayNumber+dayExtension+document.getElementById( "ofthemonth-text" ).getAttribute( "value" ) );
|
||||
var calStrings = document.getElementById("bundle_calendar");
|
||||
|
||||
var weekNumberText = getWeekNumberText( weekNumber );
|
||||
var dayOfWeekText = getDayOfWeek( dayNumber );
|
||||
var ofTheMonthText = document.getElementById( "ofthemonth-text" ).getAttribute( "value" );
|
||||
var lastText = document.getElementById( "last-text" ).getAttribute( "value" );
|
||||
var onTheText = document.getElementById( "onthe-text" ).getAttribute( "value" );
|
||||
var dayNumberWithOrdinal = dayNumber + dayExtension;
|
||||
var repeatSentence = calStrings.getFormattedString( "weekDayMonthLabel", [onTheText, dayNumberWithOrdinal, ofTheMonthText] );
|
||||
|
||||
document.getElementById( "advanced-repeat-dayofmonth" ).setAttribute( "label", repeatSentence );
|
||||
|
||||
if( weekNumber == 4 && isLastDayOfWeekOfMonth() )
|
||||
{
|
||||
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", getWeekNumberText( weekNumber )+" "+getDayOfWeek( dayNumber )+document.getElementById( "ofthemonth-text" ).getAttribute( "value" ) );
|
||||
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [weekNumberText, dayOfWeekText, ofTheMonthText] ) );
|
||||
|
||||
document.getElementById( "advanced-repeat-dayofweek-last" ).removeAttribute( "collapsed" );
|
||||
|
||||
document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "label", document.getElementById( "last-text" ).getAttribute( "value" )+getDayOfWeek( dayNumber )+document.getElementById( "ofthemonth-text" ).getAttribute( "value" ) );
|
||||
document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [lastText, dayOfWeekText, ofTheMonthText] ) );
|
||||
}
|
||||
else if( weekNumber == 4 && !isLastDayOfWeekOfMonth() )
|
||||
{
|
||||
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", getWeekNumberText( weekNumber )+" "+getDayOfWeek( dayNumber )+document.getElementById( "ofthemonth-text" ).getAttribute( "value" ) );
|
||||
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [weekNumberText, dayOfWeekText, ofTheMonthText] ) );
|
||||
|
||||
document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "collapsed", "true" );
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", getWeekNumberText( weekNumber )+" "+getDayOfWeek( dayNumber )+document.getElementById( "ofthemonth-text" ).getAttribute( "value" ) );
|
||||
document.getElementById( "advanced-repeat-dayofweek" ).setAttribute( "label", calStrings.getFormattedString( "weekDayMonthLabel", [weekNumberText, dayOfWeekText, ofTheMonthText] ) );
|
||||
|
||||
document.getElementById( "advanced-repeat-dayofweek-last" ).setAttribute( "collapsed", "true" );
|
||||
}
|
||||
|
@ -1338,20 +1348,16 @@ function isAlreadyException( dateObj )
|
|||
|
||||
function getDayExtension( dayNumber )
|
||||
{
|
||||
switch( dayNumber )
|
||||
var dateStringBundle = srGetStrBundle("chrome://calendar/locale/dateFormat.properties");
|
||||
|
||||
if ( dayNumber >= 1 && dayNumber <= 31 )
|
||||
{
|
||||
case 1:
|
||||
case 21:
|
||||
case 31:
|
||||
return( "st" );
|
||||
case 2:
|
||||
case 22:
|
||||
return( "nd" );
|
||||
case 3:
|
||||
case 23:
|
||||
return( "rd" );
|
||||
default:
|
||||
return( "th" );
|
||||
return( dateStringBundle.GetStringFromName( "ordinal.suffix."+dayNumber ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
dump("ERROR: Invalid day number: " + dayNumber);
|
||||
return ( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1458,22 +1464,19 @@ function addAttachment( attachmentToAdd )
|
|||
|
||||
function getWeekNumberText( weekNumber )
|
||||
{
|
||||
switch( weekNumber )
|
||||
var dateStringBundle = srGetStrBundle("chrome://calendar/locale/dateFormat.properties");
|
||||
if ( weekNumber >= 1 && weekNumber <= 4 )
|
||||
{
|
||||
return( dateStringBundle.GetStringFromName( "ordinal.name."+weekNumber) );
|
||||
}
|
||||
else if( weekNumber == 5 )
|
||||
{
|
||||
return( dateStringBundle.GetStringFromName( "ordinal.name.last" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
case 1:
|
||||
return( "First" );
|
||||
case 2:
|
||||
return( "Second" );
|
||||
case 3:
|
||||
return( "Third" );
|
||||
case 4:
|
||||
return( "Fourth" );
|
||||
case 5:
|
||||
return( "Last" );
|
||||
default:
|
||||
return( false );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var launch = true;
|
||||
|
|
|
@ -75,6 +75,9 @@
|
|||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:nc="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="bundle_calendar" src="chrome://calendar/locale/calendar.properties"/>
|
||||
</stringbundleset>
|
||||
|
||||
<!-- Javascript DTD To Variable -->
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/utilityOverlay.js"/>
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
|
||||
<!ENTITY onthe-text "On the ">
|
||||
<!ENTITY last-text "Last ">
|
||||
<!ENTITY ofthemonth-text " of the month.">
|
||||
<!ENTITY ofthemonth-text " of the month">
|
||||
|
||||
|
||||
<!ENTITY todo.title.new "New Task">
|
||||
|
|
|
@ -67,6 +67,8 @@ deleteCalendarMessage=Are you sure you want to delete this calendar?
|
|||
deleteCalendarOnly=Delete Calendar
|
||||
deleteCalendarAndFile=Delete Calendar And File
|
||||
|
||||
weekDayMonthLabel=%1$S %2$S %3$S.
|
||||
|
||||
#
|
||||
# P R E F S
|
||||
# Default values for preferences
|
||||
|
|
|
@ -90,3 +90,43 @@ day.7.short=S
|
|||
|
||||
am-string=AM
|
||||
pm-string=PM
|
||||
|
||||
# Added to support localization of messages within eventDialog.js
|
||||
# Day ordinals imply order within a list.
|
||||
ordinal.suffix.1=st
|
||||
ordinal.suffix.2=nd
|
||||
ordinal.suffix.3=rd
|
||||
ordinal.suffix.4=th
|
||||
ordinal.suffix.5=th
|
||||
ordinal.suffix.6=th
|
||||
ordinal.suffix.7=th
|
||||
ordinal.suffix.8=th
|
||||
ordinal.suffix.9=th
|
||||
ordinal.suffix.10=th
|
||||
ordinal.suffix.11=th
|
||||
ordinal.suffix.12=th
|
||||
ordinal.suffix.13=th
|
||||
ordinal.suffix.14=th
|
||||
ordinal.suffix.15=th
|
||||
ordinal.suffix.16=th
|
||||
ordinal.suffix.17=th
|
||||
ordinal.suffix.18=th
|
||||
ordinal.suffix.19=th
|
||||
ordinal.suffix.20=th
|
||||
ordinal.suffix.21=st
|
||||
ordinal.suffix.22=nd
|
||||
ordinal.suffix.23=rd
|
||||
ordinal.suffix.24=th
|
||||
ordinal.suffix.25=th
|
||||
ordinal.suffix.26=th
|
||||
ordinal.suffix.27=th
|
||||
ordinal.suffix.28=th
|
||||
ordinal.suffix.29=th
|
||||
ordinal.suffix.30=th
|
||||
ordinal.suffix.31=st
|
||||
|
||||
ordinal.name.last=Last
|
||||
ordinal.name.1=First
|
||||
ordinal.name.2=Second
|
||||
ordinal.name.3=Third
|
||||
ordinal.name.4=Fourth
|
||||
|
|
Загрузка…
Ссылка в новой задаче