Internationalization
WPBits Block Studio supports internationalization (i18n) for your blocks. This allows your blocks to be translated into different languages.
Translation Files
Section titled “Translation Files”WPBits Block Studio automatically generates a .pot file for your blocks. This file contains all the translatable strings and can be imported into translation tools like Loco Translate or WPML.
Using Loco Translate
Section titled “Using Loco Translate”Loco Translate is a popular translation plugin for WordPress.
Step 1: Install Loco Translate
Section titled “Step 1: Install Loco Translate”- Go to Plugins → Add New
- Search for “Loco Translate”
- Install and activate the plugin
Step 2: Configure Translation
Section titled “Step 2: Configure Translation”- Go to Loco Translate in WordPress admin
- Find your block plugin
- Click Edit on your language
- Translate the strings
- Click Save
Step 3: Export Translations
Section titled “Step 3: Export Translations”If you need to share translations or use them elsewhere:
- In Loco Translate, go to Sync tab
- Click Sync Now to update the
.potfile - Download the
.poand.mofiles for your language
Manual Translation Setup
Section titled “Manual Translation Setup”POT File Location
Section titled “POT File Location”The .pot file is generated in your block folder:
wp-content/uploads/wpbits-block-studio/blocks/└── your-block/ └── languages/ └── your-block.potCreating Translation Files
Section titled “Creating Translation Files”- Copy the
.potfile - Rename to your locale (e.g.,
tr_TR.pofor Turkish) - Fill in the translations
- Compile to
.moformat
Best Practices
Section titled “Best Practices”- Use unique text domains — Avoid conflicts with other plugins
- Wrap strings properly — Use
__()and_e()functions in PHP - Test translations — Always test your blocks in the target language
- Keep strings short — Short strings are easier to translate accurately