| name | i18n-update |
| description | Update translation files and check for untranslated strings |
| disable-model-invocation | true |
| allowed-tools | Bash(npm run *), Bash(npx wp-env *), Bash(git *), Read, Glob |
Manage internationalization for the DesignSetGo plugin.
Quick Commands
Find untranslated strings:
grep -r "'[A-Z][a-z]" src/ --include="*.js" | grep -v "__(" | grep -v "//"
grep -r "__(" src/ includes/ | grep -v "'designsetgo'"
Generate POT file:
npx wp i18n make-pot . languages/designsetgo.pot
Update PO files:
msgmerge --update languages/designsetgo-nl_NL.po languages/designsetgo.pot
msgmerge --update languages/designsetgo-es_ES.po languages/designsetgo.pot
Compile MO files:
msgfmt languages/designsetgo-nl_NL.po -o languages/designsetgo-nl_NL.mo
msgfmt languages/designsetgo-es_ES.po -o languages/designsetgo-es_ES.mo
Full Workflow
1. Find Untranslated Strings
Scan codebase for hardcoded strings or missing text domains.
2. Fix Translation Issues
Common issues:
console.log('Block loaded');
console.log(__('Block loaded', 'designsetgo'));
const msg = 'You have ' + count + ' items';
const msg = sprintf(__('You have %d items', 'designsetgo'), count);
__('Save', 'designsetgo')
__('Save', 'designsetgo')
3. Generate POT File
Create or update the template file with all translatable strings.
4. Update Language Files
Merge new strings into existing translations. Translators will fill in missing translations.
5. Compile MO Files
Convert human-readable PO files to machine-readable MO files.
6. Test Translations
In WordPress:
- Go to Settings → General
- Change Site Language
- Check all block labels, descriptions, and controls
- Verify strings appear in target language
Test RTL Languages:
For Arabic, Hebrew:
- Switch language in WordPress
- Check layout doesn't break
- Verify
style-rtl.css is loaded
Best Practices
Always:
- Use
__('String', 'designsetgo') for translatable strings
- Add translator comments for ambiguous strings
- Use
sprintf() for variable interpolation
- Test with RTL languages
Never:
- Translate URLs, code, or HTML tags
- Concatenate translated strings
- Use variables in translation strings (use placeholders)
Common Translation Functions
__('Text', 'designsetgo')
_e('Text', 'designsetgo')
_n('%d item', '%d items', count, 'designsetgo')
_x('Post', 'noun', 'designsetgo')
_x('Post', 'verb', 'designsetgo')
Before Committing
Always check for untranslated strings:
npm run lint:i18n
Reference