T.R | Title | User | Personal Name | Date | Lines |
---|
1621.1 | | STAR::ORGOVAN | Vince Orgovan | Mon Oct 30 1989 18:00 | 21 |
| The "Language..." pulldown in the session manager causes a
property to be stored on the root window that contains the user's
preferred language setting. The DECwindows V2 toolkit examines
this property when XtInitialize is called, and redefines the
logical names for:
SYS$LIBRARY
SYS$MESSAGE
SYS$HELP
SYS$EXAMPLES
DECW$SYSTEM_DEFAULTS
so that these point to a language specific subdirectory before
pointing the normal locations. If the French DW language variant
kit has been installed, the French subdirectory would contain
French translations, while the normal location contains the default
U.S. English files.
If a language variant kit for the user's selected language is not
installed, the logical names are still redefined but since the
subdirectory won't be found the user will get U.S. English files.
|
1621.2 | How to retrieve the Language resource? | HANDVC::ASTONCHAN | | Sun Nov 19 1989 22:08 | 15 |
|
I looked into the SM's source coding and found that when a new
Language is set, the XrmPutStringResource() is called :
> XrmPutStringResource(&xrmdb.xrmlist[i][j].name, value);
How can I reference this resource in my application? I need this
information 'cause I need to have it as a switch to determine which
Language specific coding should be executed. Is xrmdb... visible to
my application?
Regards,
Aston
|
1621.3 | details on the language resource | STAR::BROUILLETTE | | Mon Nov 20 1989 11:53 | 41 |
|
When your application starts up, XtInitialize executes code which gets
your application UID file in the correct language. I believe XNLS will
provide utility routines which applications can call to get the current
culture that the application is using. However, they are not part of
V2 DECwindows.
If you can't wait for XNLS, then you can still get the current
language. The language which the user selects is stored in the
resource property on the root window. This property is merged into
your application xrm database when the application starts. To get the
application database, use the intrinsics routine XtDatabase. Then use
XrmGetResource to get the language resource. The name of the resource
is xnlLanguage. The value which will be returned is one of the
following for VMS 5.3 - DECwindows V2.
nl_NL /* Dutch */
en_GB /* GB English */
en_US /* US English */
fr_FR /* French */
fr_CA /* French-Canadian */
de_DE /* German */
it_IT /* Italian */
no_NO /* Norwegian*/
es_ES /* Spanish */
sv_SE /* Swedish */
fr_CH /* Swiss-french*/
de_CH /* Swiss-German*/
it_CH /* Swiss-Italian */
So, if the user selected French, the value of the xnlLanguage resource
would be fr_FR. If you want your application to respond dynamically to
language switches by the user, you will need to set a property notify
on the RESOURCE_MANAGER property. The property is updated by the
session manager when the user changes workstation customization. Then
your code could determine if the xnlLanguage value had been changed.
Additional languages have been added for the VMS release which provides
the XNLS utilities. So, be aware that the list will grow in the
future.
|
1621.4 | | SARAH::WOLFE | That's a 511 ma'm. Failing to yield to good taste | Mon Nov 20 1989 16:52 | 5 |
| Just out of curiosity, how is this all done on an Ultrix system (i.e.
redefinig the logicals to automagically make it all work). Environment
variables?
pete
|
1621.5 | Property vs resource | HANDVC::ASTONCHAN | | Tue Nov 21 1989 20:40 | 10 |
|
Re .3
I finally got it! Thanks.
Can anyone tell me what is the difference between a property and a
resource?
Thanks.
|
1621.6 | a user's view | SICVAX::GRAHAM | if ya want home cookin, stay home | Fri Nov 24 1989 21:41 | 46 |
| RE .5
>Can anyone tell me what is the difference between a property and a
>resource?
Since the real gurus have not had time to repond to this question,
I will snipe at it ;-)
A PROPERTY is an arbitrary collection of data that can be associated
with a window..whereas a RESOURCE is a named piece of data in a widget
that can be set by a program and in some cases by a user.
To communicate with a window manager (eg Mwm), a client can place
PROPERTIES on a top-level window. A window manager will use the
information to arbitrate:
- how to handle a client's keyboard focus.
- how to decorate the window.
- what messages the client is interested in.
PROPERTIES can either be standard (ICCCM) or special....can
I say dxwm (DECwindows-specific) ? ;^)
Examples of PROPERTIES are WM_NAME (string that identifies window..
e.g. in title bar..usually set by first argument in XtInitialize,
or WM_PROTOCOLS ( the communications protocols that a WM understands).
Normally includes a set of ICCCM protocols.
Under X, when application starts up, the toolkit initialization
routines are able to construct a RESOURCE database from 5 sources.
- An application-specific class RESOURCE file:
/usr/lib/X11/app-defaults/class (my U*IX bias is showing)
- Application-specific user resource file"
XAPPLRESDIR/class
- User resource file:
RESOURCE_MANAGER OR .Xdefaults
- Per host user resource file:
XEnvironment OR .Xdefaults-host
- Application command line:
-xrm option on command line.
As an example, a Motif label widget's RESOURCEs may include:
- A character string for its label.
- A font with which to draw the label.
- Foreground and background colors.
Kris..
|
1621.7 | DGPB | OXNARD::HAYNES | Charles Haynes | Mon Nov 27 1989 00:09 | 4 |
| Hey Kris, you sound like a "guru" to me. What does it take to become an
official "guru"? Do we need a DECwindows guru promotion board?
-- Charles (senior DECwindows guru :->)
|
1621.8 | Nah... | MELTIN::dick | Gvriel::Schoeller | Mon Nov 27 1989 09:06 | 3 |
| If we make it official, it will get all messed up.
Dick (associate DECwindows guru 8^{)
|