[html-formfu] *_loc: extraction

Carl Franks fireartist at gmail.com
Tue Feb 12 11:55:54 GMT 2008


On 12/02/2008, Andreas Marienborg <omega at palle.net> wrote:
>
> On Feb 12, 2008, at 11:05 AM, Andreas Marienborg wrote:
>
> > I use xgettext.pl to extract my .po-files from .pm, .js and .tt. I
> > would also like to extract .yml (forms).
> >
> > Has anyone else already done that? If not, I'll try to cook up a patch
>
> I like talking to myself:
>
> http://rt.cpan.org/Ticket/Display.html?id=33166

Without knowing anything about Locale-Maketext-Lexicon... would it
support some way of using YAML(::Syck)? to read the file, and then
traversing the data structure? - as it'd be a lot more robust than
using a regex

For example, how would it handle single- or double-quoted strings?
    label_loc: 'foo bar'
    label_loc: "foo o'reilly"
Or the really funky stuff:
    label_loc: |
      string with
      embedded newline

Anyway, to be honest, I find the whole lexicon approach a bit backwards.
As far as I can see, it means if you need to change a string in the
'native' language that you've used as a ke, it means you need to go
through all the other language files, and change the corresponding
key/string.
That's why I prefer using a made-up string as the key, such as
'constraint_required' - it says what it is, not what it says (um,
yeah, I think that's right)

Carl



More information about the HTML-FormFu mailing list