From: Marcus C. <ma...@br...> - 2007-06-16 19:18:38
|
... forgot to reply-all 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.potwill 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 |