Setting formatting based on locale

Hi, I have embedded a Metabase dashboard into my web application.

If I have a UK customer, I would like to show display the currency based on their locale (£) instead of the global Metabase instance currency ($). I know this can be set at the global, field, and question level, but as far as I can tell, this would be set for all my users seeing this dashboard.

Ideally, each user should see the currency based on their browser locale. Or, can this be passed in as some parameter somewhere?

Also, since our end users are viewing our dashboards through our app, they are not direct Metabase users so they cannot choose their language / formatting choices.

Any insights would be appreciated.

Hi @gchan
Since you are using Signed or Public embedding, then there's no user, so even if Metabase had a setting for users, then that wouldn't be possible here.
You would either have to leave out the currency, or include it via a separate column, which you can set via a parameter from your app. Or do some reverse-proxy rewrite based on some headers, which gets complicated.

Hi @flamber,

As always, thanks for the reply.

Right, I think a workable solution would be to pass a parameter from my app to a Metabase question variable. That would mean I'd re-write and use concatenation and to_char for any money-related column I wanted to display, in addition to a pretty long case statement for each currency I'm supporting.

Do you have more resources on how I would implement a reverse proxy with Metabase?

@gchan You would have to do some substitution (sub_filter) - have a look in the Nginx configuration.
And then look in https://github.com/metabase/metabase/issues/8490
It's going to be slightly messy to do reverse-proxying and several caveats, so it's best to do some testing, so you know what you're getting into.

@flamber Alright. I also upvoted the issue on Github. Providing a query parameter like ?locale=de-DE
would be extremely useful. Since it's an iframe, there isn't an obvious way to replace the '$' with another currency symbol.

Note: As a temporary solution, I duplicated a new dashboard for each currency I want to support. It's not as scalable but gives you sufficient control as you can write logic to display a particular dashboard based on your user (server side)