1. Create “po_rosetta” folder and put your Rosetta PO file there (ooo2_kurdish.po single file)

$ mkdir po_rosetta

2. Run rosetta2translate to split rosetta files.

$ ./rosetta2translate

It took ~9 mins on my laptop to convert. File IO operation is notoptimized (quick and dirty).

3. “po_translate” folder now contains normal PO files used by translate tool, but without PO headers.

4. Run addheader.sh to add header.po to all resulted PO files (only once!)

$ ./addheader.sh

5. Download en-US.sdf. AFAIK Rosetta uses SRC680_m129 for the current translation which is not up to date. You can find latest version at

ftp://ftp.linux.cz/pub/localization/OpenOffice.org/devel/POT/

SRC680_m129 is here

ftp://ftp.linux.cz/pub/localization/OpenOffice.org/devel/POT/2.0/OpenOffice.org-SRC680_m129-POT.tar.gz

You need just en-US.sdf file.

6. Run po2oo against choosen en-US.sdf file (maybe against SRC680_m129 and latest to see which is better)

$ po2oo --language=ku --template=en-US.sdf --input=po_translate --nonrecursiveoutput --output=ku.sdf

7. Use ku.sdf for OpenOffice.org building.

Rail Aliev <rail at openoffice.org>

rosetta2translate

 
#!/usr/bin/perl -w
 
use strict;
 
my $indir = "po_rosetta"; #your po files from Rosetta
my $outdir = "po_translate";
 
 
opendir(DIR, $indir) || die("cannot read dir $indir: $!\n");
my @infiles = grep { /\.po/ && -f "$indir/$_" } readdir(DIR);
 
for ( my $i = 0; $i < @infiles; $i++ ) {
	print "file: $infiles[$i]\n";
	open (IN, "$indir/$infiles[$i]") || die ("cannot open file: $infiles[$i]: $!\n");
	my $file = '';
	
	while ( my $line = <IN> ){
		
		if ( $line =~ m/^#:/ ){
			my (undef, $current_file) = split /#/, $line;
			$current_file =~ s/^:\s//;
			$current_file = `dirname $current_file`;
			chomp( $current_file );
			my $rest = "#: " . substr( $line, length ( "#: $current_file/" ) );
			my $dir = $outdir . "/" . `dirname $current_file`;
			$file = "$outdir/$current_file.po";
			print "$file\n";
			system("mkdir -p $dir");
			open(OUT, ">>$file") || die("cannot write to $file: $!\n");
			print OUT $rest;
			close(OUT);
		} else {
			if ( $file ){
				my $dir = `dirname $file`;
				system( "mkdir -p $dir" );
				open(OUT, ">>$file") || die("cannot write to $file: $!\n");
				print OUT $line;
				close(OUT);
			} else {
				#ignore
			}
		}
 
	}
	close( IN );
}
 
wergerandin/rail_aliev.txt · Guherandina dawî: 2006/03/11 01:20 by erdalronahi
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki