[Cuis-dev] DrGeo on Mac OS X
lewis at mail.msen.com
lewis at mail.msen.com
Sat Apr 19 09:52:31 PDT 2025
Can someone with Mac OS X please try this and provide an answer for
Hilaire? Just file in the attached, then evaluate "GetLangFromEnv
getLanguage" after starting your Cuis as Hilaire describes.
Thanks!
Dave
On 2025-04-19 08:19, Hilaire Fernandes via Cuis-dev wrote:
> Thanks Dave,
>
> Does this workaround also work when not started from a terminal?
>
> I mean, will the environment variable revealed when double clicking on
> the DrGeo.app to start it?
>
> Le 17/04/2025 à 22:39, lewis at mail.msen.com a écrit :
>
>> I am attaching GetLangFromEnv.st (and a zipped copy of it in case it
>> does not go through email). This is just a couple of methods copied
>> out of OSProcess to provide a minimal mechanism for reading the LANG
>> environment variable. Tested only on Linux but it will work the same
>> way on OSX.
>>
>> Hopefully this will provide a workaround for DrGeo on Mac if we are
>> not able to get the LocalPlugin fixed.
>>
>> HTH,
>>
>> Dave
>
> --
> http://mamot.fr/@drgeo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250419/bb1c53f9/attachment.htm>
-------------- next part --------------
'From Cuis7.3 [latest update: #7036] on 17 April 2025 at 2:28:26 pm'!
!classDefinition: #GetLangFromEnv category: #'dtl-demo'!
Object subclass: #GetLangFromEnv
instanceVariableNames: 'superclass methodDict format'
classVariableNames: 'ObsoleteSubclasses'
poolDictionaries: ''
category: 'dtl-demo'!
!GetLangFromEnv commentStamp: 'dtl 4/17/2025 14:22:32' prior: 0!
Use a couple of methods borrowed from the OSProcess package to obtain the value of the LANG environment variable.
"GetLangFromEnv getLanguage"
!
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
!classDefinition: 'GetLangFromEnv class' category: #'dtl-demo'!
GetLangFromEnv class
instanceVariableNames: ''!
!GetLangFromEnv class methodsFor: 'find language' stamp: 'dtl 4/17/2025 14:20:47'!
getLanguage
"Answer the setting of the LANG environment variable, or empty string if not found"
"GetLangFromEnv getLanguage"
^ [ self getEnvironmentDictionary at: #LANG ]
on: Error
do: [ "" ]
! !
!GetLangFromEnv class methodsFor: 'private' stamp: 'dtl 4/17/2025 14:15:46'!
getEnvironmentDictionary
"Answer an environment dictionary using an OSProcessAccessor."
| index str key val env |
env := Dictionary new.
index := 1.
[(str := self primEnvironmentAt: index) notNil] whileTrue: [
key := (str copyUpTo: $=) asSymbol.
val := (str copyFrom: ((str indexOf: $=) + 1) to: (str size)).
env at: key put: val.
index := index + 1].
^ env! !
!GetLangFromEnv class methodsFor: 'private' stamp: 'dtl 4/17/2025 14:16:02'!
primEnvironmentAt: index
"Answer the environment string at index position in the OS process environment list.
This returns a 'KEY=value' string, which the caller is expected to parse into #KEY
and 'value' to be stored an environment dictionary."
<primitive: 'primitiveEnvironmentAt' module: 'UnixOSProcessPlugin'>
^ nil! !
More information about the Cuis-dev
mailing list