diff --git a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js
index a8f824c24d..3fca178d08 100644
--- a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js
+++ b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js
@@ -32,6 +32,18 @@ describe('Compound Container Tests', () => {
});
});
+ it('LuigiClient API - getCurrentLocale', () => {
+ cy.on('window:alert', stub);
+
+ cy.get(containerSelector)
+ .shadow()
+ .contains('getCurrentLocale')
+ .click()
+ .then(() => {
+ expect(stub.getCall(0)).to.be.calledWith('LuigiClient.getCurrentLocale()=en');
+ });
+ });
+
it('LuigiClient API - getDirtyStatus', () => {
cy.on('window:alert', stub);
diff --git a/container/test-app/compound/compoundClientAPI.html b/container/test-app/compound/compoundClientAPI.html
index 85eefa9a37..df52da4a2a 100644
--- a/container/test-app/compound/compoundClientAPI.html
+++ b/container/test-app/compound/compoundClientAPI.html
@@ -37,6 +37,7 @@
defer-init="false"
webcomponent="true"
theme="sap_fiori_3"
+ locale="en"
>
diff --git a/container/test-app/compound/helloWorldWC.js b/container/test-app/compound/helloWorldWC.js
index 0598bdd4df..a5ab9b3183 100644
--- a/container/test-app/compound/helloWorldWC.js
+++ b/container/test-app/compound/helloWorldWC.js
@@ -13,6 +13,9 @@ export default class extends HTMLElement {
const templateBtn = document.createElement('template');
templateBtn.innerHTML = '';
+ const current_locale = document.createElement('template');
+ current_locale.innerHTML = '';
+
const templateBtn2 = document.createElement('template');
templateBtn2.innerHTML = '';
@@ -112,10 +115,23 @@ export default class extends HTMLElement {
this._shadowRoot.appendChild(linkManagerOpenAsRequestsBtn.content.cloneNode(true));
this._shadowRoot.appendChild(linkManagerUpdateTopPathExistsBackBtn.content.cloneNode(true));
this._shadowRoot.appendChild(setViewGroupDataBtn.content.cloneNode(true));
+ this._shadowRoot.appendChild(current_locale.content.cloneNode(true));
+
this._shadowRoot.appendChild(empty.content.cloneNode(true));
+ this.$currentLocaleButton = this._shadowRoot.querySelector('#current_locale');
+ this.$currentLocaleButton.addEventListener('click', () => {
+ if (this.LuigiClient) {
+ this.LuigiClient.uxManager().showAlert({
+ text: 'LuigiClient.getCurrentLocale()=' + this.LuigiClient.getCurrentLocale(),
+ type: 'info'
+ });
+ }
+ });
+
this.$paragraph = this._shadowRoot.querySelector('p');
+
this.$button = this._shadowRoot.querySelector('#aButton');
this.$button.addEventListener('click', () => {
if (this.LuigiClient) {
diff --git a/container/typings/LuigiCompoundContainer.svelte.d.ts b/container/typings/LuigiCompoundContainer.svelte.d.ts
index ee033a1dec..8f8217364f 100644
--- a/container/typings/LuigiCompoundContainer.svelte.d.ts
+++ b/container/typings/LuigiCompoundContainer.svelte.d.ts
@@ -26,7 +26,7 @@ export default class LuigiCompoundContainer extends HTMLElement {
/**
*
- * The locale to be passed to the compound micro frontend
+ * The locale to be passed to the compound micro frontend.
* @since NEXT_RELEASE_CONTAINER
*/
locale: string;
diff --git a/docs/luigi-compound-container-api.md b/docs/luigi-compound-container-api.md
index a4afa50e52..613404f32d 100644
--- a/docs/luigi-compound-container-api.md
+++ b/docs/luigi-compound-container-api.md
@@ -51,7 +51,7 @@ Type: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Glob
### locale
-The locale to be passed to the compound micro frontend
+The locale to be passed to the compound micro frontend.
Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)