Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "preferred language" option to the user table #7936

Open
jniles opened this issue Dec 16, 2024 · 0 comments
Open

Add a "preferred language" option to the user table #7936

jniles opened this issue Dec 16, 2024 · 0 comments

Comments

@jniles
Copy link
Collaborator

jniles commented Dec 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant