toLocalizedLoginTerms

fun TermPolicies.toLocalizedLoginTerms(userLanguage: String, defaultLanguage: String = "en"): List<LocalizedFlowDataLoginTerms>

This method extract the policies from the login terms parameter, regarding the user language. For each policy, if user language is not found, the default language is used and if not found, the first url and name are used (not predictable)

Example of Data:

"m.login.terms": {
      "policies": {
        "privacy_policy": {
          "version": "1.0",
          "en": {
            "url": "http:\/\/matrix.org\/_matrix\/consent?v=1.0",
            "name": "Terms and Conditions"
          }
        }
      }
    }

Parameters

userLanguage

the user language

defaultLanguage

the default language to use if the user language is not found for a policy in registrationFlowResponse