NLS handling fixes.
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: pgsql-hackers@lists.postgresql.org
Date: 2018-08-10T06:21:31Z
Lists: pgsql-hackers
Attachments
- fix_GUC_nls.patch (text/x-patch) patch
- fix_GSSerr_nls.patch (text/x-patch) patch
- fix_view_updt_nls.patch (text/x-patch) patch
- fix_psql_nls.patch (text/x-patch) patch
- fix_vacuumdb_nls.patch (text/x-patch) patch
Hello. I found that backend's .po file has lines for GUC descriptions but we won't see them anywhere. The cause is GetConfigOptionByNum is fogetting to retrieve translations for texts that have been marked with gettext_noop. Regarding GUCs, group names, short desc and long desc have translations so the attached first patch (fix_GUC_nls.patch) let the translations appear. Besides GUCs, I found another misuse of gettext_noop in pg_GSS_recvauth. (2nd fix_GSSerr_nls.patch) view_query_is_auto_updatable() and most of its caller are making the same mistake in a similar way. All caller sites require only translated message but bringing translated message around doesn't seem good so the attached third patch adds _() to all required places. (3rd fix_view_updt_nls.patch, 5th fix_vacuumdb_nls.patch) psql is making a bit different mistake. \gdesc seems intending the output columns names in NLS string but they actually aren't. DescribeQuery is using PrintQueryResults but it is intended to be used only for SendQuery. Replacing it with printQuery let \gdesc print NLS string but I'm not sure it is the right thing to fix this. (4th, fix psql_nls.patch) plperl/plpgsql/tcl have another kind of problem in NLS. It installs some GUC parameters and their descriptions actually have a translation but in *its own* po file. So GetConfigOptionByNum cannot get them. I don't have an idea to fix this for now. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Fix set of NLS translation issues
- f64e65bd76ef 9.3.25 landed
- 788ae09f4a95 9.4.20 landed
- 6120f2234d76 9.5.15 landed
- 90b0f30aea0e 9.6.11 landed
- ecf56dc5e5b6 10.6 landed
- 3ef153c7157f 11.0 landed
- 72be8c29a188 12.0 landed