Apple Newton Utilities User's Guide Page 739

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 738
CHAPTER 20
Localizing Newton Applications
Using the Localization Features of the Newton 20-7
For example:
activeLocale:=GetLocale();
Once you’ve obtained a bundle, you can examine it to see how your application
should interpret user input or display output.
See “Contents of a Locale Bundle” (page 17-1) in Newton Programmers
Reference for information on the slots of a locale bundle.
Changing Locale Settings 20
You cannot change settings in the active locale bundle. To change locale settings,
you need to create a new locale bundle that has the values you want and make it the
active locale. This is called a custom locale bundle. See the next section for
information on how to create on of those.
Creating a Custom Locale Bundle 20
Every custom locale bundle has a _proto slot that references another locale
bundle. To create your application’s custom locale bundle, use the
FindLocale
function to get the frame to be referenced by your custom locale bundle’s
_proto slot.
IMPORTANT
Your custom bundle’s _proto slot must ultimately reference a
system-supplied locale bundle. That does not have to be direct—
you can reference a custom bundle that you know references a
system-supplied bundle, for example.
Your custom locale bundle is simply a frame that includes this _proto reference
and any additional slots you wish to dene to override the values of those inherited
from the prototype. Your custom locale bundle should look like the code in the
following example:
usLocaleBundle := FindLocale('usa);
myLocaleBundle :=
{
_proto: usLocaleBundle,
// add slots to be modified
title: "myLocaleBundle:PIEDTS",
localeSym: '|myLocaleBundle:PIEDTS|,
};
The FindLocale function accepts as its argument a symbol specifying the locale
bundle it is to return. This function returns the locale bundle that has this value in
its
localeSym slot.
Page view 738
1 2 ... 734 735 736 737 738 739 740 741 742 743 744 ... 941 942

Comments to this Manuals

No comments