diff --git a/print/core/mixins/user-locale.js b/print/core/mixins/user-locale.js index f8001aefc..f30bc0b28 100644 --- a/print/core/mixins/user-locale.js +++ b/print/core/mixins/user-locale.js @@ -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;