Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sometimes we need to get additional keyFound variable to know if ResourceKey does not exist or exists but empty value #6267

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

thienvc
Copy link
Contributor

@thienvc thienvc commented Dec 12, 2024

Summary

Sometimes we need to get additional keyFound variable to know if ResourceKey does not exist or exists but empty value

bool keyFound;
string strLocalization = Localization.GetString(ResourceKey, LocalResourceFile,  PortalSettings, null, false, out keyFound);
if(string.IsNullOrEmpty(strLocalization)){
  if(!keyFound)
  {
      strLocalization = "Key not found, click here to create....";
  }
  else {
      strLocalization = "Key found but empty value";
  }
}
return strLocalization;

…urceKey does not exist or exists but empty value?
…urceKey does not exist or exists but empty value?
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant