You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we make reports or custom translated transaction descriptions, we need to choose a language for render the report. This is particularly tricky when it is a complicated transaction, such as payroll transactions.
Currently, the way we solve this problem is passing the lang in req.query. But this is not an elegant solution, nor does it account for cases where we might not have a req.query to determine the language (such as a report or transaction rendered from cron job). If we rely on req.query, the language key needs to be passed to each subsequent function, which makes function calls a bit bloated.
I propose we add a "preferred language" field to the user table to allow functions to determine the best language from the user_id that is required when creating transactions or reports. If a lang key is not available, functions will be able to look it up from the user table, cleaning up the API for complex transaction calls significantly.
The text was updated successfully, but these errors were encountered:
When we make reports or custom translated transaction descriptions, we need to choose a language for render the report. This is particularly tricky when it is a complicated transaction, such as payroll transactions.
Currently, the way we solve this problem is passing the
lang
inreq.query
. But this is not an elegant solution, nor does it account for cases where we might not have areq.query
to determine the language (such as a report or transaction rendered from cron job). If we rely onreq.query
, the language key needs to be passed to each subsequent function, which makes function calls a bit bloated.I propose we add a "preferred language" field to the
user
table to allow functions to determine the best language from theuser_id
that is required when creating transactions or reports. If alang
key is not available, functions will be able to look it up from theuser
table, cleaning up the API for complex transaction calls significantly.The text was updated successfully, but these errors were encountered: