We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need to update each plugin to explain the learning goal/objective, provide details on the code, and link to any relevant references as needed.
The goal of this example is to showcase how to use translations in a block.
STATIC RENDERING
3df23d
Both the edit.js and save.js files import the __ function @wordpress/i18n to apply translations to the texts used in the code.
edit.js
save.js
__
@wordpress/i18n
index.php
wp_set_script_translations()
languages/
.mo
__()
Note Check the Start Guide for local development with the examples
The text was updated successfully, but these errors were encountered:
juanmaguitar
ryanwelcher
No branches or pull requests
What?
We need to update each plugin to explain the learning goal/objective, provide details on the code, and link to any relevant references as needed.
ReadMe Example to follow
Basic Block Translation 3df23d
The goal of this example is to showcase how to use translations in a block.
STATIC RENDERING
3df23d
Understanding the Example Code
Both the
edit.js
andsave.js
files import the__
function@wordpress/i18n
to apply translations to the texts used in the code.__
function receives the text and a namespace as parametersindex.php
we tell WordPress our JavaScript contains translations, using thewp_set_script_translations()
function.languages/
folder there are all the translations files (the source files and the.mo
ones actually used to apply the translations)Related resources
__()
wp_set_script_translations()
The text was updated successfully, but these errors were encountered: