mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
* Language setting * spellcheck * Set FileLocksmithContextMenu package version in AppManifest.xml * Fix ambigious symbol build error * Fix ambigious symbol build error #2 * Revert unneeded changes * Improve perf * try fix ci build
23 lines
583 B
C++
23 lines
583 B
C++
#pragma once
|
|
|
|
#include <filesystem>
|
|
#include <common/SettingsAPI/settings_helpers.h>
|
|
#include <common/utils/json.h>
|
|
|
|
namespace LanguageHelpers
|
|
{
|
|
inline std::wstring load_language()
|
|
{
|
|
std::filesystem::path languageJsonFilePath(PTSettingsHelper::get_root_save_folder_location() + L"\\language.json");
|
|
|
|
auto langJson = json::from_file(languageJsonFilePath.c_str());
|
|
if (!langJson.has_value())
|
|
{
|
|
return {};
|
|
}
|
|
|
|
std::wstring language = langJson->GetNamedString(L"language", L"").c_str();
|
|
return language;
|
|
}
|
|
}
|