Difference between revisions of "KeyID Build"

From Apache OpenOffice Wiki
Jump to: navigation, search
(8 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
[[ko:KO/KeyID_Build]]
 +
 
A KeyID build is a special build used mainly for translation-related QA work on localized builds. It helps to identify UI (User Interface) and OLH (Online Help) strings based on their KeyID. A KeyID is a unique 6-digits number that serves as identifier of the string in the Sun's translation database.
 
A KeyID build is a special build used mainly for translation-related QA work on localized builds. It helps to identify UI (User Interface) and OLH (Online Help) strings based on their KeyID. A KeyID is a unique 6-digits number that serves as identifier of the string in the Sun's translation database.
  
[[image:Regular_build_menu.png|left|thumb|250px|[[Media:Regular_build_menu.png|Regular build menu - see full size]]]]
+
There is no functional difference between a regular build and a KeyID build. The difference between the two is that the KeyID build displays the KeyIDs of the strings in the UI and OLH. KeyID builds are regular provided for all Sun provided languages each release. See the announcements in the dev@l10n mailing list.
[[image:Keyid_build_menu.png|left|thumb|303px|[[Media:Keyid_build_menu.png|KeyID build menu - see full size]]]]
+
 
+
There is no functional difference between a regular build and a KeyID build. The difference between the two is that the KeyID build displays the KeyIDs of the strings in the UI and OLH. KeyID builds are regulary provided for all Sun provided languages each release. See the announcements in the dev@l10n mailing list.
+
  
 
See the illustrating screenshots taken on a French regular and KeyID build:
 
See the illustrating screenshots taken on a French regular and KeyID build:
  
 
+
[[image:Regular_build_menu.png|none|thumb|250px|[[Media:Regular_build_menu.png|Regular build menu - see full size]]]] [[image:Keyid_build_menu.png|none|thumb|303px|[[Media:Keyid_build_menu.png|KeyID build menu - see full size]]]]
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
  
 
== Where to find en-US sdf files ? ==
 
== Where to find en-US sdf files ? ==
Line 35: Line 15:
 
For example:
 
For example:
 
http://ftp.rz.tu-bs.de/pub/mirror/OpenOffice.org/extended/ooomisc/sdf/
 
http://ftp.rz.tu-bs.de/pub/mirror/OpenOffice.org/extended/ooomisc/sdf/
[[Category:Localisation]]
 
 
 
  
 
== Making your own KeyID build ==
 
== Making your own KeyID build ==
here is a script proposal which can be used to add KeyIDs of a new kind to an existing sdf file.
+
There is a script which can be used to add KeyIDs of a new kind to an existing sdf file.
*NOTE* these KeyIDs are different from those in the database but might well get standard soon.
+
{{Note| These KeyIDs are different from those in the database but might well get standard soon.}}
*NOTE* gsicheck should be used with -k key to prevent errors regarding KeyIDs
+
{{Note| You should use gsicheck before adding KeyIDs. If you have to gsicheck a file with keyIDs, use the -k key to prevent errors regarding KeyIDs.}}
 
+
The script is located in the Sources in module transex3 in the Path scripts\keyidGen.pl
<pre>
+
Call it without parameters for usage help.
:
+
eval 'exec perl -S $0 ${1+"$@"}'
+
    if 0;
+
#*************************************************************************
+
#
+
#  OpenOffice.org - a multi-platform office productivity suite
+
#
+
#  $RCSfile: ,v $
+
#
+
#  $Revision:  $
+
#
+
#  last change: $Author:  $ $Date:  $
+
#
+
The Contents of this file are made available subject to
+
#  the terms of GNU Lesser General Public License Version 2.1.
+
#
+
#
+
#    GNU Lesser General Public License Version 2.1
+
#    =============================================
+
#    Copyright 2007 by Sun Microsystems, Inc.
+
#    901 San Antonio Road, Palo Alto, CA 94303, USA
+
#
+
#    This library is free software; you can redistribute it and/or
+
#    modify it under the terms of the GNU Lesser General Public
+
#    License version 2.1, as published by the Free Software Foundation.
+
#
+
#    This library is distributed in the hope that it will be useful,
+
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+
#    Lesser General Public License for more details.
+
#
+
#    You should have received a copy of the GNU Lesser General Public
+
#    License along with this library; if not, write to the Free Software
+
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+
#    MA  02111-1307  USA
+
#
+
#*************************************************************************
+
#
+
# add keyids to sdf file
+
#
+
 
+
 
+
use Digest;
+
 
+
$infile = shift;
+
print_help() if ( !defined $infile );
+
exit 1 if ( !defined $infile );
+
$outfile = $infile;
+
$outfile =~ s/\.sdf$//i;
+
$outfile .= "_KeyID.sdf";
+
print "writing to $outfile\n";
+
 
+
$hashfunc = Digest->new("CRC-32");
+
$colisions = 0;
+
%hashcodes = ();
+
$count = 0;
+
open INFILE,"<$infile" || die "coudl not open $infile $! $^E\n";
+
open OUTFILE,">$outfile" || die "coudl not open $outfile $! $^E\n";
+
 
+
while ( <INFILE> )
+
{
+
    $line = $_;
+
    $hash = 0;
+
    if ( $line =~ /^([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)/ )
+
    {
+
        $string="$1 $2 $4 $5 $6 $7 $8";
+
        $hashfunc->reset();
+
        $hashfunc->add($string);
+
        $hash = $hashfunc->digest();
+
        $hashp = makenumber( $hash );
+
 
+
        if ( defined ($hashcodes{ $hashp } ) )
+
        {
+
            $colisions ++;
+
        }
+
        $hashcodes{ $hashp } = $line;
+
        $count++;
+
        print OUTFILE "$1\t$2\t$3\t$4\t$5\t$6\t$7\t$8\t$9\t$10\t".makekidstr($hashp,$11)."\t".makekidstr($hashp,$12)."\t$13\t".makekidstr($hashp,$14)."\t$15\n";
+
    }
+
}
+
print "$count entries\n";
+
print "$colisions colisions\n";
+
  
close INFILE;
+
== KeyID builds and HelpIDs ==
close OUTFILE;
+
  
sub makenumber
+
''This section is updated for OpenOffice 3.4.1 and 4.x''
{
+
    $h = shift;
+
    #                  1        2        3         4
+
    #        1234567890123456789012345678901234567890
+
    $symbols="0123456789abcdefghijklmnopqrstuvwxyz+-<=>";
+
    $order = length($symbols);
+
    $result = "";
+
    while ( $h > 0 )
+
    {
+
        $result .= substr( $symbols, ($h % $order), 1 );
+
        $h = int( $h / $order );
+
    }
+
   
+
    return reverse $result;
+
}
+
  
 +
To create a KeyId build, simply configure with <code>--with-lang='kid'</code>
  
sub makekidstr
+
You may also find HelpIDs useful.
{
+
This doesn't require a special build, simply enable extended tips (Tools - Options... - OOo - General - Help - Tips - Extended Tips), and set this environment variable (on Linux, add it to your <code>~/.bashrc</code> or export it in the same terminal, before executing AOO - from this very same terminal; on Windows, execute <code>cmd.exe</code>, set the variable on the command prompt, set <code>HELP_DEBUG=1</code>, and execute AOO within that command prompt - using the full path to <code>soffice.exe</code>).
    $kid = shift;
+
    $str = shift;
+
   
+
    if ( $str )
+
    {
+
        return "$kid.$str";
+
    }
+
    else
+
    {
+
        return "";
+
    }
+
    return "default";
+
}
+
  
sub print_help
+
Screenshots (HelpIDs and KeyIDs):
{
+
    print "\n\n";
+
    print "keyidGen 0.1 for sdf files\n";
+
    print "--------------------------\n";
+
    print "Usage:\n";
+
    print "keyidGen <infile>\n";
+
    print "                  add keyids to the entries and write them to a file with\n";
+
    print "                  _KeyID added to the name\n";
+
    print "\n\n";
+
}
+
</pre>
+
  
 +
[[image:HelpIDs-ariel.png|none|thumb|250px|[[Media:HelpIDs-ariel.png|HelpIDs - see full size]]]]
 +
[[image:KIDs-ariel.png|none|thumb|303px|[[Media:KIDs-ariel.png|KeyIDs - see full size]]]]
  
 
[[Category:Localization]]
 
[[Category:Localization]]
 
[[Category:Quality Assurance]]
 
[[Category:Quality Assurance]]
 +
[[Category:Build_System]]

Revision as of 20:29, 1 July 2018


A KeyID build is a special build used mainly for translation-related QA work on localized builds. It helps to identify UI (User Interface) and OLH (Online Help) strings based on their KeyID. A KeyID is a unique 6-digits number that serves as identifier of the string in the Sun's translation database.

There is no functional difference between a regular build and a KeyID build. The difference between the two is that the KeyID build displays the KeyIDs of the strings in the UI and OLH. KeyID builds are regular provided for all Sun provided languages each release. See the announcements in the dev@l10n mailing list.

See the illustrating screenshots taken on a French regular and KeyID build:

Where to find en-US sdf files ?

For every milestone en-US sdf files are created. You can download them from one of the mirrors in: http://distribution.openoffice.org/mirrors/#extmirrors

For example: http://ftp.rz.tu-bs.de/pub/mirror/OpenOffice.org/extended/ooomisc/sdf/

Making your own KeyID build

There is a script which can be used to add KeyIDs of a new kind to an existing sdf file.

Documentation note.png These KeyIDs are different from those in the database but might well get standard soon.
Documentation note.png You should use gsicheck before adding KeyIDs. If you have to gsicheck a file with keyIDs, use the -k key to prevent errors regarding KeyIDs.

The script is located in the Sources in module transex3 in the Path scripts\keyidGen.pl Call it without parameters for usage help.

KeyID builds and HelpIDs

This section is updated for OpenOffice 3.4.1 and 4.x

To create a KeyId build, simply configure with --with-lang='kid'

You may also find HelpIDs useful. This doesn't require a special build, simply enable extended tips (Tools - Options... - OOo - General - Help - Tips - Extended Tips), and set this environment variable (on Linux, add it to your ~/.bashrc or export it in the same terminal, before executing AOO - from this very same terminal; on Windows, execute cmd.exe, set the variable on the command prompt, set HELP_DEBUG=1, and execute AOO within that command prompt - using the full path to soffice.exe).

Screenshots (HelpIDs and KeyIDs):

Personal tools
In other languages