Translating Block Themes

This article is part of the WordPress guide. Read the introduction.

Table of Contents

If you think back to blocks and block themes, you should remember that static blocks have hard-coded strings in their HTML content. This is a problem because HTML files can’t be internationalized. It would be unacceptable for theme authors to ship themes that require plugins to translate their templates.

This is one of the reasons theme authors do not usually use static blocks in the templates or template parts they create. Instead, they make everything into a pattern, which is a PHP file. This PHP file can be internationalized using i18n functions like __(). You can go take a look at the official WordPress block themes, like the Twenty Twenty-Five theme. You will see patterns used everywhere.

Table of Contents