On 7 April 2011 19:53, Paul Lesniewski <p...@squirrelmail.org> 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.

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

- Then I created the .po file:

xgettext --keyword=_ -d restrict_senders -s --language=php *.php

That generated the file: restrict_senders.po

- 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...

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.
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@lists.sourceforge.net
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): 
https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to