refType = 4;
sourceTree = "<group>";
};
+ ADCDE53106ADA8AC00BFCE2B = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = text.plist.strings;
+ name = English;
+ path = English.lproj/default.strings;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ ADCDE53206ADA8C800BFCE2B = {
+ children = (
+ ADCDE53106ADA8AC00BFCE2B,
+ ADCDE53306ADA8CF00BFCE2B,
+ );
+ isa = PBXVariantGroup;
+ name = default.strings;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ ADCDE53306ADA8CF00BFCE2B = {
+ isa = PBXFileReference;
+ lastKnownFileType = text.plist.strings;
+ name = French;
+ path = French.lproj/default.strings;
+ refType = 4;
+ sourceTree = "<group>";
+ };
//AD0
//AD1
//AD2
};
E87207EA0692E3D20099CBBD = {
children = (
- E872088E0692E3D30099CBBD,
E872088F0692E3D30099CBBD,
E87208910692E3D30099CBBD,
E87208920692E3D30099CBBD,
E872090C0692E3D30099CBBD,
E87208D30692E3D30099CBBD,
+ E872088E0692E3D30099CBBD,
E87208E20692E3D30099CBBD,
+ ADCDE53206ADA8C800BFCE2B,
E8720A0C0692E4940099CBBD,
E87208960692E3D30099CBBD,
E8720A3B0692E4C20099CBBD,
sourceTree = "<group>";
};
E87208930692E3D30099CBBD = {
+ explicitFileType = sourcecode.make;
fileEncoding = 4;
isa = PBXFileReference;
- lastKnownFileType = text;
path = GNUmakefile;
refType = 4;
sourceTree = "<group>";
+ tabWidth = 4;
};
E87208940692E3D30099CBBD = {
+ explicitFileType = sourcecode.make;
fileEncoding = 4;
isa = PBXFileReference;
- lastKnownFileType = text;
path = GNUmakefile.postamble;
refType = 4;
sourceTree = "<group>";
+ tabWidth = 4;
};
E87208950692E3D30099CBBD = {
+ explicitFileType = sourcecode.make;
fileEncoding = 4;
isa = PBXFileReference;
- lastKnownFileType = text;
path = GNUmakefile.preamble;
refType = 4;
sourceTree = "<group>";
+ tabWidth = 4;
};
E87208960692E3D30099CBBD = {
children = (
+2004-07-20 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * UIxComponent.[hm]: new method -labelForKey: implemented very similar to
+ new WOLabelAssociation in SOPE. Also implemented -locale. (v0.9.2)
+
2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* UIxComponent.m: new method -backendTimeZone.
- (NSString *)dateStringForDate:(NSCalendarDate *)_date;
- (NSCalendarDate *)dateForDateString:(NSString *)_dateString;
+/* labels */
+- (NSString *)labelForKey:(NSString *)_key;
+
+/* locale */
+- (NSDictionary *)locale;
+
@end
#endif /* __UIxComponent_H_ */
calendarFormat:@"%Y%m%d %H:%M:%S %Z"];
}
+
+/* labels */
+
+- (NSString *)labelForKey:(NSString *)_str {
+ WOResourceManager *rm;
+ NSArray *languages;
+ WOContext *ctx;
+ NSString *label;
+ NSString *lKey, *lTable, *lVal;
+ NSRange r;
+
+ if ([_str length] == 0) {
+ return nil;
+ }
+
+ /* lookup languages */
+
+ ctx = [self context];
+ languages = [ctx hasSession]
+ ? [[ctx session] languages]
+ : [[ctx request] browserLanguages];
+
+ /* find resource manager */
+
+ if ((rm = [self resourceManager]) == nil)
+ rm = [[WOApplication application] resourceManager];
+ if (rm == nil)
+ [self debugWithFormat:@"WARNING: missing resource manager!"];
+
+ /* get parameters */
+
+ r = [_str rangeOfString:@"/"];
+ if (r.length > 0) {
+ lTable = [_str substringToIndex:r.location];
+ lKey = [_str substringFromIndex:(r.location + r.length)];
+ }
+ else {
+ lTable = nil;
+ lKey = _str;
+ }
+ lVal = lKey;
+
+ if([lKey hasPrefix:@"$"]) {
+ lKey = [self valueForKeyPath:[lKey substringFromIndex:1]];
+ }
+ if([lTable hasPrefix:@"$"]) {
+ lTable = [self valueForKeyPath:[lTable substringFromIndex:1]];
+ }
+#if 0
+ if([lVal hasPrefix:@"$"]) {
+ lVal = [self valueForKeyPath:[lVal substringFromIndex:1]];
+ }
+#endif
+ /* lookup string */
+
+ label = [rm stringForKey:lKey inTableNamed:lTable withDefaultValue:lVal
+ languages:languages];
+ return label;
+}
+
+/* locale */
+
+- (NSDictionary *)locale {
+ /* we need no fallback here, as locale is guaranteed to be set by sogod */
+ NSLog(@"%s locale:%@",
+ __PRETTY_FUNCTION__,
+ [[self context] valueForKey:@"locale"]);
+ return [[self context] valueForKey:@"locale"];
+}
+
@end /* UIxComponent */
# $Id$
-SUBMINOR_VERSION:=1
+SUBMINOR_VERSION:=2
# 1.1.0 requires NGObjWeb 4.2.202
+2004-07-20 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.2
+
+ * GNUmakefile: added new .lproj resources.
+
+ * {English,French}.lproj/default.plist: localizable strings for the
+ Scheduler bundle.
+
+ * UIxCalSelectTab.m, UIxCalWeekOverview.wox,
+ UIxCalMonthOverview.[m|wox]: changes for using new localization
+ features.
+
2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* UIxAppointmentEditor.m: Use -backendTimeZone from UIxComponent.
SchedulerUI_PRINCIPAL_CLASS = SchedulerUIProduct
+SchedulerUI_LANGUAGES = English French
+
SchedulerUI_OBJC_FILES = \
SchedulerUIProduct.m \
UIxAppointmentFormatter.m \
images/icon_apt_list.gif \
images/icon_apt_list_inactive.gif \
+SchedulerUI_LOCALIZED_RESOURCE_FILES += \
+ default.strings
+
ADDITIONAL_INCLUDE_DIRS += \
-I.. -I../.. -I../../..
@implementation UIxCalMonthOverview
+static NSMutableArray *dayLabelKeys = nil;
+
++ (void)initialize {
+ if (dayLabelKeys == nil) {
+ dayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
+ [dayLabelKeys addObject:@"Sunday"];
+ [dayLabelKeys addObject:@"Monday"];
+ [dayLabelKeys addObject:@"Tuesday"];
+ [dayLabelKeys addObject:@"Wednesday"];
+ [dayLabelKeys addObject:@"Thursday"];
+ [dayLabelKeys addObject:@"Friday"];
+ [dayLabelKeys addObject:@"Saturday"];
+ }
+}
+
- (void)dealloc {
[self->currentWeekStart release];
[super dealloc];
}
- (NSString *)localizedNameOfDayOfWeek {
- // TODO: move this to some locale method
- static char *dayNames[] = {
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
- };
- return [[[NSString alloc] initWithCString:
- dayNames[self->dayOfWeek]] autorelease];
+ NSString *key;
+
+ key = [dayLabelKeys objectAtIndex:self->dayOfWeek];
+ return [self labelForKey:key];
}
- (NSDictionary *)currentWeekQueryParameters {
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label"
>
<table id="skywintable" class="wintable" cellspacing="0" cellpadding="5" width="100%">
prevQueryParameters="prevMonthQueryParameters"
currentQueryParameters="todayQueryParameters"
nextQueryParameters="nextMonthQueryParameters"
- const:label="this month"
+ label:label="this month"
/>
</td>
</tr>
</tr>
<tr bgcolor="#F5F5E9">
<td align="left" width="10"><var:entity const:name="nbsp"/></td>
- <td align="right"><img border="0" alt="" src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif"/></td>
+ <td align="right"><img border="0" alt="" src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif" /></td>
</tr>
<tr>
<td colspan="2" bgcolor="#F5F5E9">
}
- (NSString *)weekLabel {
- return [NSString stringWithFormat:@"Week %d", [self->currentDate weekOfYear]];
+ NSString *wlbl;
+
+ wlbl = [self labelForKey:@"Week"];
+ return [NSString stringWithFormat:@"%@ %d",
+ wlbl,
+ [self->currentDate weekOfYear]];
}
- (NSString *)monthLabel {
- return [self->currentDate descriptionWithCalendarFormat:@"%B"];
+ return [self->currentDate descriptionWithCalendarFormat:@"%B"
+ locale:[self locale]];
}
- (NSString *)yearLabel {
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label"
xmlns:uix="OGo:uix"
className="UIxPageFrame"
title="name">
prevQueryParameters="prevWeekQueryParameters"
currentQueryParameters="todayQueryParameters"
nextQueryParameters="nextWeekQueryParameters"
- const:label="this week"
+ label:label="this week"
/>
</td>
</tr>
-# $Id: Version,v 1.1 2003/11/24 01:24:40 helge Exp $
+# $Id$
-SUBMINOR_VERSION:=1
+SUBMINOR_VERSION:=2
# 1.1.0 requires NGObjWeb 4.2.202