Skip to content

Commit

Permalink
Remove NanaGet::GetLocalizedString.
Browse files Browse the repository at this point in the history
  • Loading branch information
MouriNaruto committed Oct 23, 2023
1 parent 62c79d5 commit 361cb32
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 44 deletions.
2 changes: 1 addition & 1 deletion NanaGet/AboutPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace winrt::NanaGet::implementation
{
::SetWindowTextW(
this->m_WindowHandle,
NanaGet::GetLocalizedString(
Mile::WinRT::GetLocalizedString(
L"AboutPage/GridTitleTextBlock/Text").c_str());
}

Expand Down
34 changes: 0 additions & 34 deletions NanaGet/NanaGetCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#undef GetObject

#include <winrt/Windows.ApplicationModel.Resources.Core.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
Expand Down Expand Up @@ -130,8 +129,6 @@ namespace NanaGet

namespace winrt
{
using Windows::ApplicationModel::Resources::Core::ResourceManager;
using Windows::ApplicationModel::Resources::Core::ResourceMap;
using Windows::Storage::ApplicationData;
using Windows::Storage::Streams::IBuffer;
using Windows::Web::Http::HttpResponseMessage;
Expand Down Expand Up @@ -349,37 +346,6 @@ bool NanaGet::FindSubString(
0) >= 0);
}

winrt::hstring NanaGet::GetLocalizedString(
winrt::hstring const& ResourcePath,
winrt::hstring const& FallbackString)
{
try
{
winrt::ResourceMap CurrentResourceMap =
winrt::ResourceManager::Current().MainResourceMap();

if (CurrentResourceMap.HasKey(ResourcePath))
{
return CurrentResourceMap.Lookup(
ResourcePath).Candidates().GetAt(0).ValueAsString();
}
else
{
return FallbackString;
}
}
catch (...)
{
return FallbackString;
}
}

winrt::hstring NanaGet::GetLocalizedString(
winrt::hstring const& ResourcePath)
{
return NanaGet::GetLocalizedString(ResourcePath, ResourcePath);
}

NanaGet::Aria2Instance::Aria2Instance(
winrt::Uri const& ServerUri,
std::string const& ServerToken)
Expand Down
7 changes: 0 additions & 7 deletions NanaGet/NanaGetCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ namespace NanaGet
winrt::hstring const& SubString,
bool IgnoreCase);

winrt::hstring GetLocalizedString(
winrt::hstring const& ResourcePath,
winrt::hstring const& FallbackString);

winrt::hstring GetLocalizedString(
winrt::hstring const& ResourcePath);

struct Aria2GlobalStatus
{
std::uint64_t DownloadSpeed;
Expand Down
2 changes: 1 addition & 1 deletion NanaGet/NewTaskPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace winrt::NanaGet::implementation
{
::SetWindowTextW(
this->m_WindowHandle,
NanaGet::GetLocalizedString(
Mile::WinRT::GetLocalizedString(
L"NewTaskPage/GridTitleTextBlock/Text").c_str());
}

Expand Down
2 changes: 1 addition & 1 deletion NanaGet/SettingsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace winrt::NanaGet::implementation
{
::SetWindowTextW(
this->m_WindowHandle,
NanaGet::GetLocalizedString(
Mile::WinRT::GetLocalizedString(
L"SettingsPage/GridTitleTextBlock/Text").c_str());
}

Expand Down

0 comments on commit 361cb32

Please sign in to comment.