summaryrefslogtreecommitdiff
path: root/help3xsl
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2017-09-12 14:48:18 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2017-09-13 01:58:57 +0200
commit42fbc7890755b7f6322be2fc2c7bc934d3c07b1e (patch)
treef3a872b5eb4914b96eaa26a341cd8396eed5916a /help3xsl
parent6005c5c31ca8e9f9107c5c0e35858d27e4a55490 (diff)
TDF#97745 Add support custom search in helponline
Added some language support for the helponline global search Each custom search engine of google has a unique token, which configuration is handled by CSE owner. The CSE attempt to seach in helponline in the page language. If a page is already indexed, it shows what it has. If not, pages indexed from the *.libreoffice.org domain and wiki.tdf.org are shown. The CSE prevents display of indexed pages of other suites. Change-Id: I133e1a7af867c2380ccb1f20c483af63337a58b9 Reviewed-on: https://gerrit.libreoffice.org/42218 Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org> Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rw-r--r--help3xsl/localized.xsl12
-rw-r--r--help3xsl/online_transform.xsl59
2 files changed, 34 insertions, 37 deletions
diff --git a/help3xsl/localized.xsl b/help3xsl/localized.xsl
index e44fa016cf..999ca2d3ee 100644
--- a/help3xsl/localized.xsl
+++ b/help3xsl/localized.xsl
@@ -159,10 +159,14 @@ Stylesheet map language-dependent parameters and translation
<xsl:template name="getToken">
<xsl:param name="lang"/>
<xsl:choose>
- <xsl:when test="$lang='en-US'"><xsl:text>123456</xsl:text></xsl:when>
- <xsl:when test="$lang='fr'"><xsl:text>123456</xsl:text></xsl:when>
- <xsl:when test="$lang='pt-BR'"><xsl:text>123456</xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>1234567890</xsl:text></xsl:otherwise>
+ <xsl:when test="$lang='en-US'"><xsl:text>var cx = '010161382024564278136:stzujqtpnve';</xsl:text></xsl:when>
+ <xsl:when test="$lang='es'"><xsl:text>var cx = '010161382024564278136:cdcn_oz4txg';</xsl:text></xsl:when>
+ <xsl:when test="$lang='fr'"><xsl:text>var cx = '010161382024564278136:mimp7dbi-eq';</xsl:text></xsl:when>
+ <xsl:when test="$lang='it'"><xsl:text>var cx = '010161382024564278136:xdxa9y906g0';</xsl:text></xsl:when>
+ <xsl:when test="$lang='ja'"><xsl:text>var cx = '010161382024564278136:7wxg-zakzmu';</xsl:text></xsl:when>
+ <xsl:when test="$lang='pt'"><xsl:text>var cx = '010161382024564278136:1x2uk8j-rbw';</xsl:text></xsl:when>
+ <xsl:when test="$lang='pt-BR'"><xsl:text>var cx = '010161382024564278136:1x2uk8j-rbw';</xsl:text></xsl:when>
+ <xsl:otherwise><xsl:text>var cx = '010161382024564278136:stzujqtpnve';</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:template>
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index eebaced568..f3ddebee4a 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -238,8 +238,9 @@
<div id="content-2">
<script type="text/javascript">
<![CDATA[
- (function() {
- var cx = '010161382024564278136:oejldkqc20o';
+ (function() {]]>
+ <xsl:call-template name="getToken"><xsl:with-param name="lang" select="$lang"/></xsl:call-template>
+ <![CDATA[
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
@@ -611,41 +612,33 @@
</xsl:choose>
</xsl:template>
-
<!-- SECTION -->
<xsl:template match="section">
- <a name="{@id}"></a>
-
- <xsl:choose>
-
- <xsl:when test="@id='relatedtopics'">
- <div class="relatedtopics">
- <!--<xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>-->
- <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp')"/></xsl:variable>
- <xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable>
- <xsl:variable name="doc" select="document($href)"/>
- <p class="related" itemprop="mentions">
- <xsl:apply-templates select="$doc//variable[@id=$anchor]"/>
- </p>
- <div class="relatedbody" itemprop="mentions">
- <xsl:apply-templates />
- </div>
- </div>
- </xsl:when>
-
- <xsl:when test="@id='howtoget'">
- <xsl:call-template name="insert_howtoget" />
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
-
- </xsl:choose>
-
+ <a name="{@id}"></a>
+ <xsl:choose>
+ <xsl:when test="@id='relatedtopics'">
+ <div class="relatedtopics">
+ <!--<xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>-->
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp')"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <p class="related" itemprop="mentions">
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]"/>
+ </p>
+ <div class="relatedbody" itemprop="mentions">
+ <xsl:apply-templates />
+ </div>
+ </div>
+ </xsl:when>
+ <xsl:when test="@id='howtoget'">
+ <xsl:call-template name="insert_howtoget" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
<!-- SECTION -->
<xsl:template match="section" mode="embedded">
<a name="{@id}"></a>