blob: 56a40a396e07a83c954508476a0474760853c223 [file] [log] [blame]
<p>
The CDateTime makes full use of Java's Locale object throughout. Upon creation, The locale is set
to set the system's default, but can be changed at runtime via the <code>setLocale</code> method.
</p>
<p>
Although most translations are provided through the java.util.SimpleDateFormat object, there a few
cases where CDateTime must rely upon external property files in order to be translated correctly.
Because this is a widget and not a full application, it is quite possible that multiple instances
may created with different locales. For this reason, the <code>Messages</code> class does not hold a
static reference to a given properties file, but can map to multiple files as they are activated.
</p>
<p>
Presently a few translations <a href="http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/plain/widgets/cdatetime/org.eclipse.nebula.widgets.cdatetime/src/org/eclipse/nebula/widgets/cdatetime/">are available</a> <br />
If you can help by creating a translation (a very simple one!), simply file a
<a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Nebula&component=CDateTime">Feature Request</a>
for [I18N] and attach your translated version of the properties file.<br />
View the properties file:
<a href="http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/plain/widgets/cdatetime/org.eclipse.nebula.widgets.cdatetime/src/org/eclipse/nebula/widgets/cdatetime/messages_en_US.properties">English (US)</a>,
</p>
<h4>Textual</h4>
<p>
When the pattern is set with CDateTime's <code>setFormat</code> method, the locale is fully
utilized to specify the appropriate fields, their order and style (ie 12 or 24 hour format).
However, when the pattern is set explicitly with CDateTime's <code>setPattern</code> method, the
individual text fields will be translated appropriately, but their order and style will follow
the programmatical setting.<br />
There is one exception though - the 'null string' cannot be translated via java.util.SimpleDateFormat,
and the properties file is referenced in this particular case.
</p>
<h4>Graphical</h4>
<p>
The most noteable difference from a locale specified format using <code>setFormat</code> and
a custom one with <code>setPattern</code> is changing the style of the Time Selector (aka Clock).
By using a 12 or 24 hour pattern, the locale will be overridden when creating the clock dial.
A similar affect can be achieved with the style settings by forcing one clock style over
another with either CLOCK_12_HOUR or CLOCK_24_HOUR.<br />
The properties file is referenced for navigational items, such as "Next Month" and "Go to Today".
</p>