Size matters (when it comes to day names, at least)

by Michael S. Kaplan, published on 2006/06/13 14:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/06/13/629804.aspx


It was many months ago that I asked Does size matter? And if so, how do you measure it?

Funny how preoccupied everyone seems to be with size, all around the world.

Anyway, in the NLS API, the GetLocaleInfo function's LCTYPEs include:

LOCALE_SDAYNAME1
Native long name for Monday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SDAYNAME2
Native long name for Tuesday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SDAYNAME3
Native long name for Wednesday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SDAYNAME4
Native long name for Thursday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SDAYNAME5
Native long name for Friday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SDAYNAME6
Native long name for Saturday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SDAYNAME7
Native long name for Sunday. The maximum number of characters allowed for this string is 80, including a terminating null character.

but in many situations such as less formal date format strings or calendars, an abbreviated name is needed, so we provide that as well:

LOCALE_SABBREVDAYNAME1
Native abbreviated name for Monday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SABBREVDAYNAME2
Native abbreviated name for Tuesday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SABBREVDAYNAME3
Native abbreviated name for Wednesday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SABBREVDAYNAME4
Native abbreviated name for Thursday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SABBREVDAYNAME5
Native abbreviated name for Friday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SABBREVDAYNAME6
Native abbreviated name for Saturday. The maximum number of characters allowed for this string is 80, including a terminating null character.
LOCALE_SABBREVDAYNAME7
Native abbreviated name for Sunday. The maximum number of characters allowed for this string is 80, including a terminating null character.

Unfortunately, many locales saw their representatives on the data side feeling that they never did abbreviate the day names, so rather than thinking about tiny UI like a calendar in Outlook that was going to squish their long names together, they made the abbreviated names identical to the full names.

And from the standpoint of a language and how it is used in a locale -- how dates are formatted and so on, this may be okay. But in this case, we are not talking about date formats. We need something for calendars.

So, to try to address that, and with the pressure of all of the Vista updates to clock and calendar, seven new fields have been added: 

LOCALE_SSHORTESTDAYNAME1
Short native name of the first day of the week. This name is often shorter than LOCALE_SABBREVDAYNAME1, and it is useful for calendar titles.
LOCALE_SSHORTESTDAYNAME2
Short native name of the second day of the week. This name is often shorter than LOCALE_SABBREVDAYNAME2, and it is useful for calendar titles.
LOCALE_SSHORTESTDAYNAME3
Short native name of the third day of the week. This name is often shorter than LOCALE_SABBREVDAYNAME3, and it is useful for calendar titles.
LOCALE_SSHORTESTDAYNAME4
Short native name of the fourth day of the week. This name is often shorter than LOCALE_SABBREVDAYNAME4, and it is useful for calendar titles.
LOCALE_SSHORTESTDAYNAME5
Short native name of the fifth day of the week. This name is often shorter than LOCALE_SABBREVDAYNAME5, and it is useful for calendar titles.
LOCALE_SSHORTESTDAYNAME6
Short native name of the sixth day of the week. This name is often shorter than LOCALE_SABBREVDAYNAME6, and it is useful for calendar titles.
LOCALE_SSHORTESTDAYNAME7
Short native name of the seventh day of the week. This name is often shorter than LOCALE_SABBREVDAYNAME7, and it is useful for calendar titles.

In fact, GetDateFormat does not even have the notion of formatting with these shortest day names (which are at most two UTF-16 code points, because otherwise they may be truncated!).

And the word has gone out that these names NEED to be short, for use in the calendar in Vista. And that any names that are not short at all will be shortened in order to fit into the user interface -- so it is obviously in everyone's best interests if they decide how they would like to shorten things.

So once again we sees that size matters -- this time since some people are clearly making their names too big! :-)

 

This post brought to you by (U+1820, a.k.a. MONGOLIAN LETTER A)


# Gabe on 13 Jun 2006 2:08 PM:

It seems pretty limiting to require no more than 2 UTF-16 codepoints. Since the restriction is for display rather than for storage, I would suggest limiting it to 2 graphemes instead.

# Michael Dunn_ on 13 Jun 2006 2:12 PM:

I can see this going the same way as MS Shell Dlg. In the next rev of Windows, you'll have LOCALE_SREALLYSHORTDAYNAME1, then LOCALE_STHISTIMEIMEANITSHORTDAYNAME1, and so on. ;)

# Michael S. Kaplan on 13 Jun 2006 2:35 PM:

Hi Gabe -- Well, graphemes can be tougher to calculate for applications -- so in the Locale Builder the limit is going to be two UTF-16 code units (in the CaRIB there are no limits, so the misbehavers will have their day in the sun).

# Michael S. Kaplan on 13 Jun 2006 2:35 PM:

Hi Mike -- Folks are towing a pretty hard line in our data to not let people break the rules. The original name was LOCALE_SONELETTERDAYNAME# and the internal name is still LOCALE_SSUPERSHORTDAYNAME#. :-)

# Maurits on 13 Jun 2006 4:30 PM:

These fields were prompted by locales that didn't want to abbreviate, and took the 80-character limit at its word??

That's really funny :)

I can imagine a whole slew of related fields:

LOCALE_SDAYNAME1_FOR_TINY_SQUARISH_BITS_OF_SCREEN_SPACE
LOCALE_SDAYNAME1_FOR_TINY_RECTANGULAR_BITS_OF_SCREEN_SPACE
LOCALE_SDAYNAME1_FOR_MEDIUM_SIZED_RECTANGULAR_BITS_OF_SCREEN_SPACE
LOCALE_SDAYNAME1_FOR_CASUAL_USE
LOCALE_SDAYNAME1_WITH_MAXIMUM_VERBOSITY

# josh on 16 Jun 2006 12:04 PM:

This documentation seems to imply that Monday is always the first day of the week...  Different revisions of the docs?

# Michael S. Kaplan on 16 Jun 2006 1:07 PM:

Hi Josh,

If only it were. This is an error in the latest docs, that has to be fixed. :-)

# Jerry Pisk on 19 Jun 2006 6:50 PM:

Just curious - why weren't the offending locales fixed for Vista? Seems like a much better solution than adding a whole new set of names.

# Michael S. Kaplan on 19 Jun 2006 6:54 PM:

Well, people had been using the "abbreviate if the locale does, otherwise don't" setting for years -- so its meaning could not be arbitrarily changed....

referenced by

2011/01/27 {recycled joke here} It could have been called LOCALE_SSINGLESERVINGDAYNAME*

2006/07/08 They could be a little shorter

2006/06/17 On the first day of Microsoft

go to newer or older post, or back to index or month or day