Bug 2462

Summary: Parametrize giella-core/scripts/xsl/generate_lex-fileVM.xsl with language-spec mods
Product: Infrastructure Reporter: Sjur Nørstebø Moshagen <sjur.n.moshagen>
Component: newinfraAssignee: Sjur Nørstebø Moshagen <sjur.n.moshagen>
Status: ASSIGNED ---    
Severity: enhancement CC: borre.gaup, chiara.argese, ciprian.gerstenberger, ftyers, rueter.jack
Priority: P4 - Within a month    
Version: unspecified   
Hardware: All   
OS: All   

Description Sjur Nørstebø Moshagen 2018-05-06 16:49:26 CEST
[Recreation of bug 2455 from Jan 9, which got lost in the disk crash around Jan 29. Newest backup data is from Jan 5, around 4 AM. Recreation based on bugzilla mails received by me. If there are more comments, please add to this bug by copying in text from old e-mails.]

Today, xml to lexc lexicon conversion uses the xsl script

giella-core/scripts/xsl/generate_lex-fileVM.xsl in the following way

1. It is the same script for all lgs
2. It picks the fin translation
3. It picks the whole translation

We want:

1. a makefile condition saying:
if the generate_lex-fileVM.xsl exists in $LANG/src/scripts, use that
if not, use the one in giella-core

2. For the local script to be made in mhr (and elsewhere ad lib), 
a. ask for eng, and not fin translations
b. if eng does not exist, ask for fin (i.e. have a fallback)
c. do not take the whole translation , but cut at the first "," or ";"
d. remove any content in parenthesis before this comma
Comment 1 Jack Rueter 2018-05-07 04:20:44 CEST
Number 3. should be >> picks the entire translation of the FIRST t element content by default

                  <xsl:choose>
                    <xsl:when test="../../../mg[1]/tg[@xml:lang='fin']/t[1]">
                      <xsl:value-of select="normalize-space(../../../mg[1]/tg[@xml:lang='fin']/t[1])"/>
                    </xsl:when>
Comment 2 Sjur Nørstebø Moshagen 2018-05-07 07:57:43 CEST
[Original comment on bug report from Jack Rueter on Jan 11]

(In reply to Trond Trosterud from comment #0)
> Today, xml to lexc lexicon conversion uses the xsl script
> 
> giella-core/scripts/xsl/generate_lex-fileVM.xsl in the following way
> 
> 2. It picks the fin translation
> 3. It picks the whole translation

CORRECTION to what the script does:
2. It picks the fin translation (tg) of the first mg element
3. It picks only the first t element content 

> 
> We want:
> 
> 1. a makefile condition saying:
> if the generate_lex-fileVM.xsl exists in $LANG/src/scripts, use that
> if not, use the one in giella-core
> 
> 2. For the local script to be made in mhr (and elsewhere ad lib), 
> a. ask for eng, and not fin translations
> b. if eng does not exist, ask for fin (i.e. have a fallback)
> c. do not take the whole translation , but cut at the first "," or ";"
> d. remove any content in parenthesis before this comma

It would be even BETTER if there were a possibility to select other languages,
too, i.e. someone might want to use fra or rus.