Use country code as default language
This commit is contained in:
parent
9947021736
commit
7fa22da619
|
@ -13,8 +13,11 @@ const userLocale = {
|
|||
methods: {
|
||||
getLocale(clientId) {
|
||||
return db.findOne(`
|
||||
SELECT lang FROM account.user
|
||||
WHERE id = ?`, [clientId]).then(rows => {
|
||||
SELECT IF(u.lang IS NOT NULL, u.lang, LOWER(ct.code)) lang
|
||||
FROM client c
|
||||
JOIN country ct ON ct.id = c.countryFk
|
||||
JOIN account.user u ON u.id = c.id
|
||||
WHERE c.id = ?`, [clientId]).then(rows => {
|
||||
if (rows)
|
||||
return rows.lang;
|
||||
else return fallbackLocale;
|
||||
|
|
Loading…
Reference in New Issue