Commit 14013ef2 authored by David Zeuthen's avatar David Zeuthen

port the .policy file parser and implement EnumerateActions

Also added Danish translations to test that translations work

$ dbus-send --system --print-reply --dest=org.freedesktop.PolicyKit1 /org/freedesktop/PolicyKit1/Authority org.freedesktop.PolicyKit1.Authority.EnumerateActions string:da
method return sender=:1.4481 -> dest=:1.4483 reply_serial=2
   array [
      struct {
         string "org.freedesktop.policykit.modify-defaults"
         string "Konfigurer implicit autorisering"
         string "Autentificering er påkrævet for ændre implicit autorisering"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
         ]
      }
      struct {
         string "org.freedesktop.policykit.read"
         string "Læs andre brugers autoriseringer"
         string "Autentificering er påkrævet for at læse andre brugers autoriseringer"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
            dict entry(
               string "org.freedesktop.PolicyKit.run-as-superuser.path"
               string "/usr/bin/BlahBlaster"
            )
         ]
      }
      struct {
         string "org.freedesktop.policykit.grant"
         string "Autoriser en anden bruger"
         string "Autentificering er påkrævet for at autorisere andre brugere"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
         ]
      }
      struct {
         string "org.freedesktop.policykit.revoke"
         string "Fjern autorisering fra en anden bruger"
         string "Autentificering er påkrævet for at fjerne en autosering fra en anden bruger"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
         ]
      }
   ]

$ dbus-send --system --print-reply --dest=org.freedesktop.PolicyKit1 /org/freedesktop/PolicyKit1/Authority org.freedesktop.PolicyKit1.Authority.EnumerateActions string:
method return sender=:1.4481 -> dest=:1.4484 reply_serial=2
   array [
      struct {
         string "org.freedesktop.policykit.modify-defaults"
         string "Modify defaults for implicit authorizations"
         string "Authentication is required to modify the defaults for implicit authorizations"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
         ]
      }
      struct {
         string "org.freedesktop.policykit.read"
         string "Read authorizations of other users"
         string "Authentication is required to read authorizations of other users"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
            dict entry(
               string "org.freedesktop.PolicyKit.run-as-superuser.path"
               string "/usr/bin/BlahBlaster"
            )
         ]
      }
      struct {
         string "org.freedesktop.policykit.grant"
         string "Grant authorizations to other users"
         string "Authentication is required to grant authorizations to other users"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
         ]
      }
      struct {
         string "org.freedesktop.policykit.revoke"
         string "Revoke authorizations from other users"
         string "Authentication is required to revoke authorizations other users"
         string "The PolicyKit Project"
         string "http://hal.freedesktop.org/docs/PolicyKit/"
         string ""
         array [
         ]
      }
   ]
parent 71e3b425
......@@ -149,7 +149,7 @@ fi
# ********************
IT_PROG_INTLTOOL([0.40.0])
GETTEXT_PACKAGE=polkit
GETTEXT_PACKAGE=polkit-1
AC_SUBST([GETTEXT_PACKAGE])
AM_GLIB_GNU_GETTEXT
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
......
# please keep this list sorted alphabetically
#
da
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
[encoding: UTF-8]
actions/org.freedesktop.policykit.policy.in
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-12-07 16:14-0500\n"
"PO-Revision-Date: 2008-12-07 16:17-0500\n"
"Last-Translator: David Zeuthen <davidz@redhat.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../actions/org.freedesktop.policykit.policy.in.h:1
msgid "Authentication is required to grant authorizations to other users"
msgstr "Autentificering er påkrævet for at autorisere andre brugere"
#: ../actions/org.freedesktop.policykit.policy.in.h:2
msgid ""
"Authentication is required to modify the defaults for implicit authorizations"
msgstr "Autentificering er påkrævet for ændre implicit autorisering"
#: ../actions/org.freedesktop.policykit.policy.in.h:3
msgid "Authentication is required to read authorizations of other users"
msgstr "Autentificering er påkrævet for at læse andre brugers autoriseringer"
#: ../actions/org.freedesktop.policykit.policy.in.h:4
msgid "Authentication is required to revoke authorizations other users"
msgstr "Autentificering er påkrævet for at fjerne en autosering fra en anden bruger"
#: ../actions/org.freedesktop.policykit.policy.in.h:5
msgid "Grant authorizations to other users"
msgstr "Autoriser en anden bruger"
#: ../actions/org.freedesktop.policykit.policy.in.h:6
msgid "Modify defaults for implicit authorizations"
msgstr "Konfigurer implicit autorisering"
#: ../actions/org.freedesktop.policykit.policy.in.h:7
msgid "Read authorizations of other users"
msgstr "Læs andre brugers autoriseringer"
#: ../actions/org.freedesktop.policykit.policy.in.h:8
msgid "Revoke authorizations from other users"
msgstr "Fjern autorisering fra en anden bruger"
......@@ -40,6 +40,7 @@ libpolkit_backend_1_la_LIBADD = \
$(GLIB_LIBS) \
$(EGG_DBUS_LIBS) \
$(top_builddir)/src/polkit/libpolkit-gobject-1.la \
$(EXPAT_LIBS) \
$(NULL)
CLEANFILES = $(BUILT_SOURCES)
......
This diff is collapsed.
......@@ -63,10 +63,14 @@ struct _PolkitBackendActionPoolClass
void (*_polkit_reserved8) (void);
};
GType polkit_backend_action_pool_get_type (void) G_GNUC_CONST;
PolkitBackendActionPool *polkit_backend_action_pool_new (GFile *directory);
GList *polkit_backend_action_pool_get_localized_actions (PolkitBackendActionPool *pool,
const gchar *locale);
GType polkit_backend_action_pool_get_type (void) G_GNUC_CONST;
PolkitBackendActionPool *polkit_backend_action_pool_new (GFile *directory);
GList *polkit_backend_action_pool_get_all_actions (PolkitBackendActionPool *pool,
const gchar *locale);
PolkitActionDescription *polkit_backend_action_pool_get_action (PolkitBackendActionPool *pool,
const gchar *action_id,
const gchar *locale);
G_END_DECLS
......
......@@ -167,8 +167,8 @@ authority_iface_handle_enumerate_actions (PolkitAuthority *authority,
local_authority = POLKIT_BACKEND_LOCAL_AUTHORITY (authority);
priv = POLKIT_BACKEND_LOCAL_AUTHORITY_GET_PRIVATE (local_authority);
list = polkit_backend_action_pool_get_localized_actions (priv->action_pool,
locale);
list = polkit_backend_action_pool_get_all_actions (priv->action_pool,
locale);
polkit_authority_handle_enumerate_actions_finish (method_invocation,
list);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment