Fix localization of recurrence editor
parent
5b4dd4ecb1
commit
d85ada6750
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
|
#import <Foundation/NSUserDefaults.h> /* for locale string constants */
|
||||||
|
|
||||||
#import <Common/UIxPageFrame.h>
|
#import <Common/UIxPageFrame.h>
|
||||||
|
|
||||||
|
@ -29,6 +30,19 @@
|
||||||
|
|
||||||
@implementation UIxRecurrenceEditor
|
@implementation UIxRecurrenceEditor
|
||||||
|
|
||||||
|
- (NSArray *) shortWeekDaysList
|
||||||
|
{
|
||||||
|
static NSArray *shortWeekDaysList = nil;
|
||||||
|
|
||||||
|
if (!shortWeekDaysList)
|
||||||
|
{
|
||||||
|
shortWeekDaysList = [locale objectForKey: NSShortWeekDayNameArray];
|
||||||
|
[shortWeekDaysList retain];
|
||||||
|
}
|
||||||
|
|
||||||
|
return shortWeekDaysList;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSArray *) monthlyRepeatList
|
- (NSArray *) monthlyRepeatList
|
||||||
{
|
{
|
||||||
static NSArray *monthlyRepeatList = nil;
|
static NSArray *monthlyRepeatList = nil;
|
||||||
|
@ -45,13 +59,12 @@
|
||||||
|
|
||||||
- (NSArray *) monthlyDayList
|
- (NSArray *) monthlyDayList
|
||||||
{
|
{
|
||||||
static NSArray *monthlyDayList = nil;
|
static NSMutableArray *monthlyDayList = nil;
|
||||||
|
|
||||||
if (!monthlyDayList)
|
if (!monthlyDayList)
|
||||||
{
|
{
|
||||||
monthlyDayList = [NSArray arrayWithObjects: @"Sunday", @"Monday", @"Tuesday",
|
monthlyDayList = [NSMutableArray arrayWithArray: [locale objectForKey: NSWeekDayNameArray]];
|
||||||
@"Wednesday", @"Thursday", @"Friday",
|
[monthlyDayList addObject: @"DayOfTheMonth"];
|
||||||
@"Saturday", @"DayOfTheMonth", nil];
|
|
||||||
[monthlyDayList retain];
|
[monthlyDayList retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,9 +77,7 @@
|
||||||
|
|
||||||
if (!yearlyMonthList)
|
if (!yearlyMonthList)
|
||||||
{
|
{
|
||||||
yearlyMonthList = [NSArray arrayWithObjects: @"January", @"February", @"March",
|
yearlyMonthList = [locale objectForKey: NSMonthNameArray];
|
||||||
@"April", @"May", @"June", @"July", @"August",
|
|
||||||
@"September", @"October", @"November", @"December", nil];
|
|
||||||
[yearlyMonthList retain];
|
[yearlyMonthList retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,9 +90,7 @@
|
||||||
|
|
||||||
if (!yearlyDayList)
|
if (!yearlyDayList)
|
||||||
{
|
{
|
||||||
yearlyDayList = [NSArray arrayWithObjects: @"Sunday", @"Monday", @"Tuesday",
|
yearlyDayList = [locale objectForKey: NSWeekDayNameArray];
|
||||||
@"Wednesday", @"Thursday", @"Friday",
|
|
||||||
@"Saturday", nil];
|
|
||||||
[yearlyDayList retain];
|
[yearlyDayList retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,4 +137,25 @@
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) idForWeekDay
|
||||||
|
{
|
||||||
|
static NSArray *shortWeekDaysList = nil;
|
||||||
|
NSString *id;
|
||||||
|
|
||||||
|
if (!shortWeekDaysList)
|
||||||
|
{
|
||||||
|
shortWeekDaysList = [locale objectForKey: NSShortWeekDayNameArray];
|
||||||
|
[shortWeekDaysList retain];
|
||||||
|
}
|
||||||
|
|
||||||
|
id = [NSString stringWithFormat: @"weekDay%i", [shortWeekDaysList indexOfObject: item]];
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) labelForWeekDay
|
||||||
|
{
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -70,13 +70,9 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="week"><span class="week">
|
<div id="week"><span class="week">
|
||||||
<div id="weekDay1"><p><var:string label:value="Mon"/></p></div>
|
<var:foreach list="shortWeekDaysList" item="item"
|
||||||
<div id="weekDay2"><p><var:string label:value="Tue"/></p></div>
|
><div var:id="idForWeekDay"><p><var:string value="labelForWeekDay"/></p></div>
|
||||||
<div id="weekDay3"><p><var:string label:value="Wed"/></p></div>
|
</var:foreach>
|
||||||
<div id="weekDay4"><p><var:string label:value="Thu"/></p></div>
|
|
||||||
<div id="weekDay5"><p><var:string label:value="Fri"/></p></div>
|
|
||||||
<div id="weekDay6"><p><var:string label:value="Sat"/></p></div>
|
|
||||||
<div id="weekDay0"><p><var:string label:value="Sun"/></p></div>
|
|
||||||
</span><span class="week"><!-- space --></span>
|
</span><span class="week"><!-- space --></span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -98,9 +94,9 @@
|
||||||
<input name="monthlyRadioButtonName" value="0" id="monthlyRadioButton" type="radio"
|
<input name="monthlyRadioButtonName" value="0" id="monthlyRadioButton" type="radio"
|
||||||
/><var:string label:value="The"
|
/><var:string label:value="The"
|
||||||
/><var:popup list="monthlyRepeatList" const:id="monthlyRepeat" item="item"
|
/><var:popup list="monthlyRepeatList" const:id="monthlyRepeat" item="item"
|
||||||
string="itemText" selection="First"
|
string="itemText"
|
||||||
/><var:popup list="monthlyDayList" const:id="monthlyDay" item="item"
|
/><var:popup list="monthlyDayList" const:id="monthlyDay" item="item"
|
||||||
string="itemText" selection="Monday"
|
string="itemText"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -177,7 +173,7 @@
|
||||||
class="textField"
|
class="textField"
|
||||||
var:value="title"
|
var:value="title"
|
||||||
/><var:popup list="yearlyMonthList" const:id="yearlyMonth1" item="item"
|
/><var:popup list="yearlyMonthList" const:id="yearlyMonth1" item="item"
|
||||||
string="itemText" selection="January"/>
|
string="itemText"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="recurrenceYearly" style="display:none;">
|
<tr class="recurrenceYearly" style="display:none;">
|
||||||
|
@ -190,7 +186,7 @@
|
||||||
<var:popup list="monthlyRepeatList" const:id="yearlyRepeat" item="item"
|
<var:popup list="monthlyRepeatList" const:id="yearlyRepeat" item="item"
|
||||||
string="itemText" selection="First"
|
string="itemText" selection="First"
|
||||||
/><var:popup list="yearlyDayList" const:id="yearlyDay" item="item"
|
/><var:popup list="yearlyDayList" const:id="yearlyDay" item="item"
|
||||||
string="itemText" selection="Monday"/>
|
string="itemText"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="recurrenceYearly" style="display:none;">
|
<tr class="recurrenceYearly" style="display:none;">
|
||||||
|
@ -200,7 +196,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<var:popup list="yearlyMonthList" const:id="yearlyMonth2" item="item"
|
<var:popup list="yearlyMonthList" const:id="yearlyMonth2" item="item"
|
||||||
string="itemText" selection="January"/>
|
string="itemText"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue