p2-inc / phasetwo-admin-portal

https://phasetwo.io
Other
19 stars 14 forks source link

Add locale selector #46

Closed xgp closed 1 year ago

xgp commented 1 year ago

if isInternationalizationEnabled add a select on the general profile page populated from fields.attributes.locale

pnzrr commented 1 year ago

Where are you pulling fields.attributes.locale from? If its the profile object, the attributes seems to be empty. I tried to enable a couple things like localization for the realm and "Update user locale", which I thought might have trigged the need to chose upon logging in, but didn't seem to have an effect.

image image

Got the item wired up in a draft once I know how to pull that data in.

image image
xgp commented 1 year ago

once I know how to pull that data in.

You and me both. I need to add it to the config Environment. I'll put it here once I've added that.

xgp commented 1 year ago

@pnzrr I added supportedLocales to config.env. Default:

  supportedLocales: { "en": "English" },
pnzrr commented 1 year ago

Updated the data object. Where in the account is this meant to be saved? In the attributes area?

xgp commented 1 year ago

It's a separate hash: image

I need to update the openapi spec and regenerate the rtk. Will do in a bit.

xgp commented 1 year ago

@pnzrr updated. you should be able to update the locale by adding this:

  "attributes": {
    "locale": [
      "fr"
    ]
  }
pnzrr commented 1 year ago

Shoudl be good to go now