File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171
7272# Language code for this installation. All choices can be found here:
7373# http://www.i18nguy.com/unicode/language-identifiers.html
74- LANGUAGE_CODE = ' en-us'
74+ LANGUAGE_CODE = os . environ . get ( 'LANGUAGE_CODE' , ' en-us')
7575
7676# If you set this to False, Django will make some optimizations so as not
7777# to load the internationalization machinery.
151151LOGIN_REDIRECT_URL = reverse_lazy ('wirecloud.root' )
152152
153153THEME_ACTIVE = os .environ .get ("DEFAULT_THEME" , "wirecloud.defaulttheme" )
154- DEFAULT_LANGUAGE = 'browser'
154+ DEFAULT_LANGUAGE = os .environ .get ("DEFAULT_LANGUAGE" , 'browser' )
155+ from django .conf .global_settings import LANGUAGES
156+
157+ # Configure available translations
158+ # Filter using available translations by default
159+ lang_filter = os .environ .get ("LANGUAGES" , "en es ja" ).split ()
160+ if len (lang_filter ) > 0 :
161+ LANGUAGES = dict (LANGUAGES )
162+ LANGUAGES = [(lang_code , LANGUAGES [lang_code ]) for lang_code in lang_filter if lang_code in LANGUAGES ]
155163
156164# WGT deployment dirs
157165CATALOGUE_MEDIA_ROOT = os .path .join (DATADIR , 'catalogue_resources' )
Original file line number Diff line number Diff line change 7171
7272# Language code for this installation. All choices can be found here:
7373# http://www.i18nguy.com/unicode/language-identifiers.html
74- LANGUAGE_CODE = ' en-us'
74+ LANGUAGE_CODE = os . environ . get ( 'LANGUAGE_CODE' , ' en-us')
7575
7676# If you set this to False, Django will make some optimizations so as not
7777# to load the internationalization machinery.
152152LOGIN_REDIRECT_URL = reverse_lazy ('wirecloud.root' )
153153
154154THEME_ACTIVE = os .environ .get ("DEFAULT_THEME" , "wirecloud.defaulttheme" )
155- DEFAULT_LANGUAGE = 'browser'
155+ DEFAULT_LANGUAGE = os .environ .get ("DEFAULT_LANGUAGE" , 'browser' )
156+ from django .conf .global_settings import LANGUAGES
157+
158+ # Configure available translations
159+ # Filter using available translations by default
160+ lang_filter = os .environ .get ("LANGUAGES" , "en es ja" ).split ()
161+ if len (lang_filter ) > 0 :
162+ LANGUAGES = dict (LANGUAGES )
163+ LANGUAGES = [(lang_code , LANGUAGES [lang_code ]) for lang_code in lang_filter if lang_code in LANGUAGES ]
156164
157165# WGT deployment dirs
158166CATALOGUE_MEDIA_ROOT = os .path .join (DATADIR , 'catalogue_resources' )
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ The following environment variables are also honored for configuring your WireCl
3434- ` -e ALLOWED_HOSTS=... ` (defaults to "* ", whitespace whitespace-separated list
3535 of allowed hosts. See [ django documentation] [ ALLOWED_HOSTS ] for more
3636 details)
37+ - ` -e DEFAULT_LANGUAGE=... ` (defaults to "browser", see
38+ [ documentation] [ DEFAULT_LANGUAGE ] for more details)
3739- ` -e DEFAULT_THEME=... ` (defaults to "wirecloud.defaulttheme")
3840- ` -e DB_HOST=... ` (defaults to nothing, provide a host value to connect this
3941 image with a DB server)
@@ -45,6 +47,8 @@ The following environment variables are also honored for configuring your WireCl
4547 trusted reverse proxies)
4648- ` -e ELASTICSEARCH2_URL=... ` (defaults to nothing, leave it empty to use Whoosh
4749 instead).
50+ - ` -e LANGUAGE_CODE=... ` (defaults to "en-gb", See [ django
51+ documentation] [ LANGUAGE_CODE ] for more details)
4852- ` -e MEMCACHED_LOCATION=... ` (defaults to nothing, leave it empty to disable
4953 memcached support)
5054- ` -e FIWARE_IDM_SERVER=... ` (defaults to nothing, leave it empty for
@@ -60,6 +64,8 @@ appropriately.
6064
6165
6266[ ALLOWED_HOSTS ] : https://docs.djangoproject.com/en/2.1/ref/settings/#allowed-hosts
67+ [ DEFAULT_LANGUAGE ] : https://wirecloud.readthedocs.io/en/stable/installation_guide/#default_language
68+ [ LANGUAGE_CODE ] : https://docs.djangoproject.com/en/2.1/ref/settings/#language-code
6369
6470
6571### Docker Secrets
Original file line number Diff line number Diff line change 7171
7272# Language code for this installation. All choices can be found here:
7373# http://www.i18nguy.com/unicode/language-identifiers.html
74- LANGUAGE_CODE = ' en-us'
74+ LANGUAGE_CODE = os . environ . get ( 'LANGUAGE_CODE' , ' en-us')
7575
7676# If you set this to False, Django will make some optimizations so as not
7777# to load the internationalization machinery.
152152LOGIN_REDIRECT_URL = reverse_lazy ('wirecloud.root' )
153153
154154THEME_ACTIVE = os .environ .get ("DEFAULT_THEME" , "wirecloud.defaulttheme" )
155- DEFAULT_LANGUAGE = 'browser'
155+ DEFAULT_LANGUAGE = os .environ .get ("DEFAULT_LANGUAGE" , 'browser' )
156+ from django .conf .global_settings import LANGUAGES
157+
158+ # Configure available translations
159+ # Filter using available translations by default
160+ lang_filter = os .environ .get ("LANGUAGES" , "en es ja" ).split ()
161+ if len (lang_filter ) > 0 :
162+ LANGUAGES = dict (LANGUAGES )
163+ LANGUAGES = [(lang_code , LANGUAGES [lang_code ]) for lang_code in lang_filter if lang_code in LANGUAGES ]
156164
157165# WGT deployment dirs
158166CATALOGUE_MEDIA_ROOT = os .path .join (DATADIR , 'catalogue_resources' )
You can’t perform that action at this time.
0 commit comments