setLocale
setLocale(locale): void
setLocale
enables the user to set an override for the language that is specified in the browser settings.
Arguments
locale: string | null
The locale should be specified as a language code and an optional country code. This is the same format that is used by navigator.language
Examples
Script Tag
window.addEventListener("vaReportComponents.loaded", function() {
vaReportComponents.setLocale("fr");
});
window.addEventListener("vaReportComponents.loaded", function() {
vaReportComponents.setLocale("fr-CA");
});
ESM
import { setLocale } from "@sassoftware/va-report-components";
setLocale("fr");
import { setLocale } from "@sassoftware/va-report-components";
setLocale("fr-CA");