Conditional localization
-
I have a multilingual WordPress theme with a hard-coded string which I don’t want to show if a translation is not available.
By default,
_e('this string is irrelevant in German', 'my-theme')
falls back to the original English string when the translation is not found or is empty.Ideally I’d like to query the current translation database and see if the translation exists. If not, then I can skip the code block that outputs the translation.
I’ve looked in
wp-includes/l10n.php
to see if there is atranslation_exists()
function but don’t see anything relevant. Is this possible in WordPress?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Conditional localization’ is closed to new replies.