# Function getLocaleSafely

- getLocaleSafely(viewModel?, verificationResponse?): "ar" | "bg" | "bn-IN" | "cs" | "da" | "de" | "el" | "en-GB" | "en-US" | "es-ES" | "es" | "fi" | "fr-CA" | "fr" | "ga" | "hi-IN" | "hr" | "hu" | "id" | "is" | "it" | "iw" | "ja" | "ko" | "lo" | "lt" | "ms" | "nl" | "nl-BE" | "no" | "pl" | "pt-BR" | "pt" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "sw" | "uk" | "ur" | "vi" | "th" | "tr" | "zh-HK" | "zh" | "zu"

- #### Parameters

  - `Optional` viewModel: ViewModel
  - `Optional` verificationResponse: VerificationResponse

  #### Returns "ar" | "bg" | "bn-IN" | "cs" | "da" | "de" | "el" | "en-GB" | "en-US" | "es-ES" | "es" | "fi" | "fr-CA" | "fr" | "ga" | "hi-IN" | "hr" | "hu" | "id" | "is" | "it" | "iw" | "ja" | "ko" | "lo" | "lt" | "ms" | "nl" | "nl-BE" | "no" | "pl" | "pt-BR" | "pt" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "sw" | "uk" | "ur" | "vi" | "th" | "tr" | "zh-HK" | "zh" | "zu"

  #### Description

  Retrieves the locale used to display the verification form. It will attempt to bring the best default by looking at these places:

  - Retrieve from previous user selection in ChangeLocaleComponent
  - Retrieve based on the country selected
  - Retrieve from Options
  - Retrieve from the URL
  - Retrieve from the VerificationResponse
  - Retrieve library DEFAULT_LOCALE If found a locale but is not supported by the library, it'll return DEFAULT_LOCALE instead.
  - Defined in jslib/src/lib/intl/intl.ts:386