[gnomemm-website] Translate names of languages



commit 6fbc4dbbb8d58e0b5914b9e12063a96a5e5f71c5
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Feb 3 12:41:18 2022 +0100

    Translate names of languages
    
    Translate the name of each language to that language, e.g. Swedish to
    Svenska. Make those names non-translatable, i.e. they are shown in the
    same way whichever language has been selected. Fixes #3.
    
    Rename param.rng -> schema.rng; param.xsl -> style.xsl

 docs/C/index.docbook          | 25 +++++++++++++------------
 docs/Makefile.am              | 10 +++++-----
 docs/meson.build              |  4 ++--
 docs/param.rng                | 22 ----------------------
 docs/schema.rng               | 34 ++++++++++++++++++++++++++++++++++
 docs/{param.xsl => style.xsl} |  0
 6 files changed, 54 insertions(+), 41 deletions(-)
---
diff --git a/docs/C/index.docbook b/docs/C/index.docbook
index 6a3212c..9a4d8d6 100644
--- a/docs/C/index.docbook
+++ b/docs/C/index.docbook
@@ -61,40 +61,41 @@
         <title>Language</title>
         <para><itemizedlist>
             <listitem>
-              <para><link xlink:href="../pt_BR/index.html">Brazilian Portuguese</link></para>
+              <!-- Concerning its:translate="no", see 
https://gitlab.gnome.org/GNOME/gnomemm-website/-/issues/3 -->
+              <para><link its:translate="no" xlink:href="../cs/index.html">Čeština</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../cs/index.html">Czech</link></para>
+              <para><link its:translate="no" xlink:href="../de/index.html">Deutsch</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../de/index.html">Deutsch</link></para>
+              <para><link its:translate="no" xlink:href="../el/index.html">Ελληνικά</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../en/index.html">English</link></para>
+              <para><link its:translate="no" xlink:href="../en/index.html">English</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../es/index.html">Español</link></para>
+              <para><link its:translate="no" xlink:href="../es/index.html">Español</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../fr/index.html">French</link></para>
+              <para><link its:translate="no" xlink:href="../fr/index.html">Français</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../el/index.html">Greek</link></para>
+              <para><link its:translate="no" xlink:href="../hu/index.html">Magyar</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../hu/index.html">Hungarian</link></para>
+              <para><link its:translate="no" xlink:href="../ko/index.html">한국어</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../ko/index.html">Korean</link></para>
+              <para><link its:translate="no" xlink:href="../pt_BR/index.html">Português 
(Brasil)</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../sl/index.html">Slovenian</link></para>
+              <para><link its:translate="no" xlink:href="../sl/index.html">Slovenščina</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../sv/index.html">Swedish</link></para>
+              <para><link its:translate="no" xlink:href="../sv/index.html">Svenska</link></para>
             </listitem>
             <listitem>
-              <para><link xlink:href="../zh_CN/index.html">中文</link></para>
+              <para><link its:translate="no" xlink:href="../zh_CN/index.html">中文</link></para>
             </listitem>
           </itemizedlist></para>
       </formalpara>
diff --git a/docs/Makefile.am b/docs/Makefile.am
index be69c55..104d89e 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -56,8 +56,8 @@ dist_noinst_DATA =            \
        $(tutorial_po_files)    \
        $(tutorial_xml_files)   \
        $(tutorial_html_files) \
-       param.rng \
-       param.xsl
+       schema.rng \
+       style.xsl
 
 dist_tutorial_figures_DATA = $(addprefix C/,$(HELP_MEDIA))
 
@@ -72,7 +72,7 @@ $(website_indexes): html/%/index.html:$(addprefix %/,$(HELP_FILES))
   lang=$(subst html/,,$(subst /index.html,,$@))
        $(AM_V_at)rm -rf html/$(lang)
        $(AM_V_at)$(MKDIR_P) html/$(lang)
-       $(AM_V_GEN)$(XSLTPROC) -o html/$(lang)/ --xinclude $(srcdir)/param.xsl 
$(builddir)/$(lang)/$(help_index_file)
+       $(AM_V_GEN)$(XSLTPROC) -o html/$(lang)/ --xinclude $(srcdir)/style.xsl 
$(builddir)/$(lang)/$(help_index_file)
        $(AM_V_at)rm -f html/$(lang)/root.html
 
 # Create a html generation of the C locale's version of the DocBook,
@@ -80,10 +80,10 @@ $(website_indexes): html/%/index.html:$(addprefix %/,$(HELP_FILES))
 html/en/index.html: $(addprefix $(srcdir)/C/,$(HELP_FILES))
        $(AM_V_at)rm -fr html/en
        $(AM_V_at)$(MKDIR_P) html/en
-       $(AM_V_GEN)$(XSLTPROC) -o html/en/ --xinclude $(srcdir)/param.xsl $(srcdir)/C/$(help_index_file)
+       $(AM_V_GEN)$(XSLTPROC) -o html/en/ --xinclude $(srcdir)/style.xsl $(srcdir)/C/$(help_index_file)
        
 validate: $(addprefix $(srcdir)/C/,$(HELP_FILES))
-       $(XMLLINT) --xinclude --noout --relaxng $(srcdir)/param.rng $<
+       $(XMLLINT) --xinclude --noout --relaxng $(srcdir)/schema.rng $<
 
 
 .PHONY: install-tutorial uninstall-tutorial
diff --git a/docs/meson.build b/docs/meson.build
index 991dd7f..ae6899c 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -11,8 +11,8 @@ can_parse_and_validate = xmllint.found()
 validate = get_option('validation') ? 'true' : 'false'
 allow_network_access = get_option('allow-network-access') ? 'true' : 'false'
 
-relax_ng_schema_file = meson.current_source_dir() / 'param.rng'
-stylesheet_file = meson.current_source_dir() / 'param.xsl'
+relax_ng_schema_file = meson.current_source_dir() / 'schema.rng'
+stylesheet_file = meson.current_source_dir() / 'style.xsl'
 
 # Check if xmllint can be used.
 if xmllint.found()
diff --git a/docs/schema.rng b/docs/schema.rng
new file mode 100644
index 0000000..3606e6d
--- /dev/null
+++ b/docs/schema.rng
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns:db="http://docbook.org/ns/docbook";
+         ns="http://docbook.org/ns/docbook";
+         xmlns="http://relaxng.org/ns/structure/1.0";
+         xmlns:its="http://www.w3.org/2005/11/its";>
+
+  <!-- See https://docbook.org/docs/howto/howto.html#customizations -->
+  <include href="http://docbook.org/xml/5.0/rng/docbook.rng"/>
+
+  <!-- Allow an its:translate="yes" or its:translate="no" attribute
+       on <imagedata> and <link> elements. -->
+  <define name="dbx.its.translate.attribute">
+    <attribute name="its:translate">
+      <choice>
+        <value>yes</value>
+        <value>no</value>
+      </choice>
+    </attribute>
+  </define>
+  <define name="db.imagedata.attlist" combine="interleave">
+    <interleave>
+      <optional>
+        <ref name="dbx.its.translate.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="db.link.attlist" combine="interleave">
+    <interleave>
+      <optional>
+        <ref name="dbx.its.translate.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+</grammar>
diff --git a/docs/param.xsl b/docs/style.xsl
similarity index 100%
rename from docs/param.xsl
rename to docs/style.xsl


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]