Skip to content

Commit

Permalink
Merge pull request #213 from ndw/l10n
Browse files Browse the repository at this point in the history
Rework localization and a number of other backwards-incompatible changes
  • Loading branch information
ndw authored Dec 30, 2022
2 parents 20e5eba + 7f8d3db commit 425fbd4
Show file tree
Hide file tree
Showing 438 changed files with 65,393 additions and 136,665 deletions.
43 changes: 19 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,7 @@ task validateAll() {
// Just something to hang dependencies on
}

task generateXslTNGLocales() {
// Just something to hang dependencies on
}

task generateLocales(dependsOn: ['generateXslTNGLocales']) {
task generateLocales() {
// Just something to hang dependencies on
}

Expand Down Expand Up @@ -1057,34 +1053,32 @@ testDrivers.each { driver ->
// ============================================================

// Generate tasks to generate the locale files
fileTree(dir: "${projectDir}/src/main/locales/locale-10", include: "*.xml").each { xml ->
fileTree(dir: "${projectDir}/src/main/locale", include: "*.xml").each { xml ->
// Work out the base filename of the test
def base = xml.toString()
def pos = base.indexOf("/locales/locale-10/")
def pos = base.lastIndexOf("/")
if (pos > 0) {
base = base.substring(pos+19)
base = base.substring(pos+1)
}

// The following is only needed while we're generating
// from the 1.0 files.
def localetng = xml.toString().replace("/locale-10/", "/locale/")
Task t = task "locale10_${base}"(type: SaxonXsltTask) {
inputs.file "${projectDir}/tools/xform-10-tng.xsl"
Task t = task "locale_${base}"(
type: SaxonXsltTask
) {
inputs.file xml
inputs.file "${projectDir}/src/main/xslt/modules/xform-locale.xsl"
outputs.file "${buildDir}/xslt/locale/${base}"

input xml
stylesheet "${projectDir}/tools/xform-10-tng.xsl"
output localetng
}
generateXslTNGLocales.dependsOn t

Task u = task "locale_${base}"(type: SaxonXsltTask) {
inputs.files "${projectDir}/tools/xform-locale.xsl"
input localetng
stylesheet "${projectDir}/tools/xform-locale.xsl"
stylesheet "${projectDir}/src/main/xslt/modules/xform-locale.xsl"
output "${buildDir}/xslt/locale/${base}"

if (base != 'en.xml') {
parameters(
'fallback.locale': "${projectDir}/src/main/locale/en.xml"
)
}
}
u.dependsOn t
generateLocales.dependsOn u
generateLocales.dependsOn t
}

task makeVersion(type: SaxonXsltTask) {
Expand Down Expand Up @@ -1506,6 +1500,7 @@ task guideCustomResources(type: Copy) {
include "css/**"
include "js/**"
include "media/**"
include "*.html"
into "${buildDir}/guide/"
}

Expand Down
12 changes: 6 additions & 6 deletions properties.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
ext {
xslTNGtitle = 'DocBook xslTNG'
xslTNGbaseName = 'docbook-xslTNG'
xslTNGversion = '1.11.1'
guideVersion = '1.11.0'
xslTNGversion = '2.0.0'
guideVersion = '2.0.0'

docbookVersion = '5.2CR2'
publishersVersion = '5.2CR2'
docbookVersion = '5.2CR4'
publishersVersion = '5.2CR4'

saxonVersion = '11.4'
saxonGroup = 'net.sf.saxon'
Expand All @@ -16,7 +16,7 @@ ext {

metadataExtractorVersion = '2.15.0'
jingVersion = '20220510'
xmlresolverVersion = '4.5.1'
sincludeVersion = '4.2.0'
xmlresolverVersion = '4.6.0'
sincludeVersion = '4.2.1'
slf4jVersion = '1.7.30'
}
17 changes: 17 additions & 0 deletions src/guide/resources/ch00.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<noscript>
<meta http-equiv="refresh" content="0; url='ch-preface.html'" />
</noscript>
</head>
<body>
<p>This page <a href="ch-preface.html">has moved</a>.</p>
<script>
const url = window.location.toString();
const pos = url.lastIndexOf("/");
const redirect = url.substring(0, pos+1) + "ch-preface.html";
window.location.href = redirect + window.location.search + window.location.hash;
</script>
</body>
</html>
17 changes: 17 additions & 0 deletions src/guide/resources/ch01.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<noscript>
<meta http-equiv="refresh" content="0; url='ch-overview.html'" />
</noscript>
</head>
<body>
<p>This page <a href="ch-overview.html">has moved</a>.</p>
<script>
const url = window.location.toString();
const pos = url.lastIndexOf("/");
const redirect = url.substring(0, pos+1) + "ch-overview.html";
window.location.href = redirect + window.location.search + window.location.hash;
</script>
</body>
</html>
18 changes: 18 additions & 0 deletions src/guide/resources/ch02.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<noscript>
<meta http-equiv="refresh" content="0; url='ch-using.html'" />
</noscript>
</head>
<body>
<p>This page <a href="ch-using.html">has moved</a>.</p>
<script>
const url = window.location.toString();
const pos = url.lastIndexOf("/");
const redirect = url.substring(0, pos+1) + "ch-using.html";
window.location.href = redirect + window.location.search + window.location.hash;
</script>
</body>
</html>

17 changes: 17 additions & 0 deletions src/guide/resources/ch03.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<noscript>
<meta http-equiv="refresh" content="0; url='ch-customizing.html'" />
</noscript>
</head>
<body>
<p>This page <a href="ch-customizing.html">has moved</a>.</p>
<script>
const url = window.location.toString();
const pos = url.lastIndexOf("/");
const redirect = url.substring(0, pos+1) + "ch-customizing.html";
window.location.href = redirect + window.location.search + window.location.hash;
</script>
</body>
</html>
17 changes: 17 additions & 0 deletions src/guide/resources/ch04.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<noscript>
<meta http-equiv="refresh" content="0; url='ch-implementation.html'" />
</noscript>
</head>
<body>
<p>This page <a href="ch-implementation.html">has moved</a>.</p>
<script>
const url = window.location.toString();
const pos = url.lastIndexOf("/");
const redirect = url.substring(0, pos+1) + "ch-implementation.html";
window.location.href = redirect + window.location.search + window.location.hash;
</script>
</body>
</html>
17 changes: 17 additions & 0 deletions src/guide/resources/ch05.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<noscript>
<meta http-equiv="refresh" content="0; url='ch-building.html'" />
</noscript>
</head>
<body>
<p>This page <a href="ch-building.html">has moved</a>.</p>
<script>
const url = window.location.toString();
const pos = url.lastIndexOf("/");
const redirect = url.substring(0, pos+1) + "ch-building.html";
window.location.href = redirect + window.location.search + window.location.hash;
</script>
</body>
</html>
8 changes: 8 additions & 0 deletions src/guide/resources/css/guide.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ p .refpurpose-sep {
text-align: center;
}

img {
max-width: 80%;
}

.cover img {
max-width: inherit;
}

.figure {
border: 2px solid #afafaf;
border-radius: 1em;
Expand Down
Binary file added src/guide/resources/media/l10n-en-alt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/guide/resources/media/l10n-en-ann.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/guide/resources/media/l10n-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/guide/resources/media/l10n-fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/guide/xml/ackno.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0"
xml:id="acknowledgements">
<?db filename="ackno"?>
<title>Acknowledgements</title>
<info>
<?db filename="ackno"?>
<title>Acknowledgements</title>
</info>

<para>I’d like to thank The Academy, the…no, wrong event.</para>

Expand Down
2 changes: 1 addition & 1 deletion src/guide/xml/ch00.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="preface">
<info>
<?db filename="ch00"?>
<?db filename="ch-preface"?>
<title>Preface</title>
</info>

Expand Down
2 changes: 1 addition & 1 deletion src/guide/xml/ch01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="whatfor">
<info>
<?db filename="ch01"?>
<?db filename="ch-overview"?>
<title>Overview</title>
</info>

Expand Down
2 changes: 1 addition & 1 deletion src/guide/xml/ch02.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="using">
<info>
<?db filename="ch02"?>
<?db filename="ch-using"?>
<title>Using the stylesheets</title>
</info>

Expand Down
2 changes: 1 addition & 1 deletion src/guide/xml/ch03.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="customization">
<info>
<?db filename="ch03"?>
<?db filename="ch-customizing"?>
<title>Customizing the stylesheets</title>
</info>

Expand Down
Loading

0 comments on commit 425fbd4

Please sign in to comment.