Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Attempt to standardize on user-visible strings for translation purposes

I was being sloppy (sloppier) about marking strings for translation, so these
changes should rectify that.  The important change is making global definitions
for strings that appear in multiple places (and just directly embedding any of
the string definitions that appear only once, to be consistent).  All strings
that are visible to the user should now be properly marked with the typical "_"
and "N_" keyword macros.
  • Loading branch information...
commit d7eb37fbf2d4e24d220a3f6b9bae2d28bc0b520f 1 parent 872ed79
@dm0- authored
Showing with 35 additions and 29 deletions.
  1. +2 −7 configure.ac
  2. +14 −11 dummy.c
  3. +12 −7 plugin.c
  4. +7 −4 plugin.h
View
9 configure.ac
@@ -25,14 +25,9 @@ AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AC_DEFINE([PACKAGE_AUTHOR_UID],["dm0"],
- [Define to the short identifier of the author.])
-AC_DEFINE([PACKAGE_AUTHOR_STRING],["David Michael <fedora.dm0@gmail.com>"],
- [Define to the full name and e-mail of the author.])
-
AS_CASE(["$host_os"],
- [*mingw*],AS_VAR_SET([LT_NO_UNDEFINED],[-no-undefined]),
- AS_VAR_SET([LT_NO_UNDEFINED]))
+ [*mingw*],[AS_VAR_SET([LT_NO_UNDEFINED],[-no-undefined])],
+ [AS_VAR_SET([LT_NO_UNDEFINED])])
AC_SUBST([LT_NO_UNDEFINED])
PKG_CHECK_MODULES([pidgin],[pidgin],,
View
25 dummy.c
@@ -47,6 +47,7 @@ pwm_new_dummy_conversation()
{
PidginConversation *gtkconv; /*< The new (pretend) conversation structure */
gchar *html; /*< The HTML-formatted instructions text */
+ gchar *pretty; /*< The HTML text with prettier arrow chars */
gtkconv = g_malloc(sizeof(PidginConversation));
@@ -58,16 +59,18 @@ pwm_new_dummy_conversation()
"PidginConversation", gtkconv);
/* Do the label song and dance as is done for the Buddy List help tab. */
- html = pidgin_make_pretty_arrows
- (_("<span weight='bold' size='larger'>"
- PLUGIN_NAME " is enabled!</span>\n\n"
- "This space is reserved by the " PLUGIN_NAME " plugin to display "
- "conversations. Individual conversations can be dragged to this "
- "area to attach them, or the conversation placement preference at "
- "<b>Tools->Preferences</b> can be set to <i>Buddy List window</i> "
- "to open all new conversations here by default."));
- gtk_label_set_markup(GTK_LABEL(gtkconv->tab_cont), html);
+ html = g_strdup_printf(_(""
+ "<span size='larger' weight='bold'>%s is enabled!</span>\n\n"
+ "This space is reserved by the %s plugin to display "
+ "conversations. Individual conversations can be dragged to this "
+ "area to attach them, or the conversation placement preference at "
+ "<b>Tools->Preferences</b> can be set to <i>%s</i> to open all new "
+ "conversations here by default."),
+ _(PWM_STR_NAME), _(PWM_STR_NAME), _(PWM_STR_CP_BLIST));
+ pretty = pidgin_make_pretty_arrows(html);
g_free(html);
+ gtk_label_set_markup(GTK_LABEL(gtkconv->tab_cont), pretty);
+ g_free(pretty);
/* Initialize some conversation members to prevent Pidgin from exploding. */
gtkconv->active_conv = NULL;
@@ -107,8 +110,8 @@ pwm_show_dummy_conversation(PidginBuddyList *gtkblist)
gtkconv->close = NULL;
/* Show the plugin name and an About icon for those who can see the label. */
- gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), _(PLUGIN_NAME));
- gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), _(PLUGIN_NAME));
+ gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), _(PWM_STR_NAME));
+ gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), _(PWM_STR_NAME));
g_object_set(G_OBJECT(gtkconv->icon), "stock", GTK_STOCK_ABOUT, NULL);
g_object_set(G_OBJECT(gtkconv->menu_icon), "stock", GTK_STOCK_ABOUT, NULL);
}
View
19 plugin.c
@@ -216,7 +216,7 @@ plugin_load(PurplePlugin *plugin)
gtkconv_handle = pidgin_conversations_get_handle();
/* Add the conversation placement option provided by this plugin. */
- pidgin_conv_placement_add_fnc(PLUGIN_TOKEN, _("Buddy List window"),
+ pidgin_conv_placement_add_fnc(PLUGIN_TOKEN, _(PWM_STR_CP_BLIST),
&conv_placement_by_blist);
purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
@@ -279,8 +279,8 @@ get_plugin_pref_frame(U PurplePlugin *plugin)
frame = purple_plugin_pref_frame_new();
- ppref = purple_plugin_pref_new_with_name_and_label
- (PREF_SIDE, _("Conversation pane location"));
+ ppref = purple_plugin_pref_new_with_name_and_label(PREF_SIDE, _(""
+ "Conversation pane location"));
purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
purple_plugin_pref_add_choice(ppref, _("Right of Buddy List"), "right");
purple_plugin_pref_add_choice(ppref, _("Left of Buddy List"), "left");
@@ -309,11 +309,16 @@ static PurplePluginUiInfo prefs_info = {
/**
* The plugin's init function, used to define plugin preferences
*
- * @param[in] plugin Unused
+ * @param[in] plugin The libpurple plugin structure being initialized
**/
static void
-plugin_init(U PurplePlugin *plugin)
+plugin_init(PurplePlugin *plugin)
{
+ plugin->info->name = _(plugin->info->name);
+ plugin->info->summary = _(plugin->info->summary);
+ plugin->info->description = _(plugin->info->description);
+ plugin->info->author = _(plugin->info->author);
+
/* Initialize the root of the plugin's preferences path. */
purple_prefs_add_none(PREF_ROOT);
@@ -341,14 +346,14 @@ static PurplePluginInfo info = {
PURPLE_PRIORITY_DEFAULT,
PLUGIN_ID,
- N_(PLUGIN_NAME),
+ PLUGIN_NAME,
PLUGIN_VERSION,
N_("Merges the Buddy List window with a conversation window"),
N_("Enabling this plugin will allow conversations to be attached to the "
"Buddy List window. Preferences are available to customize the plugin's "
"panel layout."),
- PLUGIN_AUTHOR,
+ N_("David Michael <fedora.dm0@gmail.com>"),
PLUGIN_URL,
plugin_load,
View
11 plugin.h
@@ -36,12 +36,11 @@
#include "config.h"
#endif
-#define PLUGIN_AUTHOR PACKAGE_AUTHOR_STRING
-#define PLUGIN_ID PLUGIN_TYPE "-" PLUGIN_UID "-" PLUGIN_TOKEN
-#define PLUGIN_NAME PACKAGE_NAME
+#define PLUGIN_AUTHOR "dm0"
+#define PLUGIN_ID PLUGIN_TYPE "-" PLUGIN_AUTHOR "-" PLUGIN_TOKEN
+#define PLUGIN_NAME PWM_STR_NAME
#define PLUGIN_TOKEN PACKAGE_TARNAME
#define PLUGIN_TYPE "gtk"
-#define PLUGIN_UID PACKAGE_AUTHOR_UID
#define PLUGIN_URL PACKAGE_URL
#define PLUGIN_VERSION PACKAGE_VERSION
@@ -76,4 +75,8 @@
#define N_(s) (s)
#endif
+#define PWM_STR_NAME N_("Window Merge")
+
+#define PWM_STR_CP_BLIST N_("Buddy List window")
+
#endif /* ifndef __PLUGIN_H__ */
Please sign in to comment.
Something went wrong with that request. Please try again.