Important: The information in this document is obsolete and should not be used for new development.
Using the International Resources
The Script Manager and the other managers that make up the Macintosh script management system use the information in the international resources to format dates and times, find word boundaries, transliterate text, and determine character type, among other tasks. Your application indirectly accesses that information when it makes script-aware calls that rely on the current script system. In addition, you can directly access an international resource in order to
Keep these points in mind when using a script system's international resources:
- pass a resource handle or pointer as a parameter to a text-handling routine. Many text-handling calls may take an explicit handle to an international resource; you first load the resource with calls to the Script Manager, and then pass its handle as a parameter to the call.
- extract formatting information from a table within a resource. If you are formatting currencies, dates, or numbers (without calling the Text Utilities routines that do formatting for you) , or if you are converting script-independent tokens to the text of a particular script system, you can load the appropriate resource with calls to the Script Manager, and then examine its contents for the information you need.
- provide a modified version of a resource, to customize text handling. You can load the appropriate resource with calls to the Script Manager, change it, and then save the changed resource in such a manner that it is used in place of the original resource.
For more information, see the discussions of direct access to international resources and replacing default international resources in the chapter "Script Manager" in this book.
- You can load the international resources
'itl0'
,'itl1'
,'itl2'
, or'itl4'
directly withGetResource
or other related Resource Manager routines, but it is not recommended. If you use a Script Manager call such asGetIntlResource
instead, the Script Manager determines which particular instance of an international resource to load, given the current font script, the script system's default preferences, and the current state of the international resources selection flag.- Remember that most of the script-specific international resources have ID numbers within a range unique to their script system. If you are providing resources that add to or replace a script system's default resources, make sure that your resources have resource IDs in the proper range.
- If the international resources selection flag is set to
TRUE
, the international resources used by several script-aware Text Utilities routines are those of the system script. However, you can force those routines to use the international resources of the font script instead by clearing the international resources selection flag toFALSE
. You can set and clear the international resources selection flag by using the Script ManagerSetScriptManagerVariable
function. See the discussion on determining script codes in the chapter "Script Manager" in this book.- You can use multiple formats for different languages or regions with the same script system by adding multiple versions of international resources, each having a different resource ID within the script's range. You store those international resources in your application's or document's resource fork, where they can override those in the System file.
- Note
- Several international resources have type definitions that give you direct access to their components from high-level languages. These definitions are documented in this appendix. For other international resources high-level types are not defined, and graphic figures show the
structures instead.