Const String Time::getMonthName(const bool tlv)


#1

Hi Jules,
it’s me again with my “local” problems. :wink:

There is a handful of really useful functions in Time class. But the problem is that functions like this

const String Time::getMonthName  (  const bool  threeLetterVersion   )  const 

are not suitable for non-english “speaking” apps. Would that be possible to make these functions returning month, day, or other name virtual so that I could make my own Time class overriding these methods to return localised Month/Day names?
(It might be better if the class read the names from some local computer settings and returning the string according to it, but I think it’s not worth the effort. And also I am not sure if all Mac/Nix/Win support it, so… )

And one smaller thing, the parameter (const bool threeLetterVersion) could be defined (const bool threeLetterVersion=false), for the lazy people like me ? :wink:

Thanks.
Y.


#2

The month name stuff does actually call the TRANS macro on the strings it returns - so if you want, you could set up a translation file and use that to translate the names to any language you want.

Not crazy about giving too many parameters a default value, as it can cause bugs later if the parameter list changes. It’s not too hard to type “false”, is it!


#3

[quote=“jules”]The month name stuff does actually call the TRANS macro on the strings it returns - so if you want, you could set up a translation file and use that to translate the names to any language you want.
[/quote]

I see, thanks.
Y.


#4