-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Donations block: fix non lolcalized strings
- Loading branch information
1 parent
da623ba
commit 84ad651
Showing
7 changed files
with
128 additions
and
49 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/fix-donation-block-translations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: other | ||
|
||
Donations Block: fix non localized strings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
projects/plugins/jetpack/extensions/blocks/donations/constants.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
projects/plugins/jetpack/extensions/blocks/donations/utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Return the default texts defined in `donations.php` and injected client side by assigning them | ||
* to the `Jetpack_DonationsBlock` attribute of the window object. | ||
* | ||
* @returns {object} Defaut texts for the block. | ||
*/ | ||
export function getDefaultTexts() { | ||
if ( 'undefined' === typeof window ) { | ||
return {}; | ||
} | ||
|
||
const texts = window.Jetpack_DonationsBlock?.defaultTexts; | ||
|
||
if ( 'object' !== typeof texts ) { | ||
return {}; | ||
} | ||
|
||
return texts; | ||
} |