Skip to content

Commit 16a7a82

Browse files
committed
Added dutch homepage, modified homepage app to take the labels as a dictionary for translations, updated some main pages with changes since last year. Stil have to work on all the new chapters.
1 parent ceefdf0 commit 16a7a82

11 files changed

+320
-117
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ html-nl:
8585
$(SPHINXBUILD) -b html -D project="PySDR: Een handleiding voor SDR en DSP met Python" -D exclude_patterns=_build,index.rst,content/*,index-fr.rst,content-fr/*,index-ukraine.rst,content-ukraine/*,index-zh.rst,content-zh/*,index-es.rst,content-es/* -D master_doc=index-nl $(EXTENSIONS) . $(BUILDDIR)/nl/
8686
@echo
8787
@echo "Dutch Build finished. The HTML pages are in $(BUILDDIR)/nl/html."
88+
@echo translating title of index and content pages
89+
sed -i 's/PySDR: A Guide to SDR and DSP using Python/PySDR: Een handleiding voor SDR en DSP met Python/g' $(BUILDDIR)/nl/index-nl.html
90+
sed -i 's/PySDR: A Guide to SDR and DSP using Python/PySDR: Een handleiding voor SDR en DSP met Python/g' $(BUILDDIR)/nl/content-nl/*.html
91+
@echo removing chapter number from titles of each page
92+
sed -i -E "s/<title>[0-9]{1,2}\. /<title>/g" $(BUILDDIR)/nl/content-nl/*
8893

8994
.PHONY: html-fr
9095
html-fr:

_static/js/homepage_app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function homepage_app() {
1+
function homepage_app(labels={"frequency": "Frequency", "time": "Time"}) {
22
function createSignal(N) {
33
const x = new Array(N * 2);
44

@@ -80,7 +80,7 @@ function homepage_app() {
8080
ctx.fillText(Math.round((i - 5) * 0.1 * 100) / 100, ((ctx.canvas.width / 10) * i - 0) * 0.975, ctx.canvas.height - 35);
8181
}
8282
ctx.fillText("Hz", ctx.canvas.width / 2 + 5, ctx.canvas.height - 35);
83-
ctx.fillText("Frequency", ctx.canvas.width / 2 - 70, ctx.canvas.height - 7);
83+
ctx.fillText(labels["frequency"], ctx.canvas.width / 2 - 70, ctx.canvas.height - 7);
8484
ctx.stroke();
8585

8686
// Freq y-axis ticks and labels
@@ -135,7 +135,7 @@ function homepage_app() {
135135
ctx_time.lineTo((ctx_time.canvas.width / 10) * i, ctx_time.canvas.height - 60);
136136
//ctx_time.fillText(Math.round(i* 0.1 * 100) / 100, ((ctx_time.canvas.width / 10) * i - 0) * 0.98, ctx_time.canvas.height - 5);
137137
}
138-
ctx_time.fillText("Time", ctx_time.canvas.width / 2, ctx_time.canvas.height - 5);
138+
ctx_time.fillText(labels["time"], ctx_time.canvas.width / 2, ctx_time.canvas.height - 5);
139139
ctx_time.stroke();
140140

141141
// Time y-axis ticks and labels

_templates/homepage_nl.html

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<h1 style="text-align: center">PySDR: Een handleiding voor SDRs en digitale signaalbewerking met Python</h1>
2+
3+
<p style="text-align: center">
4+
door
5+
<a class="reference internal" href="content/about_author.html#author-chapter">
6+
<span class="std std-ref">Dr. Marc Lichtman</span>
7+
</a>
8+
-
9+
<a class="reference external" href="mailto:pysdr&#37;&#52;&#48;vt&#46;edu" rel="noopener noreferrer" target="_blank">
10+
pysdr<span>&#64;</span>vt<span>&#46;</span>edu
11+
</a>
12+
</p>
13+
14+
<h4 style="line-height: 1.4">
15+
Welkom bij PySDR, een gratis online boek (geen Python-bibliotheek!) dat met een een overvloed aan diagrammen, animaties en Python-codevoorbeelden een zachte introductie biedt tot draadloze communicatie en software-gedefinieerde-radio (SDR). Van FFT's tot filters tot digitale modulatie tot ontvangen en verzenden via SDR's in Python, PySDR heeft het allemaal!
16+
</h4>
17+
18+
<h4 style="line-height: 1.4">
19+
Het doel van PySDR is om de toegankelijkheid van onderwerpen die traditioneel met zware wiskunde in een aantal universiteiten worden behandeld, te vergroten. Alle inhoud die wordt gebruikt om PySDR te genereren, is open source en kun je
20+
<a class="reference external" href="https://github.com/777arc/PySDR" rel="noopener noreferrer" target="_blank">hier</a> vinden.
21+
</h4>
22+
23+
<h4>
24+
Zie
25+
<a class="reference internal" href="content-nl/intro.html#intro-chapter"><span class="std std-ref">Hoofdstuk 1: Introductie</span></a>
26+
voor het doel en de doelgroep van het boek.
27+
</h4>
28+
29+
<h4>
30+
Probeer eens te spelen met de onderstaande simulatie als voorproefje op RF signaalverwerking. De simulatie laat het frequentie- en tijdsdomein van een signaal zien dat bestaat uit een toon en witte Gaussische ruis.
31+
</h4>
32+
33+
<div>
34+
<input type="range" min="-0.4" max="0.4" step="0.0001" value="0.01" class="slider" id="freq" style="width:50%;"/>
35+
<span id="freq_value"></span>
36+
<label>[Hz] - Toonfrequentie</label>
37+
</div>
38+
<div>
39+
<input type="range" min="-20" max="10" step="0.1" value="0" class="slider" id="noise_ampl_dB" style="width:50%;"/>
40+
<span id="noise_value"></span>
41+
<label>[dB] - Ruisamplitude</label>
42+
</div>
43+
<div>
44+
<canvas width="2048" height="800" id="freq_plot" style="width: 66%; min-width: 512px; border: 0px; image-rendering: auto"></canvas>
45+
</div>
46+
<br />
47+
<br />
48+
<div>
49+
<canvas width="2048" height="800" id="time_plot" style="width: 66%; min-width: 512px; border: 0px; image-rendering: auto"></canvas>
50+
</div>
51+
52+
<script>
53+
const nl_labels = { "frequency" : "Frequentie",
54+
"time" : "Tijd"
55+
};
56+
homepage_app(nl_labels);
57+
</script>
58+
59+
<br />

0 commit comments

Comments
 (0)