first internationalisation for German and Dutch

pull/57/head
Dennis Koot 6 years ago
parent 219209e688
commit d3538430fc

@ -151,6 +151,69 @@ namespace ezt {
//////////////////////// ////////////////////////
#ifdef EZTIME_LANG_DE
String monthStr(const uint8_t month) {
switch(month) {
case 1: return F("Januar");
case 2: return F("Februar");
case 3: return F("März");
case 4: return F("April");
case 5: return F("Mai");
case 6: return F("Juni");
case 7: return F("Juli");
case 8: return F("August");
case 9: return F("September");
case 10: return F("Oktober");
case 11: return F("November");
case 12: return F("Dezember");
}
return "";
}
String dayStr(const uint8_t day) {
switch(day) {
case 1: return F("Sonntag");
case 2: return F("Montag");
case 3: return F("Dienstag");
case 4: return F("Mittwoch");
case 5: return F("Donnerstag");
case 6: return F("Freitag");
case 7: return F("Samstag");
}
return "";
}
#elif EZTIME_LANG_NL
String monthStr(const uint8_t month) {
switch(month) {
case 1: return F("Januari");
case 2: return F("Februari");
case 3: return F("Maart");
case 4: return F("April");
case 5: return F("Mei");
case 6: return F("Juni");
case 7: return F("Juli");
case 8: return F("Augustus");
case 9: return F("September");
case 10: return F("October");
case 11: return F("November");
case 12: return F("December");
}
return "";
}
String dayStr(const uint8_t day) {
switch(day) {
case 1: return F("Zondag");
case 2: return F("Maandag");
case 3: return F("Dinsdag");
case 4: return F("Woensdag");
case 5: return F("Donderdag");
case 6: return F("Vrijdag");
case 7: return F("Zaterdag");
}
return "";
}
#else
String monthStr(const uint8_t month) { String monthStr(const uint8_t month) {
switch(month) { switch(month) {
case 1: return F("January"); case 1: return F("January");
@ -181,6 +244,8 @@ namespace ezt {
} }
return ""; return "";
} }
#endif
// Original time lib compatibility // Original time lib compatibility
String dayShortStr(const uint8_t day) { return dayStr(day).substring(0,3); } String dayShortStr(const uint8_t day) { return dayStr(day).substring(0,3); }
@ -1241,9 +1306,15 @@ String Timezone::dateTime(time_t t, const ezLocalOrUTC_t local_or_utc, const Str
case 'd': // Day of the month, 2 digits with leading zeros case 'd': // Day of the month, 2 digits with leading zeros
out += ezt::zeropad(tm.Day, 2); out += ezt::zeropad(tm.Day, 2);
break; break;
#ifdef EZTIME_TWO_LETTER_DAY
case 'D': // A textual representation of a day, two letters
out += ezt::dayStr(tm.Wday).substring(0,2);
break;
#else
case 'D': // A textual representation of a day, three letters case 'D': // A textual representation of a day, three letters
out += ezt::dayStr(tm.Wday).substring(0,3); out += ezt::dayStr(tm.Wday).substring(0,3);
break; break;
#endif
case 'j': // Day of the month without leading zeros case 'j': // Day of the month without leading zeros
out += String(tm.Day); out += String(tm.Day);
break; break;

Loading…
Cancel
Save