From: Jon P. <jo...@cr...> - 2007-06-20 20:28:15
|
On Wed, 2007-06-20 at 11:55 -0700, Jon Phillips wrote: > On Wed, 2007-06-20 at 17:56 +0800, Snic Huang wrote: > > Very Cool! :) > > > > I have understood. > > > > I add my file to POTFILES, then I run "make". > > > > Thank Jon and Marcus! > > > > Snic > > Yes! The one thing though is that if you have custom pages, which are > not in the codebase, maybe would be good to look for a POTFILES.local > when running make, so that this file is not part of SVN, but can be used > by others to make customizations... > > Jon That was supposed to be a question. Jon > > 2007/6/20, Jon Phillips <jo...@re...>: > > You just wrap any strings as marcus outlined with _('your > > string') note, this has to be a string and not variable. > > > > After you added, then you can do as marcus says. > > > > The makefile is how i simplified the process. All you have to > > type from unix/linux comandline is run: > > > > Make > > > > From the cchost dir. > > > > Cool? > > > > Jon > > > > -----Original Message----- > > From: Snic Huang <jms...@gm...> > > Sent: Saturday, June 16, 2007 2:54 PM > > To: Marcus Clements <ma...@in...>; Jon Phillips > > <jo...@re...> > > Cc: cct...@li... > > Subject: Re: [Cctools-cchost] about the cchost.pot file > > > > Marcus, thank you for sending me these useful information! > > Nice to meet you! > > :) > > > > But I think that I have committed php code on svn, should I > > add strings of > > these php code in cchost.pot? > > > > Thank you again! > > > > All the best, > > Snic > > > > 2007/6/16, Marcus Clements <ma...@in...>: > > > > > > Hi Snic, > > > > > > The easiest way to add a string is to edit in a text editor. > > Each string > > > may include an optional comment hinting where in the > > codebase it is located. > > > An example from our pot. > > > > > > #: cclib/cc-upload.php:71 > > > msgid "Changes saved to '%s'. Click %shere%s to see > > results" > > > > > > The problem with this approach is that when you update the > > site, > > > cchost.pot will be updated and your string will be lost. > > > If your string is in custom php code ( wrapped with a > > gettext call like > > > _() ), then you could add your file to POTFILES (in the root > > of your > > > installation) and run bin/update_pot_file.sh which will scan > > through all the > > > files in POTFILES and generate the pot file which should > > contain your > > > string. > > > If your string is in config because you added it using the > > admin > > > interface, then you will need to use the the language terms > > editor to add > > > the config string to your PO file for each langauge. I've > > been fiddling with > > > the terms editor, it's not in svn. If you want some code to > > join in the fun > > > let me know. > > > If your string is in a PHPTAL template then there's a script > > - > > > cc-host-gettext-from-templates.php , I wrote small module to > > call this from > > > cchost which generates a file called template_strings.php in > > the root. I > > > added this to POTFILES to get the strings into the pot. Let > > me know if you > > > want this stuff too. > > > > > > I guess if you're editing your cchost.pot then you have > > found out that > > > bin/update_po_files.sh creates the pot and then updates all > > the PO files. Be > > > careful with this I think there's a bug in the merging but I > > can't remember > > > the details - *keep backups*! > > > > > > Adding a new langauge is quite a confusing process and I'm > > working on > > > streamlining so that the terms editor can manage it all but > > currently it has > > > to be done by hand: > > > > > > 3. Login as admin > > > 4. Run the terms editor > > {mycchost}/{myvirtualroot}/admin/terms > > > 5. Create (or Edit) your chosen language > > > 6. Save the PO file > > > 7. Run the template strings finder > > > {mycchost}/{myvirtualroot}/admin/getStrings > > > 8. Edit your POTFILES to include your custom code and > > template_strings.php > > > (I also removed a lot of irrelevant code for my site so that > > langauge > > > editors didn't have to plough through giant PO files). > > > 9. Extract strings from the code using > > bin/update_po_files.sh and your > > > edited POTFILES > > > 10. Create the MO file by opening in POedit and saving or > > command line > > > gettext tools. > > > 11. Upload the PO file and MO file of the language you're > > working on to > > > the server. > > > 12. ?update=1 > > > > > > I think I may have gone too far and I've missed the point of > > your > > > question. It's useful stuff for someone though maybe :) > > > > > > cheers > > > > > > Marcus > > > > > > > > > On 16/06/07, Snic Huang < jms...@gm...> wrote: > > > > > > > Hi Jon, how do I to add msgid in the cchost.pot file? Can > > I direct edit > > > > this file? Because of the quota function, I will add > > corresponding msgid. > > > > Then I will commit it. Are there something that I have to > > note? > > > > > > > > Thanks! :) > > > > Snic > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by DB2 Express > > > > Download DB2 Express C - the FREE version of DB2 express > > and take > > > > control of your XML. No limits. Just data. Click to get it > > now. > > > > http://sourceforge.net/powerbar/db2/ > > > > _______________________________________________ > > > > Cctools-cchost mailing list > > > > Cct...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/cctools-cchost > > > > > > > > > > > > > > > > > -- > > > Marcus Clements > > > > > > www.brightonart.org > > > www.rocketfestival.com > > > www.innerfield.co.uk > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ Cctools-cchost mailing list Cct...@li... https://lists.sourceforge.net/lists/listinfo/cctools-cchost -- Jon Phillips jo...@cr... cell: 510.499.0894 Community/Business Developer Creative Commons www.creativecommons.org |