| 19 For a plugin to have translation support there are a few steps that need to |
19 For a plugin to have translation support there are a few steps that need to |
| 20 followed: |
20 followed: |
| 21 |
21 |
| 22 - In your autogen.sh, add the following after your other utility checks: |
22 - In your autogen.sh, add the following after your other utility checks: |
| 23 @code |
23 @code |
| 24 (intltoolize --version) < /dev/null > /dev/null 2>&1 || { |
24 (intltoolize --version) < /dev/null > /dev/null 2>&1 || { |
| 25 echo; |
25 echo; |
| 26 echo "You must have intltool installed to compile <YOUR PLUGIN NAME>"; |
26 echo "You must have intltool installed to compile <YOUR PLUGIN NAME>"; |
| 27 echo; |
27 echo; |
| 28 exit; |
28 exit; |
| 29 } |
29 } |
| 30 @endcode |
30 @endcode |
| 31 Then before your call to aclocal add: |
31 Then before your call to aclocal add: |
| 34 @endcode |
34 @endcode |
| 35 - Now edit configure.ac and add the following: |
35 - Now edit configure.ac and add the following: |
| 36 @code |
36 @code |
| 37 AC_PROG_INTLTOOL |
37 AC_PROG_INTLTOOL |
| 38 |
38 |
| 39 GETTEXT_PACKAGE=<YOUR PLUGIN NAME> |
39 GETTEXT_PACKAGE=<YOUR PLUGIN NAME> |
| 40 AC_SUBST(GETTEXT_PACKAGE) |
40 AC_SUBST(GETTEXT_PACKAGE) |
| 41 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used]) |
41 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used]) |
| 42 |
42 |
| 43 ALL_LINGUAS="" |
43 ALL_LINGUAS="" |
| 44 AM_GLIB_GNU_GETTEXT |
44 AM_GLIB_GNU_GETTEXT |
| 66 - Open the file containing the PurplePluginInfo structure. |
66 - Open the file containing the PurplePluginInfo structure. |
| 67 - If you're not already, please make sure that you are including the |
67 - If you're not already, please make sure that you are including the |
| 68 'config.h' file for you plugin. Note that 'config.h' could be whatever |
68 'config.h' file for you plugin. Note that 'config.h' could be whatever |
| 69 you told autohead to use with AM_CONFIG_HEADER. Also add the following: |
69 you told autohead to use with AM_CONFIG_HEADER. Also add the following: |
| 70 @code |
70 @code |
| 71 #include <glib/gi18n-lib.h> |
71 #include <glib/gi18n-lib.h> |
| 72 @endcode |
72 @endcode |
| 73 Make sure that this include is after you include of your 'config.h', |
73 Make sure that this include is after you include of your 'config.h', |
| 74 otherwise you will break your build. Also note that if you wish to |
74 otherwise you will break your build. Also note that if you wish to |
| 75 maintain compatibility with older versions of GLib, you will need to |
75 maintain compatibility with older versions of GLib, you will need to |
| 76 include additional preprocessor directives, which we won't cover here. |
76 include additional preprocessor directives, which we won't cover here. |
| 86 #ifdef ENABLE_NLS |
86 #ifdef ENABLE_NLS |
| 87 bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); |
87 bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); |
| 88 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); |
88 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); |
| 89 #endif /* ENABLE_NLS */ |
89 #endif /* ENABLE_NLS */ |
| 90 |
90 |
| 91 info.name = _("<YOUR PLUGIN NAME>"); |
91 info.name = _("<YOUR PLUGIN NAME>"); |
| 92 info.summary = _("<YOUR PLUGIN SUMMARY>"); |
92 info.summary = _("<YOUR PLUGIN SUMMARY>"); |
| 93 info.description = _("<YOUR PLUGIN DESCRIPTION>"); |
93 info.description = _("<YOUR PLUGIN DESCRIPTION>"); |
| 94 @endcode |
94 @endcode |
| 95 Note that the _() is intentional, and that it is telling intltool that |
95 Note that the _() is intentional, and that it is telling intltool that |
| 96 this string should be translated. There is also N_() which says that a |
96 this string should be translated. There is also N_() which says that a |
| 97 string should only be marked for translation but should not be translated |
97 string should only be marked for translation but should not be translated |
| 98 yet. |
98 yet. |