WordPress i18n Helper

VerifiedSafe

Handle WordPress internationalization by using proper translation functions and maintaining POT files for multi-language support.

Sby Skills Guide Bot
DevelopmentBeginner
306/2/2026
Claude CodeCursorWindsurf
#wordpress#i18n#internationalization#translation#php

Recommended for

Our review

This skill helps manage WordPress plugin internationalization using the 'retrologin' text domain and appropriate translation functions.

Strengths

  • Guides correct usage of WordPress translation functions (__(), _e(), etc.)
  • Reminds to always include the text domain parameter
  • Provides escaping functions for security
  • Automates POT file generation with a single command

Limitations

  • Specific to the 'retrologin' text domain only
  • Does not cover advanced WPML or Polylang configuration
  • Assumes make-pot is already configured via Composer
When to use it

Use whenever adding or modifying translatable strings in a WordPress plugin using the 'retrologin' text domain.

When not to use it

Do not use for non-WordPress projects, plugins with a different text domain, or when localization is already handled by another system.

Security analysis

Safe
Quality score85/100

The skill only provides guidance on using WordPress translation functions and a standard Composer command to generate a POT file. There are no destructive commands, data exfiltration, or unsafe practices.

No concerns found

Examples

Add a translatable string
Add a new translatable label 'Email Address' to the plugin using the correct text domain and escaping for an input placeholder.
Regenerate translations
Regenerate the POT file for the plugin to include the latest strings.
Fix broken translation
The text 'Login Page' is not being translated. Check and fix the code to use the correct text domain.

name: i18n-helper description: Handle WordPress internationalization. Use when adding translatable strings.

i18n Helper

Instructions

When adding translatable strings to the plugin:

  1. Use the correct text domain: 'retrologin'
  2. Choose the right function:
    • __() - Return translated string
    • _e() - Echo translated string
    • esc_html__() - Return escaped translated string
    • esc_html_e() - Echo escaped translated string
    • esc_attr__() - Return escaped for HTML attributes
  3. Generate POT file: composer run make-pot
  4. Keep strings in English (US)

Translation Functions

| Function | Output | Use When | | ---------------------------- | --------------- | ----------------------------- | | __($text, $domain) | Return | Strings in PHP variables | | _e($text, $domain) | Echo | Direct output | | esc_html__($text, $domain) | Return + escape | Displaying user content | | esc_html_e($text, $domain) | Echo + escape | Direct output of user content | | esc_attr__($text, $domain) | Return + escape | HTML attributes |

Example

// Basic usage
__('Login Page', 'retrologin');
_e('Welcome back!', 'retrologin');

// With escaping
esc_html__('Please log in to continue', 'retrologin');
esc_attr__('Username', 'retrologin');

// In attributes
<input placeholder="<?php esc_attr_e('Enter username', 'retrologin'); ?>">

Generate Translations

# Generate POT file for translations
composer run make-pot

# POT file location: inc/languages/retrologin.pot

Guidelines

  • Always include text domain second parameter
  • Use escaping functions for user-generated content
  • Keep strings concise for translation
  • Avoid embedding variables in translatable strings
Related skills