From c86f9e47fb3782f6f0fdb2500322c808be3962c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Fri, 15 Dec 2023 20:52:13 +0100 Subject: [PATCH 1/3] core: Fix unextractable translation string Glib format specifiers are not gettext friendly. It even emits a warning: src/core/main-utils.c:196: warning: Although being used in a format string position, the msgid is not a valid C format string." One possible solution is to use the equivalent format specifiers from like PRId64, available since C99. Even simpler is to cast the value to a type that is big enough to hold it according to C specs (i.e. for int64: long long). Fixes: 50f34217f919 ('main: use _nm_utils_ascii_str_to_int64 instead of strtol for reading pid') --- src/core/main-utils.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/main-utils.c b/src/core/main-utils.c index 9360d68878..0f62da2902 100644 --- a/src/core/main-utils.c +++ b/src/core/main-utils.c @@ -192,10 +192,7 @@ nm_main_utils_ensure_not_running_pidfile(const char *pidfile) if (strcmp(process_name, prgname) == 0) { /* Check that the process exists */ if (kill(pid, 0) == 0) { - fprintf(stderr, - _("%s is already running (pid %" G_GINT64_FORMAT ")\n"), - prgname, - (gint64) pid); + fprintf(stderr, _("%s is already running (pid %lld)\n"), prgname, (long long) pid); exit(1); } } From 71e9baa65660e407dd1b0b1776c676f55cc7632f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Fri, 15 Dec 2023 22:14:26 +0100 Subject: [PATCH 2/3] po: Fix typo in indonesian translation Detected thanks to this message when generating the pot files: id.po:14392: warning: internationalized messages should not contain the '\v' escape sequence. Due to the formatting of the string that contains it, it seems clear that the \v character and the preceding work was put there by mistake. --- po/id.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/id.po b/po/id.po index 192d4e27bd..8a770b1c9a 100644 --- a/po/id.po +++ b/po/id.po @@ -13755,7 +13755,7 @@ msgstr "" " 'conf' Memuat ulang konfigurasi NetworkManager.conf dari disk.\n" " Perhatikan bahwa ini tidak termasuk koneksi, yang dapat\n" " dimuat ulang melalui 'nmcli connection reload' " -"sebagai\v gantinya.\n" +" gantinya.\n" "\n" " 'dns-rc' Memperbarui konfigurasi DNS, yang biasanya melibatkan\n" " penulisan /etc/resolv.conf baru.\n" From 6a1d81abf750956974fedd2cf6c2ec520af96fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Fri, 15 Dec 2023 22:21:00 +0100 Subject: [PATCH 3/3] CI: check for potential translation errors Some warnings in the generation of the translation files indicate real errors, like strings that cannot be extracted for translations. Check that no warnings are emitted. --- .gitlab-ci.yml | 11 ++++++----- .gitlab-ci/ci.template | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c1e9a4c5cf..e13995b3b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,11 +57,11 @@ variables: # # This is done by running `ci-fairy generate-template` and possibly bumping # ".default_tag". - ALPINE_TAG: 'tag-b51da9e3f95a' - CENTOS_TAG: 'tag-c89e0aac1363' - DEBIAN_TAG: 'tag-76973ff363a5' - FEDORA_TAG: 'tag-c89e0aac1363' - UBUNTU_TAG: 'tag-76973ff363a5' + ALPINE_TAG: 'tag-7da44bbacc09' + CENTOS_TAG: 'tag-c8090b8a9a6b' + DEBIAN_TAG: 'tag-86a16c2d74d8' + FEDORA_TAG: 'tag-c8090b8a9a6b' + UBUNTU_TAG: 'tag-86a16c2d74d8' ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh' CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh' @@ -710,6 +710,7 @@ check-tree: - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n - date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code + - date '+%Y%m%d-%H%M%S'; ./autogen.sh && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ] pages: stage: deploy diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 437133f34f..75606ec24d 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -209,6 +209,7 @@ check-tree: - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n - date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code + - date '+%Y%m%d-%H%M%S'; ./autogen.sh && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ] pages: stage: deploy