Skip to content

Commit

Permalink
use LC_ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredevely committed Oct 14, 2023
1 parent 7326528 commit ddb9dc5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
26 changes: 13 additions & 13 deletions oc/od/composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,19 +529,19 @@ def createExecuteEnvironment(authinfo, userinfo, app=None ):
lang = locale + '.UTF-8'

# update env with user local values read from the http request
env.update ( { 'LANGUAGE' : language,
'LANG' : lang,
'LC_ALL' : lang,
'LC_PAPER' : lang,
'LC_ADDRESS' : lang,
'LC_MONETARY': lang,
'LC_TIME': lang,
'LC_MEASUREMENT': lang,
'LC_IDENTIFICATION': lang,
'LC_TELEPHONE': lang,
'LC_NUMERIC': lang }
)
# LC_ALL is the environment variable that overrides all the other localisation settings
# (except $LANGUAGE under some circumstances).
# no need to set
# 'LC_PAPER' : lang,
# 'LC_ADDRESS' : lang,
# 'LC_MONETARY': lang,
# 'LC_TIME': lang,
# 'LC_MEASUREMENT': lang,
# 'LC_IDENTIFICATION': lang,
# 'LC_TELEPHONE': lang,
# 'LC_NUMERIC': lang }
env.update ( { 'LANGUAGE': language, 'LANG': lang, 'LC_ALL': lang } )

# # add dbussession is set in config file
# if oc.od.settings.desktop['usedbussession'] :
# env.update( {'OD_DBUS_SESSION_BUS': str(oc.od.settings.desktop['usedbussession']) })
Expand Down
16 changes: 6 additions & 10 deletions oc/od/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3894,21 +3894,18 @@ def get_env_for_appinstance(self, myDesktop, app, authinfo, userinfo={}, userarg
# read locale language from USER AGENT
language = userinfo.get('locale', 'en_US')
lang = language + '.UTF-8'
# LC_ALL is the environment variable that overrides all the other localisation settings
# (except $LANGUAGE under some circumstances).
env['LANGUAGE']=language
env['LANG']=lang
env['LC_ALL']=lang
env['LC_PAPER']=lang
env['LC_ADDRESS']=lang
env['LC_MONETARY']=lang
env['LC_TIME']=lang
env['LC_MEASUREMENT']=lang
env['LC_TELEPHONE']=lang
env['LC_NUMERIC']=lang
env['LC_IDENTIFICATION']=lang

# add PARENT_ID PARENT_HOSTNAME for ocrun nodejs script
env['PARENT_ID']=myDesktop.id
env['PARENT_HOSTNAME']=myDesktop.nodehostname
env['APP'] = app.get('path')

# update env APP to run command in /composer/apply-docker-entrypoint.sh
env['APP'] = app.get('path')
# Add specific vars
if isinstance( kwargs, dict ):
timezone = kwargs.get('timezone')
Expand All @@ -3921,7 +3918,6 @@ def get_env_for_appinstance(self, myDesktop, app, authinfo, userinfo={}, userarg
if hasattr(authinfo, 'data') and isinstance( authinfo.data, dict ):
env.update(authinfo.data.get('identity', {}))


# convert env dictionnary to env list format for kubernetes
envlist = ODOrchestratorKubernetes.envdict_to_kuberneteslist( env )
ODOrchestratorKubernetes.appendkubernetesfieldref( envlist )
Expand Down

0 comments on commit ddb9dc5

Please sign in to comment.