Apple Newton Utilities User's Guide Page 741

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 740
CHAPTER 20
Localizing Newton Applications
Using the Localization Features of the Newton 20-9
The RemoveLocale function accepts as its argument a symbol specifying the
locale bundle it is to remove. The following code shows how to pass the locale
bundle’s symbol to this function:
RemoveLocale('|myLocaleBundle:PIEDTS|);
Changing the Active Locale 20
The SetLocale function searches for a specied locale bundle and makes that
bundle the active locale bundle. This is equivalent to the user setting the Country
value from the Country pop-up menu, and overrides the user’s action. You should,
therefore, save the previous setting and reset it when you nish using your locale.
This function accepts as its argument a symbol identifying the bundle to install.
The following code example shows how to use the
SetLocale function to install
the custom locale frame created in “Dening a Localization Frame” (page 20-4):
SetLocale('|myLocaleBundle:PIEDTS|);
Using a Localized Country Name 20
When the name of a country is stored in a soup, the program that stores it should
call
SetCountryClass on the name string. That function sets the string to a
class that represents the country so that if the soup entry is read on a Newton with a
different ROM, a program can use
GetCountryEntry to get the name of the
country in that ROM’s language. See “Obtaining Information About a City or
Country” (page 19-28) for information on using
GetCountryEntry.
Summary: Customizing Locale 20
The following code sample summarizes the information discussed in the
preceding sections:
// get a bundle to use as a proto
usLocaleBundle := FindLocale('usa);
// define your custom locale bundle
myLocaleBundle :=
{
_proto: usLocaleBundle,
// add slots to be modified here
title: "myLocaleBundle:PIEDTS",
localeSym: '|myLocaleBundle:PIEDTS|,
}
// add myLocaleBundle to the system
AddLocale(myLocaleBundle);
Page view 740
1 2 ... 736 737 738 739 740 741 742 743 744 745 746 ... 941 942

Comments to this Manuals

No comments