Link to home
Start Free TrialLog in
Avatar of Santino_k
Santino_k

asked on

Find Lotus Notes Language

Hi,
I want to find using Lotus C API whether the installed Lotus Notes is French or German or English or Potugese.
(To add to above - Lotus Notes is available for download in English , French German, Brazilian etc languages. I want to detect which one is installed.)

Please help me with this

Thanks
Avatar of Bozzie4
Bozzie4
Flag of Belgium image

Why ?  If you want to get the user language, those are fairly basic functions, but to get the client version, I only know the basic Lotusscript functions (or formula's) that may or may not return the version of the client (I'm not sure).  But if you want to know what user the client is working in, that's a different story, and a lot easier handled.

Is this R5 or R6 ?

cheers,

Tom
Avatar of qwaletee
qwaletee

The problem you run into is that the client and API are separate.  I don't know of a constant or function that really tells you what the lcient is installed as, and certainly not the API.  Here's what might come closest:

1) Use OSGetLMBCS to get the default char set.  I'm pretty sure each language has a different default character set

2) Find a know, basic error message -- one that is not likely to change from version to version, except for language.  Hard code the error number.  Then use OSLoadSring to get the text of the error, can compare it to a hard-coded list of language-specific error strings.
Avatar of Santino_k

ASKER

Hi guys,
Thanks for your reply. Look I know the way to detect if the version is R5 or R6. The problem is with detecting what Language setup was used (with language, the Design Elements Labels/names changes in NSF)
I'll further explain what I want to do -
Considering for  R5,  I want to Insert my own Design Element programmatically after "Description: " element in Computed subform. Programmatically I can traverse all traverse elements. The problem comes when I go thro elements of Lotus Notes Brazillian/Portugese version installed (I am not talking about locale manually set by user). The "Description: " element is now in Portugese. Hence my program fails.
Thats why I want to find what language setup of Notes is installed so that my program becomes generic enough to detect what label to check for the design elements.

qwaletee, I'll try workaround you suggested but it would be great to get actual API or probably querying value of some obvious Element of NSF file that tells what is the Language of Setup used
You know what?  I really don't understand what you are talking about.  I think there must be some fuzzy communication.  But I'm almost certain you are confusd about the way Notes works.

Database languages are completely independent of client install languages.  And better yet, client insatll languages are completely independent of user language preferences (except for how dfeaults are set up) -- and the user language preference is more closely associated with database langauge properties than with client language.

The client install language determines the following:
* langauge of Domino system menus (File, Edit, View, ...)
* language used in system dialog boxes (Database open, user preferences)
* the text of error messages
* the default setting for the user language preference, which is found in FIle->User->Preferences...International tab
* the local file database templates will also be in the same language (contacts, journal, system log)

The user mail file langauge is not determined by the client at all.  It is determined by the template used on the server.

Domino design principles also allow a database to be designed with multiple languages within the database database.  When enabled for this, a database can have a list of alternate design element versions with langauge tags associated.  When a user opens such a database, the user language preference determines which alternate version of a design element is used.  If there is no match, the database default language is given precedence.

The mail file does NOT take advanatage of this functionality.  Instead, Lotus produces multiple versions of the mail template, each in a single language.  This is mostly because the mail file would otheriwse be impossibly large.

You CAN obtain the user language preference.  You CAN'T query the client install language directly, except via the error message trick I described in the earlier comment.  You CAN'T query a multi-lingual databases default language directly -- though I'm sure it would be easy enough to find where the data behind this property is stored.  For a single-language database that happens to be based on a template that is AVAILABLE in multiple languages (all single-language translations of each other), there is ABSOLUTELY NO WAY to tell what language the current database is translated to, other than a variantion of the error message trick -- if you know that some form name or the text of some patricular spot is X in English and Y in Portuguese, then you can simply test what the current value is.  of course, if the database ever changes, your test may fail.

Now, I don't know how your database is designed, and I don't know why you are trying to do this.  But it sounds like you are NOT trying to modify the form at run time (i.e., every time the user opens it), which seems to mean that you are expecting a certain file to have a certain design that you can then modify one time.  That sounds like a single alnguage database.  Further, it sounds like it is the user's mail file or some other standard database, so I'm guessing you have some new system you are trying to install on the user workstation, and wish to modify "the rest of Notes" to work with your system.

Well, sorry, but it looks like you may be doing this is a messy way, and probably not the best design to begin with.  But putting that aside, either you support multiple languages or you don't.  if you do, you have to acocunt for all of them, and be graceful when you don't recognize something (like a custom version of the file already on the user workstation or a newer or older version of Notes than you've tested against). Otherwise, give it up.
Hi qwaletee,
I think I am not able to communicate the exact problem I am facing. But your post given me enough insight.
I'll just explain what I am doing -
Look if you go to following link you can choose a particular "Language" for Notes Setup.
http://www14.software.ibm.com/webapp/download/preconfig.jsp?id=2004-10-25+11%3A58%3A46.520144R&S_TACT=104CBW71&S_CMP=&s=
Now assuming that I select French as Language, Downlaod the trial setup and install it (Note- Its not connected to a Domino Server). When you try to enumerate all items using  - NIFFindDesignNote, NSFItemInfo etc
Then the name of item appears to be in French.

Well I have thought of a temporary simpler workaround to this. Just making things more generic sometimes is difficult :-)

If you have any thought on this then please let me know.
ASKER CERTIFIED SOLUTION
Avatar of qwaletee
qwaletee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks qwaletee. This is really very helpful for me. :-)
Have a great day!