Skip to content

Commit d392a8d

Browse files
authored
[#804] Use default_locale when lang not set in the request (#805)
1 parent 9bc8a2e commit d392a8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pywb/apps/frontendapp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def __init__(self, config_file=None, custom_config=None):
108108
self.templates_dir = config.get('templates_dir', 'templates')
109109
self.static_dir = config.get('static_dir', 'static')
110110
self.static_prefix = config.get('static_prefix', 'static')
111+
self.default_locale = config.get('default_locale', '')
111112

112113
metadata_templ = os.path.join(self.warcserver.root_dir, '{coll}', 'metadata.yaml')
113114
self.metadata_cache = MetadataCache(metadata_templ)
@@ -662,7 +663,7 @@ def handle_request(self, environ, start_response):
662663
# store original script_name (original prefix) before modifications are made
663664
environ['ORIG_SCRIPT_NAME'] = environ.get('SCRIPT_NAME')
664665

665-
lang = args.pop('lang', '')
666+
lang = args.pop('lang', self.default_locale)
666667
if lang:
667668
pop_path_info(environ)
668669
environ['pywb_lang'] = lang

0 commit comments

Comments
 (0)