This marks every potentially-user-visible string in libfolks for translation.
These include error messages, warnings and criticals. This also improves the
formatting and wording of some of the messages, and changes others to make
them more easily translatable. Closes: bgo#628883
Bugs fixed:
* Bug 629081 — Add API to allow specific backends to be disabled
* Bug 629862 — Add tests for the key-file backend
+* Bug 628883 — Add localisation support
Overview of changes from libfolks 0.3.0 to libfolks 0.3.1
==========================================================
{
if (!(e1 is IOError.NOT_FOUND))
{
- warning ("The relationship key file '%s' could " +
- "not be loaded: %s", filename, e1.message);
+ warning (
+ /* Translators: the first parameter is a filename,
+ * and the second is an error message. */
+ _("The relationship key file '%s' could not be loaded: %s"),
+ filename, e1.message);
this.removed ();
return;
}
{
if (!(e3 is IOError.EXISTS))
{
- warning ("The relationship key file directory " +
- "'%s' could not be created: %s",
+ warning (
+ /* Translators: the first parameter is a path, and
+ * the second is an error message. */
+ _("The relationship key file directory '%s' could not be created: %s"),
parent_dir.get_path (), e3.message);
this.removed ();
return;
{
if (!(e2 is IOError.EXISTS))
{
- warning ("The relationship key file '%s' could " +
- "not be created: %s", filename, e2.message);
+ warning (
+ /* Translators: the first parameter is a filename,
+ * and the second is an error message. */
+ _("The relationship key file '%s' could not be created: %s"),
+ filename, e2.message);
this.removed ();
return;
}
if (im_addresses == null || im_addresses.size () == 0)
{
throw new PersonaStoreError.INVALID_ARGUMENT (
- "persona store (%s, %s) requires the following details:\n" +
- " im-addresses (provided: '%p')\n",
+ /* Translators: the first two parameters are identifiers for the
+ * persona store. The third is a pointer address. Do not translate
+ * "im-addresses", as it's an object property name. */
+ _("Persona store (%s, %s) requires the following details:\n im-addresses (provided: '%p')"),
this.type_id, this.id, im_addresses);
}
{
if (!(e is IOError.CANCELLED))
{
- warning ("Could not write updated key file '%s': %s",
+ /* Translators: the first parameter is a filename, the second is
+ * an error message. */
+ warning (_("Could not write updated key file '%s': %s"),
this.file.get_path (), e.message);
}
}
* get any other exceptions, since we're iterating through a list of
* keys we've just retrieved. */
if (!(e is KeyFileError.GROUP_NOT_FOUND))
- warning ("Couldn't load data from key file: %s", e.message);
+ {
+ /* Translators: the parameter is an error message. */
+ warning (_("Couldn't load data from key file: %s"), e.message);
+ }
}
}
*/
#include <glib.h>
+#include <glib/gi18n.h>
#include <gio/gio.h>
#include <telepathy-glib/channel.h>
#include <telepathy-glib/connection.h>
* handle the error if RequestChannel failed */
if (error)
{
- g_message ("Error: %s", error->message);
+ /* Translators: the parameter is an error message. */
+ g_message (_("Error requesting a group channel: %s"), error->message);
return;
}
}
if (error)
{
- g_message ("Error: %s", error->message);
+ /* Translators: the parameter is an error message. */
+ g_message (_("Error requesting group handles: %s"), error->message);
return;
}
{
if (error != NULL)
{
- g_message ("Failed to change contact's alias: %s", error->message);
+ /* Translators: the parameter is an error message. */
+ g_message (_("Failed to change contact's alias: %s"), error->message);
return;
}
}
channel = tp_channel_new_from_properties (conn, path, properties, &error);
if (channel == NULL) {
- g_message ("Failed to create group channel: %s", error->message);
+ /* Translators: the parameter is an error message. */
+ g_message (_("Failed to create group channel: %s"), error->message);
g_error_free (error);
return;
}
const GPtrArray *channels;
if (error != NULL) {
- g_message ("Get Channels property failed: %s", error->message);
+ /* Translators: the parameter is an error message. */
+ g_message (_("Get Channels property failed: %s"), error->message);
return;
}
{
if (error != NULL)
{
- g_message ("Failed to add contact to group %s: %s",
+ /* Translators: the first parameter is a group channel identifier and the
+ * second is an error message. */
+ g_message (_("Failed to add contact to group '%s': %s"),
tp_channel_get_identifier (TP_CHANNEL (proxy)), error->message);
return;
}
{
if (error != NULL)
{
- g_message ("Failed to remove contact from group %s: %s",
+ /* Translators: the first parameter is a group channel identifier and the
+ * second is an error message. */
+ g_message (_("Failed to remove contact from group '%s': %s"),
tp_channel_get_identifier (TP_CHANNEL (proxy)), error->message);
return;
}
{
g_set_error (error, FOLKS_TP_LOWLEVEL_ERROR,
FOLKS_TP_LOWLEVEL_ERROR_INVALID_ARGUMENT,
- "invalid group channel %p to add handle %d to", channel, handle);
+ /* Translators: the first parameter is a pointer address and the
+ * second is a contact handle (numeric identifier). */
+ _("Invalid group channel %p to add handle %d to."), channel, handle);
}
handles = g_array_new (FALSE, TRUE, sizeof (guint));
this.logger = new Logger (this.id);
this.logger.invalidated.connect (() =>
{
- warning ("lost connection to the telepathy-logger " +
- "service");
+ warning (
+ _("Lost connection to the telepathy-logger service."));
this.logger = null;
});
this.logger.favourite_contacts_changed.connect (
}
catch (DBus.Error e)
{
- warning ("couldn't connect to the telepathy-logger service");
+ warning (
+ _("Couldn't connect to the telepathy-logger service."));
this.logger = null;
}
}
catch (GLib.Error e)
{
- warning ("couldn't get list of favourite contacts: %s",
+ /* Translators: the parameter is an error message. */
+ warning (_("Couldn't get list of favorite contacts: %s"),
e.message);
}
},
}
catch (DBus.Error e)
{
- warning ("couldn't get list of favourite contacts: %s", e.message);
+ /* Translators: the parameter is an error message. */
+ warning (_("Couldn't get list of favorite contacts: %s"), e.message);
}
}
this.handle_persona_map.size > 0) ||
(this.self_contact != null && this.handle_persona_map.size > 1)))
{
- warning ("unknown persona '%s' in favourites list", ids[i]);
+ /* Translators: the parameter is an identifier. */
+ warning (_("Unknown persona '%s' in favorites list."), ids[i]);
continue;
}
}
catch (GLib.Error e)
{
- warning ("couldn't add favourite contacts: %s",
+ /* Translators: the parameter is an error message. */
+ warning (_("Couldn't add favorite contacts: %s"),
e.message);
}
},
}
catch (GLib.Error e)
{
- warning ("couldn't remove favourite contacts: %s",
+ /* Translators: the parameter is an error message. */
+ warning (_("Couldn't remove favorite contacts: %s"),
e.message);
}
},
}
catch (GLib.Error e)
{
- GLib.warning ("failed to determine whether we can set " +
- "aliases on Telepathy account %s: %s",
- this.display_name, e.message);
+ GLib.warning (
+ /* Translators: the first parameter is the display name for
+ * the Telepathy account, and the second is an error
+ * message. */
+ _("Failed to determine whether we can set aliases on Telepathy account '%s': %s"),
+ this.display_name, e.message);
}
this._can_alias_personas = new_can_alias;
}
catch (GLib.Error e3)
{
- GLib.warning ("failed to determine whether we can set " +
- "groups on Telepathy account %s: %s",
- this.display_name, e3.message);
+ GLib.warning (
+ /* Translators: the first parameter is the display name for
+ * the Telepathy account, and the second is an error
+ * message. */
+ _("Failed to determine whether we can set groups on Telepathy account '%s': %s"),
+ this.display_name, e3.message);
}
this._can_group_personas = new_can_group;
{
if (error != null)
{
- warning ("Failed to create contact for self handle '%u': %s",
+ warning (
+ /* Translators: the first parameter is a Telepathy handle,
+ * and the second is an error message. */
+ _("Failed to create contact for self handle '%u': %s"),
conn.self_handle, error.message);
return;
}
}
catch (Tpf.PersonaError e)
{
- warning ("Failed to create self persona from contact '%s' " +
- "(%p)", contact.alias, contact);
+ warning (
+ /* Translators: the first parameter is the contact's
+ * alias, and the second is the location of the contact's
+ * data in memory (for debugging). */
+ _("Failed to create self persona from contact '%s' (%p)"),
+ contact.alias, contact);
}
},
this);
{
if (channel == null)
{
- warning ("error creating channel for NewChannels signal");
+ /* Translators: do not translate "NewChannels", as it's a D-Bus
+ * signal name. */
+ warning (_("Error creating channel for NewChannels signal."));
return;
}
}
catch (GLib.Error e)
{
- warning ("failed to change persona %s group %s membership to "
- + "%s",
- persona.uid, group, entry.value ? "true" : "false");
+ if (entry.value == true)
+ {
+ /* Translators: the parameter is a persona identifier and
+ * the second parameter is a group name. */
+ warning (_("Failed to add persona '%s' to group '%s'."),
+ persona.uid, group);
+ }
+ else
+ {
+ warning (
+ /* Translators: the parameter is a persona identifier
+ * and the second parameter is a group name. */
+ _("Failed to remove persona '%s' from group '%s'."),
+ persona.uid, group);
+ }
}
}
if (tp_persona.contact == this.self_contact)
{
throw new PersonaStoreError.UNSUPPORTED_ON_USER (
- "Personas representing the local user may not be removed.");
+ _("Personas representing the local user may not be removed."));
}
try
}
catch (GLib.Error e1)
{
- warning ("failed to remove persona '%s' (%s) from stored list: %s",
+ warning (
+ /* Translators: The first parameter is an identifier, the second
+ * is the persona's alias and the third is an error message.
+ * "stored" is the name of a program object, and shouldn't be
+ * translated. */
+ _("Failed to remove persona '%s' (%s) from 'stored' list: %s"),
tp_persona.uid, tp_persona.alias, e1.message);
}
}
catch (GLib.Error e2)
{
- warning ("failed to remove persona '%s' (%s) from subscribe list: %s",
+ warning (
+ /* Translators: The first parameter is an identifier, the second
+ * is the persona's alias and the third is an error message.
+ * "subscribe" is the name of a program object, and shouldn't be
+ * translated. */
+ _("Failed to remove persona '%s' (%s) from 'subscribe' list: %s"),
tp_persona.uid, tp_persona.alias, e2.message);
}
}
catch (GLib.Error e3)
{
- warning ("failed to remove persona '%s' (%s) from publish list: %s",
+ warning (
+ /* Translators: The first parameter is an identifier, the second
+ * is the persona's alias and the third is an error message.
+ * "publish" is the name of a program object, and shouldn't be
+ * translated. */
+ _("Failed to remove persona '%s' (%s) from 'publish' list: %s"),
tp_persona.uid, tp_persona.alias, e3.message);
}
}
catch (GLib.Error e)
{
- warning ("failed to change persona %s contact list %s " +
- "membership to %s",
- persona.uid, channel.get_identifier (),
- is_member ? "true" : "false");
+ if (is_member == true)
+ {
+ warning (
+ /* Translators: the first parameter is a persona identifier,
+ * the second is a contact list identifier and the third is
+ * an error message. */
+ _("Failed to add persona '%s' to contact list '%s': %s"),
+ persona.uid, channel.get_identifier (), e.message);
+ }
+ else
+ {
+ warning (
+ /* Translators: the first parameter is a persona identifier,
+ * the second is a contact list identifier and the third is
+ * an error message. */
+ _("Failed to remove persona '%s' from contact list '%s': %s"),
+ persona.uid, channel.get_identifier (), e.message);
+ }
}
}
}
catch (GLib.Error e)
{
- warning ("failed to create personas from incoming contacts in " +
- "channel '%s': %s",
+ warning (
+ /* Translators: the first parameter is a channel identifier and
+ * the second is an error message.. */
+ _("Failed to create personas from incoming contacts in channel '%s': %s"),
channel.get_identifier (), e.message);
}
}
GLib.List<Persona> personas = new GLib.List<Persona> ();
uint err_count = 0;
- string err_format = "";
+ string err_string = "";
unowned GLib.List<TelepathyGLib.Contact> l;
for (l = contacts; l != null; l = l.next)
{
}
catch (Tpf.PersonaError e)
{
- if (err_count == 0)
- err_format = "failed to create %u personas:\n";
-
- err_format = "%s '%s' (%p): %s\n".printf (
- err_format, contact.alias, contact, e.message);
+ err_string = "%s\n%s".printf (err_string,
+ /* Translators: format for lines in the error string below
+ * "Failed to create %u personas:". The first parameter is
+ * a contact alias, the second is a pointer address and
+ * the third is an error message. */
+ _("'%s' (%p): %s").printf (contact.alias, contact,
+ e.message));
err_count++;
}
}
if (err_count > 0)
{
- throw new Folks.PersonaStoreError.CREATE_FAILED (err_format,
- err_count);
+ throw new Folks.PersonaStoreError.CREATE_FAILED (
+ /* Translators: the first parameter is the number of personas
+ * which couldn't be created, and the second is a set of error
+ * message lines, built using the "'%s' (%p): %s" string
+ * above. */
+ ngettext ("Failed to create %u persona:\n%s",
+ "Failed to create %u personas:\n%s", err_count),
+ err_count, err_string);
}
if (personas != null)
}
catch (Tpf.PersonaError e)
{
- warning ("failed to create persona from contact '%s' (%p)",
+ /* Translators: the first parameter is a contact alias and the
+ * second is a pointer address. */
+ warning (_("Failed to create persona from contact '%s' (%p)."),
contact.alias, contact);
}
}
if (contact_id == null)
{
throw new PersonaStoreError.INVALID_ARGUMENT (
- "persona store (%s, %s) requires the following details:\n" +
- " contact (provided: '%s')\n",
+ /* Translators: the first two parameters are store identifiers and
+ * the third is a contact identifier. */
+ _("Persona store (%s, %s) requires the following details:\n contact (provided: '%s')\n"),
this.type_id, this.id, contact_id);
}
(status == TelepathyGLib.ConnectionStatus.CONNECTING) ||
this.conn == null)
{
- throw new PersonaStoreError.STORE_OFFLINE ("cannot create a new " +
- "Tpf.Persona while offline");
+ throw new PersonaStoreError.STORE_OFFLINE (
+ _("Cannot create a new persona while offline."));
}
string[] contact_ids = new string[1];
}
else
{
- throw new PersonaStoreError.CREATE_FAILED ("requested a single " +
- "persona, but got %u back", personas.length ());
+ /* We ignore the case of an empty list, as it just means the
+ * contact was already in our roster */
+ uint num_personas = personas.length ();
+ string message =
+ ngettext (
+ /* Translators: the parameter is the number of personas
+ * which were returned. */
+ "Requested a single persona, but got %u persona back.",
+ "Requested a single persona, but got %u personas back.",
+ num_personas);
+
+ throw new PersonaStoreError.CREATE_FAILED (message, num_personas);
}
}
catch (GLib.Error e)
{
- throw new PersonaStoreError.CREATE_FAILED ("failed to add a " +
- "persona from details: %s", e.message);
+ /* Translators: the parameter is an error message. */
+ throw new PersonaStoreError.CREATE_FAILED (
+ _("Failed to add a persona from details: %s"), e.message);
}
}
* see connection_ready_cb() */
if (this.logger == null)
{
- warning ("failed to change favourite without connection to the " +
- "telepathy-logger service");
+ warning (
+ /* Translators: "telepathy-logger" is the name of an application,
+ * and should not be translated. */
+ _("Failed to change favorite without a connection to the telepathy-logger service."));
return;
}
}
catch (DBus.Error e)
{
- warning ("failed to change a persona's favourite status");
+ warning (_("Failed to change a persona's favorite status."));
}
}
* chain up to the Object constructor, below. */
unowned string id = contact.get_identifier ();
if (id == null || id == "")
- throw new Tpf.PersonaError.INVALID_ARGUMENT ("contact has an " +
- "invalid ID");
+ {
+ throw new Tpf.PersonaError.INVALID_ARGUMENT (
+ _("Contact has an invalid ID."));
+ }
unowned Connection connection = contact.connection;
var account = account_for_connection (connection);
{
if (this.backend_is_enabled (backend.name))
{
- try
+ if (!this._prepared_backends.has_key (backend.name))
{
- if (!this._prepared_backends.has_key (backend.name))
+ try
{
yield backend.prepare ();
this._prepared_backends.set (backend.name, backend);
this.backend_available (backend);
}
- }
- catch (GLib.Error e)
- {
- warning ("Error preparing Backend '%s': %s", backend.name,
- e.message);
+ catch (GLib.Error e)
+ {
+ /* Translators: the first parameter is a backend name, and the
+ * second is an error message. */
+ warning (_("Error preparing Backend '%s': %s"),
+ backend.name, e.message);
+ }
}
}
}
}
catch (Error error)
{
- critical ("Error listing contents of folder '%s': %s",
+ /* Translators: the first parameter is a folder path and the second
+ * is an error message. */
+ critical (_("Error listing contents of folder '%s': %s"),
dir.get_path (), error.message);
return null;
}
else if (mime == null)
{
- warning ("MIME type could not be determined for file '%s'. " +
- "Have you installed shared-mime-info?", file.get_path ());
+ warning (
+ /* Translators: the parameter is a filename. */
+ _("The content type of '%s' could not be determined. Have you installed shared-mime-info?"),
+ file.get_path ());
}
}
Module module = Module.open (file_path, ModuleFlags.BIND_LOCAL);
if (module == null)
{
- warning ("Failed to load module from path '%s' : %s",
+ /* Translators: the first parameter is a filename and the second is an
+ * error message. */
+ warning (_("Failed to load module from path '%s': %s"),
file_path, Module.error ());
return;
* removed if they've since been disabled */
if (!module.symbol("module_init", out function))
{
- warning ("Failed to find entry point function '%s' in '%s': %s",
+ /* Translators: the first parameter is a function name, the second is
+ * a filename and the third is an error message. */
+ warning (_("Failed to find entry point function '%s' in '%s': %s"),
"module_init",
file_path,
Module.error ());
catch (Error error)
{
if (error is IOError.NOT_FOUND)
- critical ("File or directory '%s' does not exist",
- file.get_path ());
+ {
+ /* Translators: the parameter is a filename. */
+ critical (_("File or directory '%s' does not exist."),
+ file.get_path ());
+ }
else
- critical ("Failed to get content type for '%s'", file.get_path ());
+ {
+ /* Translators: the parameter is a filename. */
+ critical (_("Failed to get content type for '%s'."),
+ file.get_path ());
+ }
return false;
}
}
catch (GLib.Error e)
{
- warning ("Error preparing PersonaStore '%s': %s", store_id,
+ /* Translators: the first parameter is a persona store identifier
+ * and the second is an error message. */
+ warning (_("Error preparing persona store '%s': %s"), store_id,
e.message);
}
});
unowned ObjectClass pclass = persona.get_class ();
if (pclass.find_property (prop_name) == null)
{
- warning ("Unknown property '%s' in linkable property " +
- "list.", prop_name);
+ warning (
+ /* Translators: the parameter is a property name. */
+ _("Unknown property '%s' in linkable property list."),
+ prop_name);
continue;
}
unowned ObjectClass pclass = final_persona.get_class ();
if (pclass.find_property (prop_name) == null)
{
- warning ("Unknown property '%s' in linkable " +
- "property list.", prop_name);
+ warning (
+ /* Translators: the parameter is a property
+ * name. */
+ _("Unknown property '%s' in linkable property list."),
+ prop_name);
continue;
}
unowned ObjectClass pclass = persona.get_class ();
if (pclass.find_property (prop_name) == null)
{
- warning ("Unknown property '%s' in linkable property " +
- "list.", prop_name);
+ warning (
+ /* Translators: the parameter is a property name. */
+ _("Unknown property '%s' in linkable property list."),
+ prop_name);
continue;
}
if (store == null)
{
throw new IndividualAggregatorError.STORE_NOT_FOUND (
- "no store known for type ID '%s' and ID '%s'", persona_store_type,
- persona_store_id);
+ /* Translators: the parameters are store identifiers. */
+ _("No store known for type ID '%s' and ID '%s'."),
+ persona_store_type, persona_store_id);
}
Persona persona = null;
else
{
throw new IndividualAggregatorError.ADD_FAILED (
- "failed to add contact for store type '%s', ID '%s': %s",
+ /* Translators: the first two parameters are store identifiers
+ * and the third parameter is an error message. */
+ _("Failed to add contact for store type '%s', ID '%s': %s"),
persona_store_type, persona_store_id, e.message);
}
}
if (this.writeable_store == null)
{
throw new IndividualAggregatorError.NO_WRITEABLE_STORE (
- "Can't link personas with no writeable store.");
+ _("Can't link personas with no writeable store."));
}
/* Don't bother linking if it's just one Persona */
+[encoding: UTF-8]
+backends/key-file/kf-backend-factory.vala
+backends/key-file/kf-persona-store.vala
+backends/key-file/kf-persona.vala
+backends/telepathy/lib/tp-lowlevel.c
+backends/telepathy/lib/tpf-persona-store.vala
+backends/telepathy/lib/tpf-persona.vala
+folks/backend-store.vala
+folks/individual-aggregator.vala
+tools/import-pidgin.vala
+tools/import.vala
+backends/key-file/kf-backend-factory.c
+backends/key-file/kf-persona-store.c
+backends/key-file/kf-persona.c
+backends/telepathy/lib/tpf-persona-store.c
+backends/telepathy/lib/tpf-persona.c
+folks/backend-store.c
+folks/individual-aggregator.c
+tools/import-pidgin.c
+tools/import.c
var file = File.new_for_path (filename);
if (!file.query_exists ())
{
- throw new ImportError.MALFORMED_INPUT ("File %s does not exist.",
+ /* Translators: the parameter is a filename. */
+ throw new ImportError.MALFORMED_INPUT (_("File %s does not exist."),
filename);
}
catch (GLib.Error e)
{
throw new ImportError.MALFORMED_INPUT (
- "Failed to get information about file %s: %s", filename,
+ /* Translators: the first parameter is a filename, and the second
+ * is an error message. */
+ _("Failed to get information about file %s: %s"), filename,
e.message);
}
if (!file_info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_READ))
{
- throw new ImportError.MALFORMED_INPUT ("File %s is not readable.",
+ /* Translators: the parameter is a filename. */
+ throw new ImportError.MALFORMED_INPUT (_("File %s is not readable."),
filename);
}
if (xml_doc == null)
{
- throw new ImportError.MALFORMED_INPUT ("The Pidgin buddy list file " +
- "'%s' could not be loaded.", filename);
+ throw new ImportError.MALFORMED_INPUT (
+ /* Translators: the parameter is a filename. */
+ _("The Pidgin buddy list file '%s' could not be loaded."),
+ filename);
}
/* Check the root node */
/* Free the document manually before throwing because the garbage
* collector can't work on pointers. */
delete xml_doc;
- throw new ImportError.MALFORMED_INPUT ("The Pidgin buddy list file " +
- "'%s' could not be loaded: the root element could not be found " +
- "or was not recognised.", filename);
+ throw new ImportError.MALFORMED_INPUT (
+ /* Translators: the parameter is a filename. */
+ _("The Pidgin buddy list file '%s' could not be loaded: the root element could not be found or was not recognised."),
+ filename);
}
/* Parse each <blist> child element */
/* Tidy up */
delete xml_doc;
- stdout.printf ("Imported %u buddies from '%s'.\n", this.persona_count,
+ /* Translators: the first parameter is the number of buddies which were
+ * successfully imported, and the second is a filename. */
+ stdout.printf (_("Imported %u buddies from '%s'.\n"), this.persona_count,
filename);
/* Return the number of Personas we imported */
}
catch (GLib.Error e)
{
- stderr.printf ("Error changing group of Pidgin.Persona " +
- "'%s': %s\n", persona.iid, e.message);
+ stderr.printf (
+ /* Translators: the first parameter is a persona identifier,
+ * and the second is an error message. */
+ _("Error changing group of Pidgin.Persona '%s': %s\n"),
+ persona.iid, e.message);
}
}
}
(alias == null || alias.strip () == "" ||
alias.strip () == im_address_string.strip ()))
{
- stdout.printf ("Ignoring buddy with no alias and only one IM " +
- "address:\n%s", im_address_string);
+ stdout.printf (
+ /* Translators: the parameter is the buddy's IM address. */
+ _("Ignoring buddy with no alias and only one IM address:\n%s"),
+ im_address_string);
return null;
}
}
catch (PersonaStoreError e)
{
- stderr.printf ("Failed to create new persona for buddy with alias " +
- "'%s' and IM addresses:\n%s\nError: %s\n", alias,
- im_address_string, e.message);
+ /* Translators: the first parameter is an alias, the second is a set
+ * of IM addresses each on a new line, and the third is an error
+ * message. */
+ stderr.printf (
+ _("Failed to create new persona for buddy with alias '%s' and IM addresses:\n%s\nError: %s\n"),
+ alias, im_address_string, e.message);
return null;
}
((Aliasable) persona).alias = alias;
/* Print progress */
- stdout.printf ("Created persona '%s' for buddy with alias '%s' and IM " +
- "addresses:\n%s", persona.uid, alias, im_address_string);
+ stdout.printf (
+ /* Translators: the first parameter is a persona identifier, the
+ * second is an alias for the persona, and the third is a set of IM
+ * addresses each on a new line. */
+ _("Created persona '%s' for buddy with alias '%s' and IM addresses:\n%s"),
+ persona.uid, alias, im_address_string);
this.persona_count++;
return persona;
private static const OptionEntry[] options =
{
{ "source", 's', 0, OptionArg.STRING, ref ImportTool.source,
- "Source backend name (default: 'pidgin')", "name" },
+ N_("Source backend name (default: 'pidgin')"), "name" },
{ "source-filename", 0, 0, OptionArg.FILENAME,
ref ImportTool.source_filename,
- "Source filename (default: specific to source backend)", null },
+ N_("Source filename (default: specific to source backend)"), null },
{ null }
};
Intl.bindtextdomain (BuildConf.GETTEXT_PACKAGE, BuildConf.LOCALE_DIR);
Intl.textdomain (BuildConf.GETTEXT_PACKAGE);
- OptionContext context = new OptionContext ("— import meta-contact " +
- "information to libfolks");
+ OptionContext context = new OptionContext (
+ _("— import meta-contact information to libfolks"));
context.add_main_entries (ImportTool.options, "folks");
try
}
catch (OptionError e)
{
- stderr.printf ("Couldn't parse command line options: %s\n",
+ /* Translators: the parameter is an error message. */
+ stderr.printf (_("Couldn't parse command line options: %s\n"),
e.message);
return 1;
}
}
catch (GLib.Error e1)
{
- stderr.printf ("Couldn't load the backends: %s\n", e1.message);
+ /* Translators: the parameter is an error message. */
+ stderr.printf (_("Couldn't load the backends: %s\n"), e1.message);
return false;
}
if (kf_backend == null)
{
- stderr.printf ("Couldn't load the 'key-file' backend.\n");
+ stderr.printf (_("Couldn't load the 'key-file' backend.\n"));
return false;
}
}
catch (GLib.Error e2)
{
- stderr.printf ("Couldn't prepare the 'key-file' backend: %s\n",
+ /* Translators: the parameter is an error message. */
+ stderr.printf (_("Couldn't prepare the 'key-file' backend: %s\n"),
e2.message);
return false;
}
if (stores == null)
{
- stderr.printf ("Couldn't load the 'key-file' backend's persona " +
- "store.\n");
+ stderr.printf (
+ _("Couldn't load the 'key-file' backend's persona store.\n"));
return false;
}
}
catch (GLib.Error e3)
{
- stderr.printf ("Couldn't prepare the 'key-file' backend's persona " +
- "store: %s\n", e3.message);
+ /* Translators: the parameter is an error message. */
+ stderr.printf (
+ _("Couldn't prepare the 'key-file' backend's persona store: %s\n"),
+ e3.message);
return false;
}
}
catch (ImportError e)
{
- stderr.printf ("Error: %s\n", e.message);
+ /* Translators: the parameter is an error message. */
+ stderr.printf (_("Error importing personas: %s\n"), e.message);
return false;
}
}
else
{
- stderr.printf ("Unrecognised source backend name '%s'. " +
- "'pidgin' is currently the only supported source backend.\n",
+ stderr.printf (
+ _("Unrecognised source backend name '%s'. 'pidgin' is currently the only supported source backend.\n"),
source);
return false;
}