From a2b82e9a5f98ef61099b3ad912d4b2ef89a98d77 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Fri, 24 Aug 2012 11:49:30 -0400 Subject: [PATCH] extras/ShortDate: i18n --- extras/types/ShortDate.ec | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extras/types/ShortDate.ec b/extras/types/ShortDate.ec index eab983f..fc72a2f 100644 --- a/extras/types/ShortDate.ec +++ b/extras/types/ShortDate.ec @@ -4,20 +4,21 @@ public import static "ecere" public import "ecere" #endif +static Array shortMonths +{ [ + $"Jan", $"Feb", $"Mar", $"Apr", $"May", $"Jun", $"Jul", $"Aug", $"Sep", $"Oct", $"Nov", $"Dec" +] }; + public struct ShortDate : Date { char * OnGetString(char * stringOutput, void * fieldData, bool * needClass) { - static const char months[12][4] = - { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; if(day || month || year) { if(month >= january && month <= december) - sprintf(stringOutput, "%s %d, %d", months[month], day, year); + sprintf(stringOutput, "%s %d, %d", shortMonths[month], day, year); else - strcpy(stringOutput, "Invalid date"); + strcpy(stringOutput, $"Invalid date"); } else stringOutput[0] = 0; -- 1.8.3.1