util/i18n

Utility functions for translations.
Source:

Methods

(inner) translate(__, key, fallback) → {string}

Translate a key with the __ helper of Hexo, or use the fallback text when the theme has no translation for the key, in which case Hexo returns the key itself.
Source:
Parameters:
Name Type Description
__ function The __ helper function of Hexo.
key string The translation key.
fallback string The text to use without a translation.
Returns:
Type:
string
The translated text.
Example
translate(helper.__, 'widget.more', 'More');