32 messages in com.googlegroups.pylons-discussRe: Recent i18n Pylons changes
FromSent OnAttachments
Pedro Algarvio, aka, s0undt3ch13 Dec 2006 11:39 
Shannon -jj Behrens13 Dec 2006 13:27 
Pedro Algarvio, aka, s0undt3ch13 Dec 2006 14:36 
James Gardner13 Dec 2006 15:18 
Shannon -jj Behrens13 Dec 2006 15:21 
Pedro Algarvio, aka, s0undt3ch13 Dec 2006 17:13 
Shannon -jj Behrens13 Dec 2006 18:11 
Philip Jenvey13 Dec 2006 23:48 
Pedro Algarvio, aka, s0undt3ch14 Dec 2006 00:42 
Pedro Algarvio, aka, s0undt3ch14 Dec 2006 02:01 
Pedro Algarvio, aka, s0undt3ch14 Dec 2006 04:21 
James Gardner14 Dec 2006 05:05 
Ben Bangert14 Dec 2006 10:14 
Pedro Algarvio, aka, s0undt3ch14 Dec 2006 12:47 
Pedro Algarvio, aka, s0undt3ch14 Dec 2006 13:17 
Pedro Algarvio, aka, s0undt3ch16 Dec 2006 15:15 
Philip Jenvey16 Dec 2006 16:35 
Pedro Algarvio, aka, s0undt3ch17 Dec 2006 17:13 
Shannon -jj Behrens18 Dec 2006 17:22 
Shannon -jj Behrens18 Dec 2006 17:35 
Shannon -jj Behrens18 Dec 2006 17:36 
Pedro Algarvio, aka, s0undt3ch18 Dec 2006 19:36 
Pedro Algarvio, aka, s0undt3ch18 Dec 2006 23:55 
Pedro Algarvio, aka, s0undt3ch19 Dec 2006 00:02 
Max Ischenko19 Dec 2006 00:14 
Pedro Algarvio, aka, s0undt3ch19 Dec 2006 00:54 
Max Ischenko19 Dec 2006 00:58 
Shannon -jj Behrens19 Dec 2006 01:00 
Shannon -jj Behrens19 Dec 2006 01:02 
Pedro Algarvio, aka, s0undt3ch19 Dec 2006 01:12 
Pedro Algarvio, aka, s0undt3ch19 Dec 2006 01:14 
Shannon -jj Behrens19 Dec 2006 01:21 
Subject:Re: Recent i18n Pylons changes
From:Pedro Algarvio, aka, s0undt3ch (ufs-@public.gmane.org)
Date:12/19/2006 01:12:20 AM
List:com.googlegroups.pylons-discuss

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Shannon -jj Behrens wrote:

On 12/18/06, Pedro Algarvio, aka, s0undt3ch
<ufs-beLbHzoLccIdnm+yROf@public.gmane.org> wrote:

Shannon -jj Behrens wrote:

I'm currently working on the extraction from genshi with help from http://genshi.edgewall.org/wiki/GenshiRecipes/Localization, but the regex presented there is too narrow. So far I've succeeded on extending it a bit more, I can now also match: _("A string which " "will become " "\"too big\" to 'keep it' " "in just one line." )

Eh? What's wrong with triple quoted strings?

You did notice I was using genshi templates right?

Yep.

I can use use tripple quoting and it, of course(translations apart), works, but grabbing the string for translation inside a genshi template is not as easy as in a python file. Although I extended that regex it still does not work for tripple quoted strings :|

I'm still hoping that we can do this somewhat lazily and let Genshi parse the Genshi templates. :-/

-jj

I am letting genshi parse the templates, but, I have to find where I'm calling _() because genshi does not know nothing about gettext.

There is a recipe which will do all work of fetching and replacing everything inside usable strings and also html attributes(possibly configurable), for example grab text inside a <h1>The Text</h1> and such or for example <a href="blah" title="String to Fetch"/> etc, but that requires some modification regarding genshi's internals, ie pre-filters so we can include a filter which grabs the correct translation to be fed to genshi right before parsing and rendering the template.

Unfortunately I haven't managed to get that recipe to work for me :\

Perhaps we might just try and grab whatever is inside a _() call write that to a python temp file and run xgettext over that, dunno....

- -- Pedro Algarvio __ ___ ___ _______ ___ __ | Y .' _| _ .-----.' _| |_ .-----.----.-----. |. | | _| 1___| _ | _| _|__| _ | _| _ | |. | |__| |____ |_____|__| |____|__|_____|__| |___ | |: 1 | |: 1 | |_____| |::.. . | |::.. . | ufs [AT] ufsoft [DOT] org `-------' `-------' ufs [AT] sapo [DOT] pt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFFh60LniPxVTX2hA4RAv9qAJ9+mLfI0pQLe65mIww8+jxTa/MWkwCfa5Vh W4HngUiZ5/qamAlKxl1617s= =5c24 -----END PGP SIGNATURE-----