Translation key existence
5 years 9 months ago #3562
by elusiven
Translation key existence was created by elusiven
Hi is there a way to check before getting translation via script localization that it exists so that I can perform my own kind of fallback?
Please Log in or Create an account to join the conversation.
5 years 9 months ago #3565
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Translation key existence
Hi,
You can use:
If you also want to check if the term exist but is not translated to the current language:
Hope that helps,
Frank
You can use:
TermData term = LocalizationManager.GetTermData( termName );
if (term==null)
{
// There is no term named termName
}
If you also want to check if the term exist but is not translated to the current language:
string translation;
bool termExists = LocalizationManager.TryGetTranslation(termName, out translation );
if (!termExists || translation==null)
{
// There is no term named termName or there is no translation to the current language
}
Hope that helps,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
Time to create page: 0.125 seconds