Re: Translation of messages of a plugin [SOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8 April 2011 20:43, Paul Lesniewski <paul@xxxxxxxxxxxxxxxx> wrote:
>
> >> Please don't top-post.  Refer to the mailing list posting guidelines
> >> if you have doubts about how to post here.
> >>
> >> >>> > I have my Squirrelmail translated into Spanish, but I don't know how
> >> >>> > to
> >> >>> > translate the messages of my plugins (ie restrict_senders). Do I
> >> >>> > have
> >> >>> > togenerate my own translation?
> >> >>>
> >> >>> Yes, unless it's already been translated.  Where to put the translated
> >> >>> plugin file depends on the plugin.  IIRC, Restrict Senders needs its
> >> >>> translated file under the main squirrelmail/locales directory.
> >> >>>
> >> >>> You might want to start here
> >> >>>
> >> >>> http://squirrelmail.org/docs/translator/translator.html
> >> >>> http://squirrelmail.org/wiki/HelpTranslating
> >> >>>
> >> >>> Both links are found with quick and easy web searches.
> >> >>
> >> >> Thanks for the reply,
> >> >> yes, I already had a look to those links, but I wasnt sure if that was
> >> >> the
> >> >> right way to do it.
> >> >> Ok, so I'll work on that.
> >> >
> >> > After trying a few things on the documentation, still not translating. I
> >> > am
> >> > sorry if I am asking about obvious things, but I dont know what else to
> >> > try
> >> > and I am stuck.
> >> > I have followed the steps here:
> >> > http://squirrelmail.org/wiki/HelpTranslating
> >> > where it says "Translating plugins".
> >> > I have changed a tested it, putting a string in the msgstr parameter, as
> >> > the
> >> > documentation suggests,.. but no luck.
> >> > I restarted Apache, but still the same.
> >> > If anyone has done this before, it could be very helpful.
> >>
> >> You need to show what you've done in order for anyone to tell you why
> >> it isn't working.  Also be specific about which plugin you're
> >> translating.  We need *EVERY* detail.
> >>
> >
> > Sorry for the top-posting.. long time I haven't posted so I forget.
>
> Thanks for understanding.  Next thing to fix is not to send HTML to
> mailing lists, thanks.
>
> > I have realised now what's missing, by still don't know how to go on.
> > The plugin's name is "restrict_senders". Here is what I did:
> > - I created path where the .po and .mo files will be saved, that is, as the
> > documentation says, using ../locale/<language_code>/LC_MESSAGES
> > /path/squirrelmail-1.4.21/plugins/restrict_senders/locale/es_ES/LC_MESSAGES
>
> These two paths are not the same thing.  You need to place your translation in:
>
> ...../squirrelmail/locale/es_ES/LC_MESSAGES
>
> > - Then I created the .po file:
> > xgettext --keyword=_ -d restrict_senders -s --language=php *.php
> > That generated the file: restrict_senders.po
>
> xgettext is used to generate a .pot file.  And you should notice that
> Restrict Senders already comes with one for you in its locale
> directory.
>
> > - Compiled it:
> > msgfmt -o restrict_senders.mo restrict_senders.po
> > - Then I had my restrict_senders.po and restrict_senders.mo
> > /path/squirrelmail-1.4.21/plugins/restrict_senders/locale/es_ES/LC_MESSAGES/restrict_senders.po
> > /path/squirrelmail-1.4.21/plugins/restrict_senders/locale/es_ES/LC_MESSAGES/restrict_senders.mo
> > - Then, modified this bit, for testing, in the restrict_senders.po file:
> > #: functions.php:228
> > #, c-format
> > msgid "Too many outgoing recipients. Please limit number of recipients to
> > %d."
> > msgstr "Esta es la traduccion."
> > - Then compiled the modified .po file again.
> > - Restarted Apache.
> > So, I have realised that, at the beginning of the explanation, it says that
> > I have to tell Squirrelmail where this file is (obvious now that I know..).
> > I copy-paste the example in the documentation, that it's been done with
> > another plugin, the view_as_html plugin:
> >
> > /* i18n.php defines the _() syntax */
> > include_once('../functions/i18n.php');
> > /* Now tell gettext where the locale directory for your plugin is
> >  * this is in relation to the src/ directory
> >  */
> > bindtextdomain('view_as_html', SM_PATH . 'plugins/view_as_html/locale');
> > /* Switch to your plugin domain so your messages get translated */
> > textdomain('view_as_html');
> > if($show_html_default == 1) {
> >     echo "<a href=\"$new_link&amp;view_as_html=0\">";
> >     echo _("View as plain text");
> >     echo "</a>\n";
> > }
> > else {
> >     echo "<a href=\"$new_link&amp;view_as_html=1\">";
> >     echo _("View as HTML");
> >     echo "</a>\n";
> > }
> > /* Switch back to the SquirrelMail domain */
> > bindtextdomain('squirrelmail', SM_PATH . 'locale');
> > textdomain('squirrelmail');
> >
> > So, I found I don't know where to put this configuration...
>
> All this PHP code is unneeded.  Restrict Senders is already coded
> correctly for being translated.  You only need to create a .po and .mo
> and put them in the right place.  When you're done, please share with
> the community if you would.  You should send it to our
> squirrelmail-i18n mailing list (and this question would also have been
> more appropriate there).
>
> > So, what it looks like, is that I have to change where it says
> > "viw_as_html", and put instead "restrict_senders".
> > But.. there's a configuration with the "if" that I don't know if that will
> > apply to the restrict_senders plugin... ?
> > So I am a bit stuck over there.
> > Thank you.
> >
> >
> >
> >
> >
>
>
>
> --

That's right. I got it perfectly working now. My mistake was I thought
that I had to use the locale directory of the plugin, instead of the
main directory of Squirrel.

Thanks for your help.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users



[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux