Skip to main content

Translation System

The Flavor Starter Theme includes a built-in translation system for customizing all UI labels without traditional WordPress translation files.

How It Works

Instead of using WordPress __() or esc_html_e(), the theme uses its own translation functions:

  • flavor_t('key') — Returns the translated string
  • flavor_te('key') — Echoes the translated string

Translations are stored in the database and can be edited from Flavor Options.

Customizing Translations

  1. Go to Appearance → Flavor Options → Translations
  2. Find the label you want to change
  3. Enter your custom text
  4. Click Publish

Common Translation Keys

KeyDefaultUsage
add_to_cartAdd to CartProduct button
buy_nowBuy NowQuick purchase
view_cartView CartCart link
checkoutCheckoutCheckout button
search_placeholderSearch products...Search bar
no_products_foundNo products foundEmpty results
out_of_stockOut of StockStock status
saleSaleSale badge
free_shippingFree ShippingShipping label
order_completeThank you for your order!Success message

For Developers

If you're building custom modules or child themes, use the translation functions instead of hardcoding text:

// Good — translatable
echo flavor_t('add_to_cart');

// Bad — hardcoded
echo 'Add to Cart';

See the Developer Documentation for more details on extending the translation system.