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 stringflavor_te('key')— Echoes the translated string
Translations are stored in the database and can be edited from Flavor Options.
Customizing Translations
- Go to Appearance → Flavor Options → Translations
- Find the label you want to change
- Enter your custom text
- Click Publish
Common Translation Keys
| Key | Default | Usage |
|---|---|---|
add_to_cart | Add to Cart | Product button |
buy_now | Buy Now | Quick purchase |
view_cart | View Cart | Cart link |
checkout | Checkout | Checkout button |
search_placeholder | Search products... | Search bar |
no_products_found | No products found | Empty results |
out_of_stock | Out of Stock | Stock status |
sale | Sale | Sale badge |
free_shipping | Free Shipping | Shipping label |
order_complete | Thank 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.