Re: Translation problems
Brought to you by:
iridium
|
From: Ondrej J. <ne...@po...> - 2002-05-22 11:43:22
|
Pauli, 13:39:20
22. maj 2002 (streda)
Greetings.
> > function print_pretty_wind($wind)
> > {
> > extract($wind);
> >
> > if (! empty($meters_per_second)) {
> > if ($meters_per_second - floor($meters_per_second) > 0) {
> > $this->strings['meters_per_second'] = ' metra za sekundu';
> > }
> > elseif ($meters_per_second == 1) {
> > $this->strings['meters_per_second'] = ' meter za sekundu';
> > }
> The windspeed doesn't have to be a whole number of meters per hour:
> it's converted from a whole number of knots into meters/second and
> miles/hour so it will not be a whole number after the conversion.
Numbers which are not whole are handled in first 'if' case.
> > elseif ($meters_per_second == 2
> > || $meters_per_second == 3
> > || $meters_per_second == 4) {
> > $this->strings['meters_per_second'] = ' metre za sekundu';
> > }
> What if the windspeed is more than 4 meters per second? Don't you miss
> that case?
No, I don't. In that case default string
($this->strings['meters_per_second']) will be used.
> > return parent::print_pretty_wind($wind);
> Ahh - very clever! :-) At first I didn't understand what you were trying
> to do, but now I see it - pretty cool. There should probably be a little
> comment that explains it to others...
My goal was to avoid counting logic in pw_text_sk. This way I can
only change strings accoding to Slovak grammar convetions and at the end
call original method. If there is no problem with this, I will use this way
also in others parts.
=Nepto=
____________________________________________________________________________
Ondrej 'Nepto' Jombik, Perl CGI developer #!/usr/bin/perl -w
|