From a7b66c6e2e2529d19771cfdbfc2f2768c8a85147 Mon Sep 17 00:00:00 2001 From: Frank Steinberg <steinberg@ibr.cs.tu-bs.de> Date: Thu, 3 Oct 2019 21:33:01 +0200 Subject: [PATCH] First attempts on actual translation. --- Makefile | 3 +- de/1.xml | 6 +- de/1A.xml | 14 +--- xsl/bjcp-2015-styleguide-translate.xsl | 102 +++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 06eb141..f53b3ff 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,11 @@ orig: bjcp-2015-styleguide-orig.xml xsl/bjcp-2015-styleguide-split.xsl if [ ! -d orig ] ; then mkdir orig ; fi xsltproc xsl/bjcp-2015-styleguide-split.xsl bjcp-2015-styleguide-orig.xml -bjcp-2015-styleguide-de.xml: orig xsl/bjcp-2015-styleguide-translate.xsl +bjcp-2015-styleguide-de.xml: orig de xsl/bjcp-2015-styleguide-translate.xsl xsltproc --stringparam lang de xsl/bjcp-2015-styleguide-translate.xsl bjcp-2015-styleguide-orig.xml > bjcp-2015-styleguide-de.xml clean: rm -rf cache orig rm -f bjcp-2015-styleguide-orig.xml + rm -f bjcp-2015-styleguide-de.xml diff --git a/de/1.xml b/de/1.xml index 3c42099..e6dcb1c 100644 --- a/de/1.xml +++ b/de/1.xml @@ -1,7 +1,9 @@ <?xml version="1.0"?> <styleguide> <category id="1"> - <name>Standard American Beer</name> - <description>This category describes everyday American beers that have a wide public appeal. Containing both ales and lagers, the beers of this category are not typically complex, and have smooth, accessible flavors. The ales tend to have lager-like qualities, or are designed to appeal to mass-market lager drinkers as crossover beers. Mass-market beers with a more international appeal or origin are described in the International Lager category.</description> + <name>Amerikanisches Standard-Bier</name> + <description> + <p>Diese Kategorie...</p> + </description> </category> </styleguide> diff --git a/de/1A.xml b/de/1A.xml index 3bec48e..26f4a44 100644 --- a/de/1A.xml +++ b/de/1A.xml @@ -2,17 +2,9 @@ <styleguide> <category id="1"> <subcategory id="1A"> - <name>American Light Lager</name> - <overall-impression>Highly carbonated, very light-bodied, nearly flavorless lager designed to be consumed very cold. Very refreshing and thirst quenching.</overall-impression> - <aroma>Low to no malt aroma, although it can be perceived as grainy, sweet, or corn-like if present. Hop aroma is light to none, with a spicy or floral hop character if present. While a clean fermentation character is desirable, a light amount of yeast character (particularly a light apple fruitiness) is not a fault. Light DMS is not a fault.</aroma> - <appearance>Very pale straw to pale yellow color. White, frothy head seldom persists. Very clear.</appearance> - <flavor>Relatively neutral palate with a crisp and dry finish and a low to very low grainy or corn-like flavor that might be perceived as sweetness due to the low bitterness. Hop flavor ranges from none to low levels, and can have a floral, spicy, or herbal quality (although rarely strong enough to detect). Low to very low hop bitterness. Balance may vary from slightly malty to slightly bitter, but is relatively close to even. High levels of carbonation may accentuate the crispness of the dry finish. Clean lager fermentation character.</flavor> - <mouthfeel>Very light (sometimes watery) body. Very highly carbonated with slight carbonic bite on the tongue.</mouthfeel> - <comments>Designed to appeal to as broad a range of the general public as possible. Strong flavors are a fault.</comments> - <history>Coors briefly made a light lager in the early 1940s. Modern versions were first produced by Rheingold in 1967 to appeal to diet-conscious drinkers, but only became popular starting in 1973 after Miller Brewing acquired the recipe and marketed the beer heavily to sports fans with the “tastes great, less filling” campaign. Beers of this genre became the largest sellers in the United States in the 1990s.</history> - <characteristic-ingredients>Two- or six-row barley with high percentage (up to 40%) of rice or corn as adjuncts. Additional enzymes can further lighten the body and lower carbohydrates.</characteristic-ingredients> - <style-comparison>A lighter-bodied, lower-alcohol, lower calorie version of an American Lager. Less hop character and bitterness than a Leichtbier.</style-comparison> - <commercial-examples>Bud Light, Coors Light, Keystone Light, Michelob Light, Miller Lite, Old Milwaukee Light</commercial-examples> + <name>Amerikanisches Light Lager</name> + <overall-impression>Stark karbonisiertes, sehr leichtes, ...</overall-impression> + <!-- ... hier in der Ãœbersetzung nicht erscheinende Elemente werden aus dem Original übernommen. --> </subcategory> </category> </styleguide> diff --git a/xsl/bjcp-2015-styleguide-translate.xsl b/xsl/bjcp-2015-styleguide-translate.xsl index 499b077..a41b612 100644 --- a/xsl/bjcp-2015-styleguide-translate.xsl +++ b/xsl/bjcp-2015-styleguide-translate.xsl @@ -26,6 +26,103 @@ + <xsl:template match="category"> + <xsl:variable name="d"> + <xsl:text>../</xsl:text> + <xsl:value-of select="$lang"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>.xml</xsl:text> + </xsl:variable> + <xsl:variable name="p"> + <xsl:text>document('</xsl:text> + <xsl:value-of select="$d"/> + <xsl:text>')/styleguide/category[@id='</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>']</xsl:text> + </xsl:variable> + <xsl:element name="{local-name(.)}"> + <xsl:apply-templates select="@*"/> + <xsl:apply-templates> + <xsl:with-param name="t" select="$p"/> + </xsl:apply-templates> + </xsl:element> + </xsl:template> + + + + <xsl:template match="category/subcategory"> + <xsl:variable name="d"> + <xsl:text>../</xsl:text> + <xsl:value-of select="$lang"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>.xml</xsl:text> + </xsl:variable> + <xsl:variable name="p"> + <xsl:text>document('</xsl:text> + <xsl:value-of select="$d"/> + <xsl:text>')/styleguide/category/subcategory[@id='</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>']</xsl:text> + </xsl:variable> + <xsl:element name="{local-name(.)}"> + <xsl:apply-templates select="@*"/> + <xsl:apply-templates> + <xsl:with-param name="t" select="$p"/> + </xsl:apply-templates> + </xsl:element> + </xsl:template> + + + + <xsl:template match="category/subcategory/subcategory"> + <xsl:variable name="d"> + <xsl:text>../</xsl:text> + <xsl:value-of select="$lang"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>.xml</xsl:text> + </xsl:variable> + <xsl:variable name="p"> + <xsl:text>document('</xsl:text> + <xsl:value-of select="$d"/> + <xsl:text>')/styleguide/category/subcategory/subcategory[@id='</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>']</xsl:text> + </xsl:variable> + <xsl:element name="{local-name(.)}"> + <xsl:apply-templates select="@*"/> + <xsl:apply-templates> + <xsl:with-param name="t" select="$p"/> + </xsl:apply-templates> + </xsl:element> + </xsl:template> + + + + <xsl:template match="name|description|overall-impression|aroma|appearance|flavor|mouthfeel|comments|history|characteristic-ingredients|style-comparison|entry-instructions|commercial-examples"> + <xsl:param name="t"/> + <xsl:variable name="p"> + <xsl:value-of select="$t"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="local-name(.)"/> + </xsl:variable> + <xsl:element name="{local-name(.)}"> + <xsl:apply-templates select="@*"/> + <xsl:choose> + <xsl:when test="dyn:evaluate($p)"> + <xsl:apply-templates select="dyn:evaluate($p)/* | dyn:evaluate($p)/text()"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:element> + </xsl:template> + + + <xsl:template match="@*"> <xsl:copy> <xsl:apply-templates select="@*"/> @@ -36,6 +133,10 @@ <xsl:template match="text()"> + <xsl:copy> + <xsl:apply-templates/> + </xsl:copy> +<!-- <xsl:variable name="d"> <xsl:value-of select="$lang"/> <xsl:text>/</xsl:text> @@ -52,6 +153,7 @@ </xsl:copy> </xsl:otherwise> </xsl:choose> +--> </xsl:template> -- GitLab