Skip to content

Commit

Permalink
add failed
Browse files Browse the repository at this point in the history
  • Loading branch information
PayneFuRC committed Aug 21, 2023
1 parent 37d9fa4 commit 74316bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
11 changes: 1 addition & 10 deletions .vscode/symbols.json
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
{
"symbols": {},
"files": {
"lib\\index.ts": "2023-07-14T01:26:25.912Z",
"test\\smoke-test.ts": "2023-07-14T02:14:33.395Z",
"dist\\index.d.ts": "2023-07-14T02:08:29.307Z",
"lib/index.ts": "2023-07-14T02:51:25.344Z",
"test/smoke-test.ts": "2023-07-14T02:51:25.345Z"
}
}
{"symbols":{},"files":{"lib\\index.ts":"2023-07-14T01:26:25.912Z","test\\smoke-test.ts":"2023-07-14T02:14:33.395Z","dist\\index.d.ts":"2023-08-21T02:14:41.530Z","lib/index.ts":"2023-07-14T02:51:25.344Z","test/smoke-test.ts":"2023-07-14T02:51:25.345Z"}}
11 changes: 6 additions & 5 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ Napi::String getUserDefaultLocaleName(const Napi::CallbackInfo &info)
wchar_t localeName[LOCALE_NAME_MAX_LENGTH] = {0};

// Retrieve the default user locale name
if (GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH))
if (FAILED(GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH)))
{
std::wstring wideString(localeName);
std::string narrowString(wideString.begin(), wideString.end());
return Napi::String::New(info.Env(), narrowString);
return Napi::String::New(info.Env(), "en-US");
}
return Napi::String::New(info.Env(), "en-US");

std::wstring wideString(localeName);
std::string narrowString(wideString.begin(), wideString.end());
return Napi::String::New(info.Env(), narrowString);
}

Napi::Object Init(Napi::Env env, Napi::Object exports)
Expand Down

0 comments on commit 74316bc

Please sign in to comment.