Re: [Rhythmbox-devel] My Rhythmbox Hacking ToDo



Le vendredi 25 mars 2005 à 15:31 +0600, Haran Shivanan a écrit : 
> On Fri, 2005-03-25 at 09:49 +0100, Gabriel de Perthuis wrote:
> > > 
> > I think you write a .lex, compile it into a C source, add a N_() around
> > AND, OR, by... keywords to internationalise them, and use it as your
> > lexer. Then use yacc with the language independent result. Maybe you can
> > directly use N_() in the .lex .
> > To print it, you use N_() again.
> Is it really necessary to have the language constructs
> internationalized? 
> (For one thing, it makes sharing scripts difficult.)
What do you mean, sharing scripts?
The internal db format is already locale independent, so playlists can
be shared. eg:
    <conjunction>
      <equals prop="type">0</equals>
      <subquery>
        <conjunction>
          <like prop="title-folded">love</like>
        </conjunction>
      </subquery>
    </conjunction>

However, the generated parser will be in different versions I think,
which flex can load dynamically. The alternative is to parse until word
level and do string comparisons to find if there is a keyword. I've
written a parser with the first solution, but I don't really have a
preference.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]