[futurebasic] Re: [FB] Priority language

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2006 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Thu, 17 Aug 2006 18:36:41 +1200
Yoshiyuki Hasegawa wrote:

>>> Hi All,
>>> How is whether the priority language of OSX is English or  
>>> Japanese examined?
>>
>> General reading:
>> <http://developer.apple.com/documentation/MacOSX/Conceptual/ 
>> BPInternational/index.html>
>>
>> What is your aim? What problem are you trying to solve?
>>
>> Robert P.
>
> I'm sorry "Examine" is not suitable.
>
> The code in which a top priority language is obtained because of  
> the program is
> hoped for.
>
> It is software of the bilingual that I thinks.
> The resource is decided and which resource is read in two built-in  
> priority language for English
> and for Japanese is decided.
> It is "vers" resource that becomes an object.
>
> I will stop making it to the bilingual to About and Apple menu, etc.
> The software of Apple such as TextEdit is Maltilingual.

If you want to detect the primary locale or language at run time, I  
can suggest only what the code might look like. Perhaps someone can  
supply the missing details.

'-----------------------
local fn IsPrimaryLocaleJapanese
  dim as Boolean  isJapanese

  DearMacSystemPleaseGetLocaleInfo( ... ) // no such API
  long if ( userLocaleInfoSaysJapaneseIsPreferredToEnglish ) // no  
such variable
   isJapanese = _zTrue
  xelse
   isJapanese = _false
  end if

end fn = isJapanese



long if ( fn IsPrimaryLocaleJapanese )
  fn DoJapaneseTasks
xelse
  fn DoEnglishTasks
end if
'-----------------------


Alternatively, consider localizing your program at compile time by  
providing two versions:

'-----------------------
_compilingJapaneseVersionOfMyProgram = 0 // 0 or 1

#if _compilingJapaneseVersionOfMyProgram
fn DoJapaneseTasks
#else
fn DoEnglishTasks
#endif
'-----------------------

Robert P.