Commit b7a20a5e authored by Sebastian Ramacher's avatar Sebastian Ramacher

Make all strings passed to girara_notify translateable.

parent 9ac4bdf0
......@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include <glib/gi18n.h>
#include "callbacks.h"
#include "zathura.h"
......@@ -145,7 +146,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
page_set_delayed(zathura, index_element->target.page_number);
} else if (index_element->type == ZATHURA_LINK_EXTERNAL) {
if (girara_xdg_open(index_element->target.uri) == false) {
girara_notify(zathura->ui.session, GIRARA_ERROR, "Failed to run xdg-open.");
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Failed to run xdg-open."));
}
}
}
......@@ -171,7 +172,7 @@ cb_sc_follow(GtkEntry* entry, girara_session_t* session)
if (eval == true) {
index = atoi(input);
if (index == 0 && g_strcmp0(input, "0") != 0) {
girara_notify(session, GIRARA_WARNING, "Invalid input '%s' given.", input);
girara_notify(session, GIRARA_WARNING, _("Invalid input '%s' given."), input);
eval = false;
}
index = index - 1;
......@@ -205,7 +206,7 @@ cb_sc_follow(GtkEntry* entry, girara_session_t* session)
}
if (eval == true && invalid_index == true) {
girara_notify(session, GIRARA_WARNING, "Invalid index '%s' given.", input);
girara_notify(session, GIRARA_WARNING, _("Invalid index '%s' given."), input);
}
g_free(input);
......
/* See LICENSE file for license and copyright information */
#include <string.h>
#include <glib/gi18n.h>
#include "commands.h"
#include "bookmarks.h"
......@@ -24,13 +25,13 @@ cmd_bookmark_create(girara_session_t* session, girara_list_t* argument_list)
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No document opened.");
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;
}
const unsigned int argc = girara_list_size(argument_list);
if (argc != 1) {
girara_notify(session, GIRARA_ERROR, "Invalid number of arguments given.");
girara_notify(session, GIRARA_ERROR, _("Invalid number of arguments given."));
return false;
}
......@@ -38,17 +39,17 @@ cmd_bookmark_create(girara_session_t* session, girara_list_t* argument_list)
zathura_bookmark_t* bookmark = zathura_bookmark_get(zathura, bookmark_name);
if (bookmark != NULL) {
bookmark->page = zathura->document->current_page_number + 1;
girara_notify(session, GIRARA_INFO, "Bookmark successfuly updated: %s", bookmark_name);
girara_notify(session, GIRARA_INFO, _("Bookmark successfuly updated: %s"), bookmark_name);
return true;
}
bookmark = zathura_bookmark_add(zathura, bookmark_name, zathura->document->current_page_number + 1);
if (bookmark == NULL) {
girara_notify(session, GIRARA_ERROR, "Could not create bookmark: %s", bookmark_name);
girara_notify(session, GIRARA_ERROR, _("Could not create bookmark: %s"), bookmark_name);
return false;
}
girara_notify(session, GIRARA_INFO, "Bookmark successfuly created: %s", bookmark_name);
girara_notify(session, GIRARA_INFO, _("Bookmark successfuly created: %s"), bookmark_name);
return true;
}
......@@ -59,21 +60,21 @@ cmd_bookmark_delete(girara_session_t* session, girara_list_t* argument_list)
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No document opened.");
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;
}
const unsigned int argc = girara_list_size(argument_list);
if (argc != 1) {
girara_notify(session, GIRARA_ERROR, "Invalid number of arguments given.");
girara_notify(session, GIRARA_ERROR, _("Invalid number of arguments given."));
return false;
}
const char* bookmark = girara_list_nth(argument_list, 0);
if (zathura_bookmark_remove(zathura, bookmark)) {
girara_notify(session, GIRARA_INFO, "Removed bookmark: %s", bookmark);
girara_notify(session, GIRARA_INFO, _("Removed bookmark: %s"), bookmark);
} else {
girara_notify(session, GIRARA_ERROR, "Failed to remove bookmark: %s", bookmark);
girara_notify(session, GIRARA_ERROR, _("Failed to remove bookmark: %s"), bookmark);
}
return true;
......@@ -86,20 +87,20 @@ cmd_bookmark_open(girara_session_t* session, girara_list_t* argument_list)
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No document opened.");
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;
}
const unsigned int argc = girara_list_size(argument_list);
if (argc != 1) {
girara_notify(session, GIRARA_ERROR, "Invalid number of arguments given.");
girara_notify(session, GIRARA_ERROR, _("Invalid number of arguments given."));
return false;
}
const char* bookmark_name = girara_list_nth(argument_list, 0);
zathura_bookmark_t* bookmark = zathura_bookmark_get(zathura, bookmark_name);
if (bookmark == NULL) {
girara_notify(session, GIRARA_ERROR, "No such bookmark: %s", bookmark_name);
girara_notify(session, GIRARA_ERROR, _("No such bookmark: %s"), bookmark_name);
return false;
}
......@@ -128,7 +129,7 @@ cmd_info(girara_session_t* session, girara_list_t* UNUSED(argument_list))
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No document opened.");
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;
}
......@@ -190,7 +191,7 @@ cmd_open(girara_session_t* session, girara_list_t* argument_list)
const int argc = girara_list_size(argument_list);
if (argc > 2) {
girara_notify(session, GIRARA_ERROR, "Too many arguments.");
girara_notify(session, GIRARA_ERROR, _("Too many arguments."));
return false;
} else if (argc >= 1) {
if (zathura->document != NULL) {
......@@ -199,7 +200,7 @@ cmd_open(girara_session_t* session, girara_list_t* argument_list)
document_open(zathura, girara_list_nth(argument_list, 0), (argc == 2) ? girara_list_nth(argument_list, 1) : NULL);
} else {
girara_notify(session, GIRARA_ERROR, "No arguments given.");
girara_notify(session, GIRARA_ERROR, _("No arguments given."));
return false;
}
......@@ -214,7 +215,7 @@ cmd_print(girara_session_t* session, girara_list_t* UNUSED(argument_list))
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No open document.");
girara_notify(session, GIRARA_ERROR, _("No open document."));
return false;
}
......@@ -231,14 +232,14 @@ cmd_save(girara_session_t* session, girara_list_t* argument_list)
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No open document.");
girara_notify(session, GIRARA_ERROR, _("No open document."));
return false;
}
if (girara_list_size(argument_list) == 1) {
document_save(zathura, girara_list_nth(argument_list, 0), false);
} else {
girara_notify(session, GIRARA_ERROR, "Invalid number of arguments.");
girara_notify(session, GIRARA_ERROR, _("Invalid number of arguments."));
return false;
}
......@@ -253,14 +254,14 @@ cmd_savef(girara_session_t* session, girara_list_t* argument_list)
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No open document.");
girara_notify(session, GIRARA_ERROR, _("No open document."));
return false;
}
if (girara_list_size(argument_list) == 1) {
document_save(zathura, girara_list_nth(argument_list, 0), true);
} else {
girara_notify(session, GIRARA_ERROR, "Invalid number of arguments.");
girara_notify(session, GIRARA_ERROR, _("Invalid number of arguments."));
return false;
}
......@@ -323,13 +324,13 @@ cmd_export(girara_session_t* session, girara_list_t* argument_list)
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, "No document opened.");
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;
}
const unsigned int argc = girara_list_size(argument_list);
if (argc != 2) {
girara_notify(session, GIRARA_ERROR, "Invalid number of arguments given.");
girara_notify(session, GIRARA_ERROR, _("Invalid number of arguments given."));
return false;
}
......@@ -342,9 +343,9 @@ cmd_export(girara_session_t* session, girara_list_t* argument_list)
char* file_name2 = girara_fix_path(file_name);
if (zathura_document_attachment_save(zathura->document, attachment_name, file_name) == false) {
girara_notify(session, GIRARA_ERROR, "Couldn't write attachment '%s' to '%s'.", attachment_name, file_name);
girara_notify(session, GIRARA_ERROR, _("Couldn't write attachment '%s' to '%s'."), attachment_name, file_name);
} else {
girara_notify(session, GIRARA_INFO, "Wrote attachment '%s' to '%s'.", attachment_name, file_name2);
girara_notify(session, GIRARA_INFO, _("Wrote attachment '%s' to '%s'."), attachment_name, file_name2);
}
g_free(file_name2);
......
......@@ -13,6 +13,7 @@
#include <errno.h>
#include <glib.h>
#include <gio/gio.h>
#include <glib/gi18n.h>
#include "document.h"
#include "utils.h"
......@@ -379,7 +380,7 @@ zathura_document_free(zathura_document_t* document)
/* free document */
bool r = true;
if (document->functions.document_free == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
} else {
r = document->functions.document_free(document);
......@@ -402,7 +403,7 @@ zathura_document_save_as(zathura_document_t* document, const char* path)
}
if (document->functions.document_save_as == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return false;
}
......@@ -418,7 +419,7 @@ zathura_document_index_generate(zathura_document_t* document, zathura_plugin_err
}
if (document->functions.document_index_generate == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return NULL;
}
......@@ -434,7 +435,7 @@ zathura_document_attachments_get(zathura_document_t* document, zathura_plugin_er
}
if (document->functions.document_attachments_get == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return NULL;
}
......@@ -450,7 +451,7 @@ zathura_document_attachment_save(zathura_document_t* document, const char* attac
}
if (document->functions.document_attachment_save == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
......@@ -472,7 +473,7 @@ zathura_document_meta_get(zathura_document_t* document, zathura_document_meta_t
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return NULL;
}
......@@ -491,7 +492,7 @@ zathura_page_get(zathura_document_t* document, unsigned int page_id, zathura_plu
}
if (document->functions.page_get == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
......@@ -531,7 +532,7 @@ zathura_page_free(zathura_page_t* page)
}
if (page->document->functions.page_free == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
......@@ -551,7 +552,7 @@ zathura_page_search_text(zathura_page_t* page, const char* text, zathura_plugin_
}
if (page->document->functions.page_search_text == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
......@@ -574,7 +575,7 @@ zathura_page_links_get(zathura_page_t* page, zathura_plugin_error_t* error)
}
if (page->document->functions.page_links_get == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
......@@ -603,7 +604,7 @@ zathura_page_form_fields_get(zathura_page_t* page, zathura_plugin_error_t* error
}
if (page->document->functions.page_form_fields_get == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
......@@ -632,7 +633,7 @@ zathura_page_images_get(zathura_page_t* page, zathura_plugin_error_t* error)
}
if (page->document->functions.page_images_get == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
......@@ -656,7 +657,7 @@ zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathu
}
if (page->document->functions.page_image_get_cairo == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
......@@ -677,7 +678,7 @@ char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle,
}
if (page->document->functions.page_get_text == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
......@@ -698,7 +699,7 @@ zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing)
}
if (page->document->functions.page_render_cairo == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-03-04 18:29+0100\n"
"POT-Creation-Date: 2012-03-04 18:45+0100\n"
"PO-Revision-Date: 2012-03-04 17:77+0100\n"
"Last-Translator: Sebastian Ramacher <s.ramacher@gmx.at>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -17,6 +17,93 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../callbacks.c:149
msgid "Failed to run xdg-open."
msgstr ""
#: ../callbacks.c:175
#, c-format
msgid "Invalid input '%s' given."
msgstr ""
#: ../callbacks.c:209
#, c-format
msgid "Invalid index '%s' given."
msgstr ""
#: ../commands.c:28 ../commands.c:63 ../commands.c:90 ../commands.c:132
#: ../commands.c:327
msgid "No document opened."
msgstr ""
#: ../commands.c:34 ../commands.c:69 ../commands.c:96 ../commands.c:333
msgid "Invalid number of arguments given."
msgstr ""
#: ../commands.c:42
#, c-format
msgid "Bookmark successfuly updated: %s"
msgstr ""
#: ../commands.c:48
#, c-format
msgid "Could not create bookmark: %s"
msgstr ""
#: ../commands.c:52
#, c-format
msgid "Bookmark successfuly created: %s"
msgstr ""
#: ../commands.c:75
#, c-format
msgid "Removed bookmark: %s"
msgstr ""
#: ../commands.c:77
#, c-format
msgid "Failed to remove bookmark: %s"
msgstr ""
#: ../commands.c:103
#, c-format
msgid "No such bookmark: %s"
msgstr ""
#: ../commands.c:194
msgid "Too many arguments."
msgstr ""
#: ../commands.c:203
msgid "No arguments given."
msgstr ""
#: ../commands.c:218 ../commands.c:235 ../commands.c:257
msgid "No open document."
msgstr ""
#: ../commands.c:242 ../commands.c:264
msgid "Invalid number of arguments."
msgstr ""
#: ../commands.c:346
#, c-format
msgid "Couldn't write attachment '%s' to '%s'."
msgstr ""
#: ../commands.c:348
#, c-format
msgid "Wrote attachment '%s' to '%s'."
msgstr ""
#: ../document.c:383 ../document.c:406 ../document.c:422 ../document.c:438
#: ../document.c:454 ../document.c:476 ../document.c:495 ../document.c:535
#: ../document.c:555 ../document.c:578 ../document.c:607 ../document.c:636
#: ../document.c:660 ../document.c:681 ../document.c:702
#, c-format
msgid "%s not implemented"
msgstr ""
#: ../zathura.c:52
msgid "Reparents to window specified by xid"
msgstr ""
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-03-04 18:29+0100\n"
"POT-Creation-Date: 2012-03-04 18:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -17,6 +17,93 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../callbacks.c:149
msgid "Failed to run xdg-open."
msgstr ""
#: ../callbacks.c:175
#, c-format
msgid "Invalid input '%s' given."
msgstr ""
#: ../callbacks.c:209
#, c-format
msgid "Invalid index '%s' given."
msgstr ""
#: ../commands.c:28 ../commands.c:63 ../commands.c:90 ../commands.c:132
#: ../commands.c:327
msgid "No document opened."
msgstr ""
#: ../commands.c:34 ../commands.c:69 ../commands.c:96 ../commands.c:333
msgid "Invalid number of arguments given."
msgstr ""
#: ../commands.c:42
#, c-format
msgid "Bookmark successfuly updated: %s"
msgstr ""
#: ../commands.c:48
#, c-format
msgid "Could not create bookmark: %s"
msgstr ""
#: ../commands.c:52
#, c-format
msgid "Bookmark successfuly created: %s"
msgstr ""
#: ../commands.c:75
#, c-format
msgid "Removed bookmark: %s"
msgstr ""
#: ../commands.c:77
#, c-format
msgid "Failed to remove bookmark: %s"
msgstr ""
#: ../commands.c:103
#, c-format
msgid "No such bookmark: %s"
msgstr ""
#: ../commands.c:194
msgid "Too many arguments."
msgstr ""
#: ../commands.c:203
msgid "No arguments given."
msgstr ""
#: ../commands.c:218 ../commands.c:235 ../commands.c:257
msgid "No open document."
msgstr ""
#: ../commands.c:242 ../commands.c:264
msgid "Invalid number of arguments."
msgstr ""
#: ../commands.c:346
#, c-format
msgid "Couldn't write attachment '%s' to '%s'."
msgstr ""
#: ../commands.c:348
#, c-format
msgid "Wrote attachment '%s' to '%s'."
msgstr ""
#: ../document.c:383 ../document.c:406 ../document.c:422 ../document.c:438
#: ../document.c:454 ../document.c:476 ../document.c:495 ../document.c:535
#: ../document.c:555 ../document.c:578 ../document.c:607 ../document.c:636
#: ../document.c:660 ../document.c:681 ../document.c:702
#, c-format
msgid "%s not implemented"
msgstr ""
#: ../zathura.c:52
msgid "Reparents to window specified by xid"
msgstr ""
......
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