aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2021-02-04 13:31:13 +0100
committerPeter Eisentraut <peter@eisentraut.org>2021-02-04 13:31:13 +0100
commit3c78e0569ca04f4c92f0adcd74471398bb7b2e55 (patch)
treec5d43549a4e93981b5428247534d6bf0ca3eab57 /src
parent5128483d064038702f535aced2cbaa43256db214 (diff)
downloadpostgresql-3c78e0569ca04f4c92f0adcd74471398bb7b2e55.tar.gz
postgresql-3c78e0569ca04f4c92f0adcd74471398bb7b2e55.zip
Refactor Windows error message for easier translation
In the error messages referring to the user right "Lock pages in memory", this is a term from the Windows OS, so it should be translated in accordance with the OS localization. Refactor the error messages so this is easier and clearer. Also fix the capitalization to match the existing capitalization in the OS.
Diffstat (limited to 'src')
-rw-r--r--src/backend/port/win32_shmem.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/backend/port/win32_shmem.c b/src/backend/port/win32_shmem.c
index 177315f238d..ab2534351d7 100644
--- a/src/backend/port/win32_shmem.c
+++ b/src/backend/port/win32_shmem.c
@@ -141,7 +141,10 @@ EnableLockPagesPrivilege(int elevel)
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
{
ereport(elevel,
- (errmsg("could not enable Lock Pages in Memory user right: error code %lu", GetLastError()),
+ (errmsg("could not enable user right \"%s\": error code %lu",
+ /* translator: This is a term from Windows and should be translated to match the Windows localization. */
+ _("Lock pages in memory"),
+ GetLastError()),
errdetail("Failed system call was %s.", "OpenProcessToken")));
return FALSE;
}
@@ -149,7 +152,7 @@ EnableLockPagesPrivilege(int elevel)
if (!LookupPrivilegeValue(NULL, SE_LOCK_MEMORY_NAME, &luid))
{
ereport(elevel,
- (errmsg("could not enable Lock Pages in Memory user right: error code %lu", GetLastError()),
+ (errmsg("could not enable user right \"%s\": error code %lu", _("Lock pages in memory"), GetLastError()),
errdetail("Failed system call was %s.", "LookupPrivilegeValue")));
CloseHandle(hToken);
return FALSE;
@@ -161,7 +164,7 @@ EnableLockPagesPrivilege(int elevel)
if (!AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL))
{
ereport(elevel,
- (errmsg("could not enable Lock Pages in Memory user right: error code %lu", GetLastError()),
+ (errmsg("could not enable user right \"%s\": error code %lu", _("Lock pages in memory"), GetLastError()),
errdetail("Failed system call was %s.", "AdjustTokenPrivileges")));
CloseHandle(hToken);
return FALSE;
@@ -172,11 +175,12 @@ EnableLockPagesPrivilege(int elevel)
if (GetLastError() == ERROR_NOT_ALL_ASSIGNED)
ereport(elevel,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("could not enable Lock Pages in Memory user right"),
- errhint("Assign Lock Pages in Memory user right to the Windows user account which runs PostgreSQL.")));
+ errmsg("could not enable user right \"%s\"", _("Lock pages in memory")),
+ errhint("Assign user right \"%s\" to the Windows user account which runs PostgreSQL.",
+ _("Lock pages in memory"))));
else
ereport(elevel,
- (errmsg("could not enable Lock Pages in Memory user right: error code %lu", GetLastError()),
+ (errmsg("could not enable user right \"%s\": error code %lu", _("Lock pages in memory"), GetLastError()),
errdetail("Failed system call was %s.", "AdjustTokenPrivileges")));
CloseHandle(hToken);
return FALSE;