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