- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- NLS Implementation Question
Operating System - HP-UX
1753912
Members
8513
Online
108810
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2001 05:48 AM
тАО08-08-2001 05:48 AM
NLS Implementation Question
Currently my company has software that is using NLS, the code is written in C. We have an installation that is running in English, German, and Hungarian. At times, text will be displayed in the wrong language.
What I am wondering is whether we are using the NLS facility correctly. The message catalogs are stored in different directories, the catalog files themselves have the same name. The software runs on radio frequency equipment, so the radios will "log in" and start a session on the HP. Note that the user is not "really" logging into the HP.
The software will then use putenv to set LANG and LC_ALL to the user's language. When a call is made to get a translated string, the code will check whether the catalog has already been opened. This is done using the catopen command. The full path is not passed in, just the file name. If the file is opened, the name is stored in a C array with the descriptor that is returned. The next time that a string is needed, this array is checked to see if the catalog is already opened.
Does anyone see a problem with the way this is set up? The site reports that messages will be displayed in any of the 3 languages within the same session.
Any help would be appreciated!
Thanks,
Cathy
What I am wondering is whether we are using the NLS facility correctly. The message catalogs are stored in different directories, the catalog files themselves have the same name. The software runs on radio frequency equipment, so the radios will "log in" and start a session on the HP. Note that the user is not "really" logging into the HP.
The software will then use putenv to set LANG and LC_ALL to the user's language. When a call is made to get a translated string, the code will check whether the catalog has already been opened. This is done using the catopen command. The full path is not passed in, just the file name. If the file is opened, the name is stored in a C array with the descriptor that is returned. The next time that a string is needed, this array is checked to see if the catalog is already opened.
Does anyone see a problem with the way this is set up? The site reports that messages will be displayed in any of the 3 languages within the same session.
Any help would be appreciated!
Thanks,
Cathy
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2001 06:10 AM
тАО08-08-2001 06:10 AM
Re: NLS Implementation Question
Hi Cathleen:
Yes, you appear to be using the LANG env variable correctly if in your catopen() call oflag is zero. The fact that you say it sometimes works and sometimes doesn't points me down another trail. The interesting point is that if for some reason the NLSPATH is invalid, the system reverts to default values.
I have two theories: 1) Your putenv() string points to an auto storage specified string rather than a static or global storage specified string. If the contents of the stack are disturbed, your env vars are garbage. 2) You may be doing an exec() within your code which invalidates the catopen().
Hope this helps, Clay
Yes, you appear to be using the LANG env variable correctly if in your catopen() call oflag is zero. The fact that you say it sometimes works and sometimes doesn't points me down another trail. The interesting point is that if for some reason the NLSPATH is invalid, the system reverts to default values.
I have two theories: 1) Your putenv() string points to an auto storage specified string rather than a static or global storage specified string. If the contents of the stack are disturbed, your env vars are garbage. 2) You may be doing an exec() within your code which invalidates the catopen().
Hope this helps, Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2001 07:12 AM
тАО08-08-2001 07:12 AM
Re: NLS Implementation Question
Thanks Clay for your quick reply!
The code has a login function that sets the NLS environment variables. It uses a pointer of type char * and mallocs space for it, then uses it for the putenv.
Do you see this as a problem?
Thanks,
Cathy
The code has a login function that sets the NLS environment variables. It uses a pointer of type char * and mallocs space for it, then uses it for the putenv.
Do you see this as a problem?
Thanks,
Cathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2001 07:42 AM
тАО08-08-2001 07:42 AM
Re: NLS Implementation Question
Hi Cathleen,
I think we're on the right track. If I understand your response, you've almost done it correctly. Change the char *ptr to static char *ptr within your login function. That way the value remains defined after exiting the login function.
I think we're on the right track. If I understand your response, you've almost done it correctly. Change the char *ptr to static char *ptr within your login function. That way the value remains defined after exiting the login function.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP