| getLocale |
() |
yoix.util |
| getLocale |
(String language[, String country[, String variant]]) |
|
| |
With no arguments,
the current default locale is returned.
When one, two or three
String
arguments are supplied as indicated, the appropriate
Locale
object is returned.
In this latter form, this builtin provides a shorthand way of constructing
Locale
objects.
| |
| Example: |
In the following example, first the date is printed out using the current
default locale, then the locale default is set to Italy and the
date is printed out again.
Next, the locale for Portugal is generated and provided as an argument
to the date command with the result printed out.
Finally, the locale is set back to the original default and printed out
for a fourth time.
import yoix.stdio.*;
import yoix.util.*;
loc = getLocale();
puts(date());
setLocale(Locale.ITALY);
puts(date());
puts(date(getLocale("pt", "PT")));
setLocale(loc);
puts(date());
The results on standard output are:
Thu Apr 5 18:16:53 EDT 2007
gio apr 5 18:16:53 EDT 2007
Qui Abr 5 18:16:53 EDT 2007
Thu Apr 5 18:16:53 EDT 2007
| | |
| Return: |
Locale
| | |
| See Also: |
getLocales,
Locale,
setLocale
|
|
Yoix is a registered trademark of AT&T Inc.
|