@@ -88,7 +88,16 @@ The script tag that loads the Usercentrics Browser UI and API.
8888``` tsx
8989interface UsercentricsScriptProps
9090 extends React .DetailedHTMLProps <React .ScriptHTMLAttributes <HTMLScriptElement >, HTMLScriptElement > {
91+ /**
92+ * The language code the Usercentrics UI should load by default. If not set, it will be automatically selected.
93+ *
94+ * @example "fi"
95+ * @see https://usercentrics.atlassian.net/wiki/spaces/SKB/pages/1183678648
96+ */
97+ language? : string
98+
9199 settingsId: string
100+
92101 /**
93102 * The specific version of Usercentrics UI to load instead of "latest", as a string value
94103 *
@@ -97,11 +106,13 @@ interface UsercentricsScriptProps
97106 * @see https://releases.usercentrics.com/en?category=browser+ui&role=cmpv1%3Bcmpv2%3B
98107 */
99108 uiVersion? : string
109+
100110 /**
101111 * Whether to run Usercentrics in "production" or "preview" mode
102112 * @default " production"
103113 */
104114 version? : ' production' | ' preview'
115+
105116 src? : never
106117}
107118
@@ -113,6 +124,9 @@ interface UsercentricsScriptProps
113124
114125/* Fixed UI version instead of latest */
115126;() => <UsercentricsScript settingsId = " 1234" uiVersion = " 3.24.0" />
127+
128+ /* Fixed language code */
129+ ;() => <UsercentricsScript settingsId = " 1234" language = " fi" />
116130```
117131
118132#### ` UsercentricsProvider `
@@ -454,3 +468,14 @@ A method to get array of all services from local storage
454468const services = getServicesFromLocalStorage ()
455469const myService = services .find ((service ) => service .id === ' my-service-id' )
456470```
471+
472+ #### ` updateLanguage `
473+
474+ Programmatic way to set language for the CMP.
475+ The param ` countryCode ` is a two character country code, e.g. "en" = set language to English
476+
477+ See also https://docs.usercentrics.com/#/cmp-v2-ui-api?id=updatelanguage
478+
479+ ``` tsx
480+ updateLanguage (' fi' )
481+ ```
0 commit comments