Beispiel #1
0
std::wstring WMessageResourceBundle::getValue(const WMessage& message)
{
  std::wstring result;

  for (unsigned i = 0; i < messageResources_.size(); ++i) {
    if (messageResources_[i]->getValue(message, result))
      return result;
  }

  return L"??" + widen(message.key()) + L"??";
}
Beispiel #2
0
bool WMessageResources::getValue(const WMessage& message,
				 std::wstring& result)
{
  if (!loaded_)
    refresh();

  KeyValueMap::const_iterator j;

  j = local_.find(message.key());
  if (j != local_.end()) {
    result = j->second;
    substitute(result, message.args());
    return true;
  }

  j = defaults_.find(message.key());
  if (j != defaults_.end()) {
    result = j->second;
    substitute(result, message.args());
    return true;
  }

  return false;
}