Richard Liao | 1 Feb 03:14
Picon

[Trac-dev] Question about Trac plugin i18n

Hi all,

Since Trac 0.12dev's i18n support for plugins have been implemented
for more than one year, I think it should be stable now.
I'm trying to migrate some plugins to apply i18n, according to
http://trac.edgewall.org/ticket/7497#comment:12
What I have done:
 1. Apply i18n changes to setup.cfg, setup.py, all .py files and templates.
 2. Extract messages from .py files and template using "python
setup.py extract_messages"
 3. Translate local language files
 4. Make .mo file using "python setup.py compile_catalog -f"
Everything works perfectly except for Genshi templates. I have added
xmlns:i18n="http://genshi.edgewall.org/i18n" in html tag, and template
messages can be extracted to .po files.
Lack of plugin domain in template seems the problem, but I can't find
where to add it.

Any suggestions are appreciate.
Thanks in advance,

Richard Liao

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

(Continue reading)

Zoom.Quiet | 1 Feb 03:59
Picon
Gravatar

Re: [Trac-dev] Question about Trac plugin i18n

On Mon, Feb 1, 2010 at 10:14, Richard Liao <richard.liao.i <at> gmail.com> wrote:
> Since Trac 0.12dev's i18n support for plugins have been implemented
> for more than one year, I think it should be stable now.
> I'm trying to migrate some plugins to apply i18n, according to
> http://trac.edgewall.org/ticket/7497#comment:12
> What I have done:
>  1. Apply i18n changes to setup.cfg, setup.py, all .py files and templates.
>  2. Extract messages from .py files and template using "python
> setup.py extract_messages"
>  3. Translate local language files
>  4. Make .mo file using "python setup.py compile_catalog -f"
> Everything works perfectly except for Genshi templates. I have added
> xmlns:i18n="http://genshi.edgewall.org/i18n" in html tag, and template
> messages can be extracted to .po files.
> Lack of plugin domain in template seems the problem, but I can't find
> where to add it.
>
> Any suggestions are appreciate.
Y! this is very important!
we r China Kingsoft.com, creat some plugin:
    http://trac-hacks.org/wiki/KTRAC
but can not easy share out,
had to publish Chinese/English two version...

so if genshi i18N is working, we will happy sharing more and more
plugin base Trac

> Thanks in advance,
>
> Richard Liao
(Continue reading)

Colin Guthrie | 1 Feb 10:41
Picon
Gravatar

Re: [Trac-dev] Re: using of IRepositoryChangeListener

'Twas brillig, and Remy Blank at 30/01/10 13:46 did gyre and gimble:
> osimons wrote:
>> That just strikes me as a bit... unexpected... Like all listeners in
>> Trac, I assume these methods will fire whenever sync() picks up a new
>> changeset or resyncs and old one, and not be something that needs
>> repository hooks and command-line calls?
> 
> There are several reasons why this is not the case:
> 
>  - Performance: with multiple repositories, we cannot afford anymore to
> try and sync them all for every request. This is highly inefficient:
> syncing once per request, when all that is needed is once per commit.

Massive nod there. I wrote a patch from trac-admin resync to accept a
revision of "--latest" as a special case so that I could disable the
"sync on every request" logic. With commit hooks etc. it should be
trivial to set this up.

That said, I think it should be an option - e.g. you should have to set
"autosync = no" in the .ini file and then you become responsible for the
running the repo sync.

I agree also with your other points (esp. regarding full resync) but the
above is something that has really hit me before.

Out of curiosity, at what version did the autosync become disabled (or
is this not yet released)?

Col

(Continue reading)

Remy Blank | 1 Feb 12:42
Picon
Favicon

Re: [Trac-dev] Re: using of IRepositoryChangeListener

Colin Guthrie wrote:
> Out of curiosity, at what version did the autosync become disabled (or
> is this not yet released)?

It's not released yet, and waiting for the merge on the multirepos
branch. The autosync is actually not disabled: the default repository
still syncs on every request by default, to facilitate migration from
0.11. There is a new option [trac] repository_sync_per_request that you
can set to the repositories you want to sync on every request, or set to
empty to disable syncing.

See:

http://trac.edgewall.org/browser/sandbox/multirepos/trac/versioncontrol/api.py#L292

-- Remy

pserik | 1 Feb 12:55
Picon

[Trac-dev] Re: using of IRepositoryChangeListener

Hello,

thanks for your reply, but i don't really understand what you mean by
"add calls to "trac-admin $ENV changeset added" and
"trac-admin $ENV changeset modified"  in your post-commit and post-
revprop-change hooks,".
Can you explain this a little bit more please?

Thanks in advance!
pserik

