mirror of
https://github.com/postgres/postgres.git
synced 2025-12-18 05:01:01 +03:00
Try a few different locale name spellings in nls.sql.
While CI testing in advance of commit 8c498479d suggested that all
Unix-ish platforms would accept 'es_ES.UTF-8', the buildfarm has
a different opinion. Let's dynamically select something that works,
if possible.
Discussion: https://postgr.es/m/E1vUpNU-000kcQ-1D@gemulon.postgresql.org
This commit is contained in:
@@ -6,10 +6,23 @@ CREATE FUNCTION test_translation()
|
|||||||
RETURNS void
|
RETURNS void
|
||||||
AS :'regresslib'
|
AS :'regresslib'
|
||||||
LANGUAGE C;
|
LANGUAGE C;
|
||||||
-- Some BSDen are sticky about wanting a codeset name in lc_messages,
|
-- There's less standardization in locale name spellings than one could wish.
|
||||||
-- but it seems that at least on common platforms it doesn't have
|
-- While some platforms insist on having a codeset name in lc_messages,
|
||||||
-- to match the actual database encoding.
|
-- fortunately it seems that it need not match the actual database encoding.
|
||||||
SET lc_messages = 'es_ES.UTF-8';
|
do $$
|
||||||
|
declare locale text; ok bool;
|
||||||
|
begin
|
||||||
|
for locale in values('es_ES'), ('es_ES.UTF-8'), ('es_ES.utf8')
|
||||||
|
loop
|
||||||
|
ok = true;
|
||||||
|
begin
|
||||||
|
execute format('set lc_messages = %L', locale);
|
||||||
|
exception when invalid_parameter_value then
|
||||||
|
ok = false;
|
||||||
|
end;
|
||||||
|
exit when ok;
|
||||||
|
end loop;
|
||||||
|
end $$;
|
||||||
SELECT test_translation();
|
SELECT test_translation();
|
||||||
NOTICE: traducido PRId64 = 424242424242
|
NOTICE: traducido PRId64 = 424242424242
|
||||||
NOTICE: traducido PRId32 = -1234
|
NOTICE: traducido PRId32 = -1234
|
||||||
|
|||||||
@@ -6,10 +6,23 @@ CREATE FUNCTION test_translation()
|
|||||||
RETURNS void
|
RETURNS void
|
||||||
AS :'regresslib'
|
AS :'regresslib'
|
||||||
LANGUAGE C;
|
LANGUAGE C;
|
||||||
-- Some BSDen are sticky about wanting a codeset name in lc_messages,
|
-- There's less standardization in locale name spellings than one could wish.
|
||||||
-- but it seems that at least on common platforms it doesn't have
|
-- While some platforms insist on having a codeset name in lc_messages,
|
||||||
-- to match the actual database encoding.
|
-- fortunately it seems that it need not match the actual database encoding.
|
||||||
SET lc_messages = 'es_ES.UTF-8';
|
do $$
|
||||||
|
declare locale text; ok bool;
|
||||||
|
begin
|
||||||
|
for locale in values('es_ES'), ('es_ES.UTF-8'), ('es_ES.utf8')
|
||||||
|
loop
|
||||||
|
ok = true;
|
||||||
|
begin
|
||||||
|
execute format('set lc_messages = %L', locale);
|
||||||
|
exception when invalid_parameter_value then
|
||||||
|
ok = false;
|
||||||
|
end;
|
||||||
|
exit when ok;
|
||||||
|
end loop;
|
||||||
|
end $$;
|
||||||
SELECT test_translation();
|
SELECT test_translation();
|
||||||
NOTICE: NLS is not enabled
|
NOTICE: NLS is not enabled
|
||||||
test_translation
|
test_translation
|
||||||
|
|||||||
@@ -9,10 +9,23 @@ CREATE FUNCTION test_translation()
|
|||||||
AS :'regresslib'
|
AS :'regresslib'
|
||||||
LANGUAGE C;
|
LANGUAGE C;
|
||||||
|
|
||||||
-- Some BSDen are sticky about wanting a codeset name in lc_messages,
|
-- There's less standardization in locale name spellings than one could wish.
|
||||||
-- but it seems that at least on common platforms it doesn't have
|
-- While some platforms insist on having a codeset name in lc_messages,
|
||||||
-- to match the actual database encoding.
|
-- fortunately it seems that it need not match the actual database encoding.
|
||||||
SET lc_messages = 'es_ES.UTF-8';
|
do $$
|
||||||
|
declare locale text; ok bool;
|
||||||
|
begin
|
||||||
|
for locale in values('es_ES'), ('es_ES.UTF-8'), ('es_ES.utf8')
|
||||||
|
loop
|
||||||
|
ok = true;
|
||||||
|
begin
|
||||||
|
execute format('set lc_messages = %L', locale);
|
||||||
|
exception when invalid_parameter_value then
|
||||||
|
ok = false;
|
||||||
|
end;
|
||||||
|
exit when ok;
|
||||||
|
end loop;
|
||||||
|
end $$;
|
||||||
|
|
||||||
SELECT test_translation();
|
SELECT test_translation();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user