mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Web-based check-in interface (#1985)
This commit is contained in:
25
src/pretix/static/pretixbase/js/i18nstring.js
Normal file
25
src/pretix/static/pretixbase/js/i18nstring.js
Normal file
@@ -0,0 +1,25 @@
|
||||
function i18nstring_localize(o) {
|
||||
var locale = document.body.attributes['data-pretixlocale'].value
|
||||
var short_locale = locale.split('-')[0]
|
||||
if (o[locale])
|
||||
return o[locale]
|
||||
|
||||
if (o[short_locale])
|
||||
return o[short_locale]
|
||||
|
||||
for (k of Object.keys(o)) {
|
||||
if (k.split('-')[0] === short_locale && o[k]) {
|
||||
return o[k]
|
||||
}
|
||||
}
|
||||
|
||||
if (o['en'])
|
||||
return o['en']
|
||||
|
||||
for (k of Object.keys(o)) {
|
||||
if (o[k]) {
|
||||
return o[k]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user