From 1c7dde3e475978c569a982d65fd86d4b4e3caad8 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 11 Jul 2011 17:01:28 +0100 Subject: [PATCH] build-sys: Add i18n support through intltool And put the PolicyKit policy files up for translation. --- Makefile.am | 16 +++++++++++----- autogen.sh | 1 + configure.ac | 11 ++++++++++- po/POTFILES.in | 4 ++++ ...olicy => org.freedesktop.hostname1.policy.in} | 12 ++++++------ ....policy => org.freedesktop.locale1.policy.in} | 4 ++-- ...1.policy => org.freedesktop.login1.policy.in} | 12 ++++++------ ...olicy => org.freedesktop.timedate1.policy.in} | 14 +++++++------- 8 files changed, 47 insertions(+), 27 deletions(-) create mode 100644 po/POTFILES.in rename src/{org.freedesktop.hostname1.policy => org.freedesktop.hostname1.policy.in} (76%) rename src/{org.freedesktop.locale1.policy => org.freedesktop.locale1.policy.in} (86%) rename src/{org.freedesktop.login1.policy => org.freedesktop.login1.policy.in} (74%) rename src/{org.freedesktop.timedate1.policy => org.freedesktop.timedate1.policy.in} (76%) diff --git a/Makefile.am b/Makefile.am index 5cb4d294..4acdb2e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,6 +17,8 @@ ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = po + # Dirs of external packages dbuspolicydir=@dbuspolicydir@ dbussessionservicedir=@dbussessionservicedir@ @@ -470,11 +472,14 @@ pkgconfigdata_DATA = \ nodist_polkitpolicy_DATA = \ src/org.freedesktop.systemd1.policy -dist_polkitpolicy_DATA = \ - src/org.freedesktop.hostname1.policy \ - src/org.freedesktop.locale1.policy \ - src/org.freedesktop.timedate1.policy \ - src/org.freedesktop.login1.policy +dist_polkitpolicy_in_files = \ + src/org.freedesktop.hostname1.policy.in \ + src/org.freedesktop.locale1.policy.in \ + src/org.freedesktop.timedate1.policy.in \ + src/org.freedesktop.login1.policy.in + +@INTLTOOL_POLICY_RULE@ +polkitpolicy_DATA = $(dist_polkitpolicy_in_files:.policy.in=.policy) noinst_LTLIBRARIES = \ libsystemd-basic.la \ @@ -1356,6 +1361,7 @@ CLEANFILES = \ $(nodist_man_MANS) \ ${XML_IN_FILES:.xml.in=.html} \ $(pkgconfigdata_DATA) \ + $(polkitpolicy_DATA) \ src/org.freedesktop.systemd1.policy if HAVE_VALAC diff --git a/autogen.sh b/autogen.sh index 826d9b0d..55a115d4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -60,6 +60,7 @@ else rm -f config.cache libtoolize -c --force + intltoolize -c -f run_versioned aclocal "$AM_VERSION" -I m4 run_versioned autoconf "$AC_VERSION" -Wall run_versioned autoheader "$AC_VERSION" diff --git a/configure.ac b/configure.ac index 58296b9c..bc7ab429 100644 --- a/configure.ac +++ b/configure.ac @@ -43,6 +43,15 @@ AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [ ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}" ]) +# i18n stuff for the PolicyKit policy files +IT_PROG_INTLTOOL([0.40.0]) + +GETTEXT_PACKAGE=systemd +AC_SUBST(GETTEXT_PACKAGE) + +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION([0.18.1]) + AC_PROG_MKDIR_P AC_PROG_LN_S AC_PROG_SED @@ -523,7 +532,7 @@ AC_SUBST([udevrulesdir], [$with_udevrulesdir]) AC_SUBST([pamlibdir], [$with_pamlibdir]) AC_SUBST([rootdir], [$with_rootdir]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile po/Makefile.in]) AC_OUTPUT echo " diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 00000000..29be44ee --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,4 @@ +src/org.freedesktop.hostname1.policy.in +src/org.freedesktop.locale1.policy.in +src/org.freedesktop.login1.policy.in +src/org.freedesktop.timedate1.policy.in diff --git a/src/org.freedesktop.hostname1.policy b/src/org.freedesktop.hostname1.policy.in similarity index 76% rename from src/org.freedesktop.hostname1.policy rename to src/org.freedesktop.hostname1.policy.in index 0ad64d9e..7d56b22c 100644 --- a/src/org.freedesktop.hostname1.policy +++ b/src/org.freedesktop.hostname1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Set host name - Authentication is required to set the local host name. + <_description>Set host name + <_message>Authentication is required to set the local host name. auth_admin_keep auth_admin_keep @@ -27,8 +27,8 @@ - Set static host name - Authentication is required to set the statically configured local host name, as well as the pretty host name. + <_description>Set static host name + <_message>Authentication is required to set the statically configured local host name, as well as the pretty host name. auth_admin_keep auth_admin_keep @@ -37,8 +37,8 @@ - Set machine information - Authentication is required to set local machine information. + <_description>Set machine information + <_message>Authentication is required to set local machine information. auth_admin_keep auth_admin_keep diff --git a/src/org.freedesktop.locale1.policy b/src/org.freedesktop.locale1.policy.in similarity index 86% rename from src/org.freedesktop.locale1.policy rename to src/org.freedesktop.locale1.policy.in index 6c755fd6..186d7d34 100644 --- a/src/org.freedesktop.locale1.policy +++ b/src/org.freedesktop.locale1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Set system locale - Authentication is required to set the system locale. + <_description>Set system locale + <_message>Authentication is required to set the system locale. auth_admin_keep auth_admin_keep diff --git a/src/org.freedesktop.login1.policy b/src/org.freedesktop.login1.policy.in similarity index 74% rename from src/org.freedesktop.login1.policy rename to src/org.freedesktop.login1.policy.in index 7ad8f6f3..9482c87f 100644 --- a/src/org.freedesktop.login1.policy +++ b/src/org.freedesktop.login1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Allow non-logged-in users to run programs - Authentication is required to allow a non-logged-in user to run programs + <_description>Allow non-logged-in users to run programs + <_message>Authentication is required to allow a non-logged-in user to run programs auth_admin_keep auth_admin_keep @@ -27,8 +27,8 @@ - Allow attaching devices to seats - Authentication is required to allow attaching a device to a seat + <_description>Allow attaching devices to seats + <_message>Authentication is required to allow attaching a device to a seat auth_admin_keep auth_admin_keep @@ -37,8 +37,8 @@ - Flush device to seat attachments - Authentication is required to allow reseting how devices are attached to seats + <_description>Flush device to seat attachments + <_message>Authentication is required to allow reseting how devices are attached to seats auth_admin_keep auth_admin_keep diff --git a/src/org.freedesktop.timedate1.policy b/src/org.freedesktop.timedate1.policy.in similarity index 76% rename from src/org.freedesktop.timedate1.policy rename to src/org.freedesktop.timedate1.policy.in index 5010efd6..f73e1aa7 100644 --- a/src/org.freedesktop.timedate1.policy +++ b/src/org.freedesktop.timedate1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - Set system time - Authentication is required to set the system time. + <_description>Set system time + <_message>Authentication is required to set the system time. auth_admin_keep auth_admin_keep @@ -27,8 +27,8 @@ - Set system timezone - Authentication is required to set the system timezone. + <_description>Set system timezone + <_message>Authentication is required to set the system timezone. auth_admin_keep auth_admin_keep @@ -37,9 +37,9 @@ - Set RTC to local timezone or UTC - Authentication is required to control whether - the RTC stores the local or UTC time. + <_description>Set RTC to local timezone or UTC + <_message>Authentication is required to control whether + the RTC stores the local or UTC time. auth_admin_keep auth_admin_keep -- 2.39.5