Change language in portals

Certified Senior Developer

Can we give the user an option to select a language at the start while the user is using a portal so that the contents of the portal get converted to the chosen language? If yes, then how can this be achieved?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to pritam_chatterjee

    You could do that and just have a safe link to go between the two. This is you have localized portal title and pages.

    Otherwise, you could try something like this:

    a!localVariables(
      local!language,
      local!bundle: index(
        {
          en_US: { test_label: "English" },
          fr_CA: { test_label: "Français" }
        },
        local!language,
        null
      ),
      {
        a!richTextDisplayField(
          value: {
            a!richTextItem(
              text: {
                a!defaultValue(
                  local!bundle["test_label"],
                  "Choose a language"
                ),
                
              },
              link: a!dynamicLink(
                saveInto: {
                  a!save(
                    local!language,
                    if(local!language = "fr_CA", "en_US", "fr_CA")
                  )
                }
              )
            )
          }
        )
      }
    )

Children