[Cuis-dev] DrGeo on Mac OS X

lewis at mail.msen.com lewis at mail.msen.com
Thu Apr 17 13:39:44 PDT 2025


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

On 2025-04-10 08:08, Hilaire Fernandes via Cuis-dev wrote:

> Hi folks,
> 
> I need some assistance from Mac OS users, with a system in a non 
> English language, Spanish, English, Chinese, it can be any language 
> from this list[1] .
> 
> The DrGeo bundle I built for Mac OS X does not start with GUI messages 
> translated in the host language setting, it always starts in English.
> 
> Please install the bundle below, then from a Workspace, execute "Locale 
> current" and print here the result.
> 
> From the investigation of last year[2], there is maybe a problem with 
> the Locale plugin in Mac OSX unable to detect the right locale
> 
> https://www.dropbox.com/scl/fi/hxbjfeguntr4qj32digww/DrGeo-mac-25.06a-beta.zip?rlkey=1ij9y6f4yvy0px5zl00l8rv6z&st=quxbaswy&dl=0 
> [1]
> 
> Thanks
> 
> [1] https://github.com/Dynamic-Book/drgeo/tree/main/i18n/po
> 
> [2] https://github.com/Dynamic-Book/drgeo/issues/39
> 
> --
> http://mamot.fr/@drgeo


Links:
------
[1] 
https://www.dropbox.com/scl/fi/hxbjfeguntr4qj32digww/DrGeo-mac-25.06a-beta.zip?rlkey=1ij9y6f4yvy0px5zl00l8rv6z&st=quxbaswy&dl=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250417/d5430c9e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetLangFromEnv.zip
Type: application/zip
Size: 985 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250417/d5430c9e/attachment.zip>
-------------- 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