View Single Post
headline
SourceMod Moderator
Join Date: Mar 2015
Old 11-21-2017 , 22:46   Re: Function to check if translation exists
Reply With Quote #8

For those who stumble upon this in the future, and those who don't know about it yet: Latest SourceMod 1.9 builds now support two new functions in order to detect if a translation phrase exists. Here's a snippet from the include.

PHP Code:
/**
 * Determines if the specified phrase exists within the plugin's
 * translation cache.
 *
 * @param phrase    Phrase to look for.
 * @return            True if phrase exists.
 */
native bool TranslationPhraseExists(const char[] phrase);

/**
 * Determines if a there is a translation for the speicifed language.
 *
 * @param phrase    Phrase to check.
 * @param language    Language number.
 * @return            True if translation exists.
 */
native bool IsTranslatedForLanguage(const char[] phraseint language); 

Last edited by headline; 11-21-2017 at 22:48.
headline is offline