forked from misakamm/xege
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd4c523
commit 5c27c1f
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@echo off | ||
|
||
rem USAGE: patch-locale.bat <command> <args...> | ||
|
||
setlocal enableDelayedExpansion | ||
|
||
call :localeName patch | ||
%* | ||
call :localeName unpatch | ||
exit /b | ||
|
||
rem https://raymai97.github.io/myblog/msvc-support-utf8-string-literal-since-vc6#update-for-vc60-the-key-is-localename | ||
|
||
:localeName | ||
set _path_="HKCU\Control Panel\International" | ||
set _name_=LocaleName | ||
if "%~1"=="patch" ( | ||
call :localeName get _localeName_ | ||
call :localeName set en-US | ||
) else if "%~1"=="unpatch" ( | ||
call :localeName set !_localeName_! | ||
) else if "%~1"=="get" ( | ||
for /f "tokens=3 skip=2" %%i in ('reg query !_path_! /v !_name_!') do ( | ||
set _localeName_=%%i | ||
) | ||
) else if "%~1"=="set" ( | ||
reg add !_path_! /v !_name_! /d "%~2" /f >nul || exit/b 1 | ||
) | ||
exit /b | ||
:localeNameEnd |