Re: Finding unused hdf data

Brandon Long <[email protected]> Mon, 13 Apr 2009 20:49:52 -0700
Newsgroups gmane.text.clearsilver.general
Organization Fiction L Networks
Message-ID <20090414034952.GB21726@bl1>
The trans.py script is more of an example.  We wrote a much better
version at work, I wanted it to be open-sourceable, but I think it ended
up being much too tied to our translation sub-systems.

In general, trans.py is very naive, treating each "piece" as separate,
which means that:

   There are <?cs var:count ?> items.

would generate two strings, "There are" and "items", which isn't what
you want.  Even more, you may have something like:

There are <?cs if:count == 0?>no<?cs else ?><?cs var:count ?><?cs /if ?>
item<?cs if:count != 1 ?>s<?cs /if ?>

Which, you actually want to have like:

<?cs if:count == 0 ?>There are no items.
<?cs if:count == 1 ?>There is one item.
<?cs else ?>There is <?cs var:count ?>items.<?cs /if ?>

There are more complicated, less obvious examples, so we actually have our
system rewrite the CS to pull out conditionals to block levels, so we
have as large of phrases as possible, then include "placeholders" in the
translation strings for variables, so we can then put the variables back
in the generated form.  It ends up being a bit complicated, but works
well once you get the kinks out.

Brandon

On 04/13/09 Culley Harrelson uttered the following other thing:
> No I rely completely on the hdf datasets.  Different hdf datasets are loaded
> for different languages.  I can't remember why I didn't use the trans.py
> script but I probably had some problem...  
> 
> culley
> 
> On Mon, 13 Apr 2009, Nikolai Kondrashov wrote:
> 
> > Culley Harrelson wrote:
> > > My efforts are mostly to make translation more efficient.  So, say I had a
> > > hdf file with this item:
> > > 
> > > Strings.hello [Lang] = hello world!
> > > 
> > > Once upon a time this was used by a cs file but the page was redesigned and
> > > it is no longer used anywhere.  I want to get these old items out of the
> > > system so people aren't translating them.
> > Have you tried using GNU gettext for i18n? It really simplifies the task.
> > We are using it both for translating datasets and templates, not to say about the sources.
> > 
> > It also has better translator tools available.
> > 
> > Sincerely,
> > Nick
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
-- 
  "In the political sphere, long-range bombing has proven an effective
      means of resolving marital-infidelity disputes." -- The Onion 35.3
                                           http://www.fiction.net/blong/