Skip to content

Internationalization

WPBits Block Studio supports internationalization (i18n) for your blocks. This allows your blocks to be translated into different languages.

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.

Loco Translate is a popular translation plugin for WordPress.

  1. Go to PluginsAdd New
  2. Search for “Loco Translate”
  3. Install and activate the plugin
  1. Go to Loco Translate in WordPress admin
  2. Find your block plugin
  3. Click Edit on your language
  4. Translate the strings
  5. Click Save

If you need to share translations or use them elsewhere:

  1. In Loco Translate, go to Sync tab
  2. Click Sync Now to update the .pot file
  3. Download the .po and .mo files for your language

The .pot file is generated in your block folder:

wp-content/uploads/wpbits-block-studio/blocks/
└── your-block/
└── languages/
└── your-block.pot
  1. Copy the .pot file
  2. Rename to your locale (e.g., tr_TR.po for Turkish)
  3. Fill in the translations
  4. Compile to .mo format
  1. Use unique text domains — Avoid conflicts with other plugins
  2. Wrap strings properly — Use __() and _e() functions in PHP
  3. Test translations — Always test your blocks in the target language
  4. Keep strings short — Short strings are easier to translate accurately