forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResources.cpp
More file actions
31 lines (26 loc) · 736 Bytes
/
Resources.cpp
File metadata and controls
31 lines (26 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#include "pch.h"
#include "Resources.h"
namespace AppInstaller::CLI::Resource
{
LocString::LocString(StringId id)
{
m_value = Loader::Instance().ResolveString(id);
}
const Loader& Loader::Instance()
{
static Loader instance;
return instance;
}
Loader::Loader()
{
m_wingetLoader = winrt::Windows::ApplicationModel::Resources::ResourceLoader::GetForViewIndependentUse(L"winget");
}
std::string Loader::ResolveString(
std::wstring_view resKey) const
{
return Utility::ConvertToUTF8(m_wingetLoader.GetString(resKey));
}
}