On Jan 30, 9:30 am, Remy Blank <remy.bl...@pobox.com> wrote:
> > i want to get all post commit messages from a trac environment. The
> > thing i only did, implemented methods "changeset_added" and
> > "changeset_modified" from the IRepositoryChangeListener interface in
> > my plugin code (i'm using the mustirepos trac version). But after
> > adding or changing of source code in repository i still get no events,
> > the methods will be not called. What is the right way to use the
> > interface?
>
> You have to add calls to "trac-admin $ENV changeset added" and
> "trac-admin $ENV changeset modified" in your post-commit and
> post-revprop-change hooks, respectively (for SVN, or only the first one
> in both "commit" and "changegroup" hooks for Mercurial).
>
> -- Remy
>
>  signature.asc
> < 1KViewDownload

(Continue reading)

Remy Blank | 1 Feb 14:04
Picon
Favicon

Re: [Trac-dev] Re: using of IRepositoryChangeListener

pserik wrote:
> Can you explain this a little bit more please?

What version control software are you using? Subversion?

-- Remy

Karsten Fuhrmann | 1 Feb 15:20
Picon
Favicon
Gravatar

[Trac-dev] Using genshi template inside a WikiMacro

Hello,
i want to code a small wiki macro, which uses templates instead of using all this genshi.builder calls.
But i could not figure out how to do that. I was thinking about using the genshi methods directly but this leads me to another problem, that genshi wouldn't use the paths in provide in my ITemplateProvider methods.




Greetings,
Karsten Fuhrmann
System Administrator
Cartoon-Film Thilo Rothkirch
Hasenheide. 54
D-10967 Berlin
phone  +49 30 698084-109
fax  +49 30 698084-29
mobile +49 176 49118462





--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
pserik | 1 Feb 20:53
Picon

[Trac-dev] Re: using of IRepositoryChangeListener

Oh, sorry. Yes, i'm using Subversion and Multirepos version of trac.

pserik

On Feb 1, 2:04 pm, Remy Blank <remy.bl...@pobox.com> wrote:
> pserik wrote:
> > Can you explain this a little bit more please?
>
> What version control software are you using? Subversion?
>
> -- Remy
>
>  signature.asc
> < 1KViewDownload

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Christian Boos | 1 Feb 21:43
Picon

Re: [Trac-dev] Question about Trac plugin i18n

Hello Richard,

On 2/1/2010 3:14 AM, Richard Liao wrote:
> Hi all,
>
> Since Trac 0.12dev's i18n support for plugins have been implemented
> for more than one year, I think it should be stable now.
> I'm trying to migrate some plugins to apply i18n, according to
> http://trac.edgewall.org/ticket/7497#comment:12
>    

I'm glad you were able to make your way without much documentation about 
this ...
I should have added some notes about plugin translations in the TracL10N 
page...

> What I have done:
>   1. Apply i18n changes to setup.cfg, setup.py, all .py files and templates.
>   2. Extract messages from .py files and template using "python
> setup.py extract_messages"
>   3. Translate local language files
>   4. Make .mo file using "python setup.py compile_catalog -f"
> Everything works perfectly except for Genshi templates. I have added
> xmlns:i18n="http://genshi.edgewall.org/i18n" in html tag, and template
> messages can be extracted to .po files.
> Lack of plugin domain in template seems the problem, but I can't find
> where to add it.
>    

You could try this:
http://genshi.edgewall.org/wiki/ApiDocs/genshi.filters.i18n#genshi.filters.i18n:DomainDirective

> Any suggestions are appreciate.
>    

Hope this works, and when I'm done with the doc, I'll keep you posted so 
that you could have a look and proof read or enhance it.

-- Christian

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Remy Blank | 2 Feb 09:43
Picon
Favicon

Re: [Trac-dev] Re: using of IRepositoryChangeListener

pserik wrote:
> Oh, sorry. Yes, i'm using Subversion and Multirepos version of trac.

Please read the following sections about hooks in Subversion:

http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks
http://svnbook.red-bean.com/nightly/en/svn.ref.reposhooks.post-commit.html

Now you should know how to add a post-commit hook to your repository.
The last step is adding a call to "trac-admin" in you post-commit hook,
like so:

  trac-admin /path/to/env changeset added reponame $2

(or the equivalent for Windows) Replace "reponame" with the name of your
repository.

I'm only just writing the documentation for this here, so stay tuned for
more complete instructions:

  http://trac.edgewall.org/wiki/0.12/TracRepositoryAdmin

Alternatively, have a look at this script (for *nix), which has more
detailed instructions:

http://trac.edgewall.org/browser/sandbox/multirepos/contrib/trac-svn-hook

-- Remy


Gmane