Skip to content

Commit

Permalink
chore: added l10n
Browse files Browse the repository at this point in the history
  • Loading branch information
egordidenko committed Nov 28, 2024
1 parent 46652cf commit c4ae71d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions blocks/ExternalSource/ExternalSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export class ExternalSource extends UploaderBlock {
this.subConfigValue('multiple', (multiple) => {
this.$.showSelectionStatus = multiple;
});

this.subConfigValue('localeName', (val) => {

Check warning on line 106 in blocks/ExternalSource/ExternalSource.js

View workflow job for this annotation

GitHub Actions / build

'val' is defined but never used
this.setupL10n();
});
}

/**
Expand Down Expand Up @@ -153,6 +157,7 @@ export class ExternalSource extends UploaderBlock {
/** @private */
handleIframeLoad() {
this.applyStyles();
this.setupL10n();
}

/** @private */
Expand All @@ -163,6 +168,14 @@ export class ExternalSource extends UploaderBlock {
});
}

/** @private */
setupL10n() {
this._messageBridge?.send({
type: 'set-locale-definition',
localeDefinition: this.cfg.localeName,
});
}

/** @private */
remoteUrl() {
const { pubkey, remoteTabSessionKey, socialBaseUrl, multiple } = this.cfg;
Expand Down
4 changes: 4 additions & 0 deletions blocks/ExternalSource/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
* theme: Record<string, string>;
* }
* | {
* type: 'set-locale-definition';
* localeDefinition: string;
* }
* | {
* type: 'set-embed-css';
* css: Partial<ThemeDefinition>;
* }} OutputMessage
Expand Down

0 comments on commit c4ae71d

Please sign in to comment.