Skip to content

Commit 66c03c6

Browse files
melissawmhe7d3r
andauthored
Add language switcher and translations (#617)
* Add language switcher and translations * Fix lint * Fix nav and footer items * Add Japanese and Spanish translations * Add config files for es and ja * Restore admonition in es/install.md * Fix ja/install.md * Fix ja/_index.md * Change comment for clarity Co-authored-by: Helder Geovane Gomes de Lima <[email protected]> --------- Co-authored-by: Helder Geovane Gomes de Lima <[email protected]>
1 parent 4652a48 commit 66c03c6

File tree

13 files changed

+529
-57
lines changed

13 files changed

+529
-57
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ clean: ## remove the build artifacts, mainly the "public" directory
2121

2222
prepare: clean
2323
git submodule update --init
24+
python gen_config.py
2425

26+
# All translations share the <team>.toml files in the en translation
2527
TEAMS_DIR = content/en/teams
2628
TEAMS = emeritus-maintainers maintainers triage-team web-team typing-team
2729
TEAMS_QUERY = python themes/scientific-python-hugo-theme/tools/team_query.py

config.yaml

Lines changed: 89 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,48 @@
1-
baseURL: https://scipy.scientific-python.org/
1+
baseURL: https://scipy.org/
22
languageCode: en-us
33
theme: scientific-python-hugo-theme
4-
disableKinds: ["taxonomy", "term"]
4+
disableKinds:
5+
- taxonomy
6+
- term
57
DefaultContentLanguage: en
68
markup:
79
goldmark:
810
renderer:
911
unsafe: true
10-
11-
# Uncomment this to disable the translations for the specified languages.
12-
# This may be useful to be able to merge partial translations without deploying
13-
# them to scipy.org immediately.
14-
# disableLanguages: ["pt", "ja"]
15-
12+
disableLanguages: []
1613
params:
1714
images:
1815
- /images/logo.svg
1916
navColor: blue
2017
font:
21-
name: "Lato"
22-
sizes: [400, 900]
18+
name: Lato
19+
sizes:
20+
- 400
21+
- 900
2322
plausible:
2423
dataDomain: scipy.org
25-
2624
languages:
2725
en:
2826
title: SciPy
2927
weight: 1
3028
contentDir: content/en
31-
3229
languageName: English
3330
params:
34-
description: Why SciPy? Fundamental algorithms. Broadly applicable. Foundational. Interoperable. Performant. Open source.
31+
description:
32+
Why SciPy? Fundamental algorithms. Broadly applicable. Foundational.
33+
Interoperable. Performant. Open source.
3534
navbarlogo:
3635
image: logo.svg
3736
altText: A blue circle with a snake in the shape of the letter 'S'.
3837
text: SciPy
3938
link: /
4039
hero:
41-
# Main hero title
4240
title: SciPy
43-
# Hero subtitle (optional)
4441
subtitle: Fundamental algorithms for scientific computing in Python
45-
# Button text
4642
buttontext: Get started
47-
# Where the main hero button links to
48-
buttonlink: "/install"
49-
# Hero image (from static/images/___)
43+
buttonlink: /install
5044
image: logo.svg
51-
5245
section5: false
53-
5446
navbar:
5547
- title: Install
5648
url: /install
@@ -106,3 +98,79 @@ languages:
10698
link: /press-kit
10799
- text: Social Media
108100
link: /about/#social-media
101+
pt:
102+
title: SciPy
103+
weight: 2
104+
contentDir: content/pt
105+
languageName: "Portugu\xEAs"
106+
params:
107+
description:
108+
Por que SciPy? Algoritmos fundamentais. Broadly applicable. Foundational.
109+
Interoperable. Performant. Open source.
110+
navbarlogo:
111+
image: logo.svg
112+
altText: A blue circle with a snake in the shape of the letter 'S'.
113+
text: SciPy
114+
link: /pt/
115+
hero:
116+
title: SciPy
117+
subtitle: Fundamental algorithms for scientific computing in Python
118+
buttontext: Get started
119+
buttonlink: /pt/install
120+
image: logo.svg
121+
section5: false
122+
navbar:
123+
- title: Install
124+
url: /pt/install
125+
- title: Documentation
126+
url: https://docs.scipy.org/doc/scipy/
127+
- title: Community
128+
url: /pt/community
129+
- title: About Us
130+
url: /pt/about
131+
- title: Contribute
132+
url: /pt/contribute
133+
footer:
134+
logo: logo.svg
135+
socialmediatitle: ""
136+
socialmedia:
137+
- link: https://github.com/scipy/scipy
138+
icon: github
139+
- link: https://discuss.scientific-python.org/c/contributor/scipy/
140+
icon: scientific-python
141+
quicklinks:
142+
column1:
143+
title: ""
144+
links:
145+
- text: Install
146+
link: /pt/install
147+
- text: Documentation
148+
link: https://docs.scipy.org/doc/scipy/
149+
- text: Citing SciPy
150+
link: /pt/citing-scipy
151+
- text: Roadmap
152+
link: https://scipy.github.io/devdocs/dev/roadmap.html
153+
column2:
154+
links:
155+
- text: About Us
156+
link: /pt/about
157+
- text: Community
158+
link: /pt/community
159+
- text: SciPy Conference
160+
link: https://conference.scipy.org/
161+
- text: Contribute
162+
link: /pt/contribute
163+
- text: Code of Conduct
164+
link: https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html
165+
column3:
166+
links:
167+
- text: FAQ
168+
link: /pt/faq
169+
- text: Terms of Use
170+
link: /pt/terms
171+
- text: Privacy
172+
link: /pt/privacy
173+
- text: Press Kit
174+
link: /pt/press-kit
175+
- text: Social Media
176+
link: /pt/about/#social-media

config.yaml.in

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
baseURL: https://scipy.org/
2+
languageCode: en-us
3+
theme: scientific-python-hugo-theme
4+
disableKinds: ["taxonomy", "term"]
5+
DefaultContentLanguage: en
6+
markup:
7+
goldmark:
8+
renderer:
9+
unsafe: true
10+
11+
# Add languages to the list to disable their translations.
12+
# This may be useful to be able to merge partial translations without deploying
13+
# them to scipy.org immediately.
14+
disableLanguages: []
15+
16+
params:
17+
images:
18+
- /images/logo.svg
19+
navColor: blue
20+
font:
21+
name: "Lato"
22+
sizes: [400, 900]
23+
plausible:
24+
dataDomain: scipy.org
25+
26+
languages:
27+
en:
28+
title: SciPy
29+
weight: 1
30+
contentDir: content/en
31+
include-files:
32+
- content/en/config.yaml
33+
34+
es:
35+
title: SciPy
36+
weight: 3
37+
contentDir: content/es
38+
include-files:
39+
- content/es/config.yaml
40+
41+
ja:
42+
title: SciPy
43+
weight: 4
44+
contentDir: content/ja
45+
include-files:
46+
- content/ja/config.yaml
47+
48+
pt:
49+
title: SciPy
50+
weight: 2
51+
contentDir: content/pt
52+
include-files:
53+
- content/pt/config.yaml

content/en/config.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
languageName: English
2+
params:
3+
description: Why SciPy? Fundamental algorithms. Broadly applicable. Foundational. Interoperable. Performant. Open source.
4+
navbarlogo:
5+
image: logo.svg
6+
altText: A blue circle with a snake in the shape of the letter 'S'.
7+
text: SciPy
8+
link: /
9+
hero:
10+
# Main hero title
11+
title: SciPy
12+
# Hero subtitle (optional)
13+
subtitle: Fundamental algorithms for scientific computing in Python
14+
# Button text
15+
buttontext: Get started
16+
# Where the main hero button links to
17+
buttonlink: "/install"
18+
# Hero image (from static/images/___)
19+
image: logo.svg
20+
21+
section5: false
22+
23+
navbar:
24+
- title: Install
25+
url: /install
26+
- title: Documentation
27+
url: https://docs.scipy.org/doc/scipy/
28+
- title: Community
29+
url: /community
30+
- title: About Us
31+
url: /about
32+
- title: Contribute
33+
url: /contribute
34+
footer:
35+
logo: logo.svg
36+
socialmediatitle: ""
37+
socialmedia:
38+
- link: https://github.com/scipy/scipy
39+
icon: github
40+
- link: https://discuss.scientific-python.org/c/contributor/scipy/
41+
icon: scientific-python
42+
quicklinks:
43+
column1:
44+
title: ""
45+
links:
46+
- text: Install
47+
link: /install
48+
- text: Documentation
49+
link: https://docs.scipy.org/doc/scipy/
50+
- text: Citing SciPy
51+
link: /citing-scipy
52+
- text: Roadmap
53+
link: https://scipy.github.io/devdocs/dev/roadmap.html
54+
column2:
55+
links:
56+
- text: About Us
57+
link: /about
58+
- text: Community
59+
link: /community
60+
- text: SciPy Conference
61+
link: https://conference.scipy.org/
62+
- text: Contribute
63+
link: /contribute
64+
- text: Code of Conduct
65+
link: https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html
66+
column3:
67+
links:
68+
- text: FAQ
69+
link: /faq
70+
- text: Terms of Use
71+
link: /terms
72+
- text: Privacy
73+
link: /privacy
74+
- text: Press Kit
75+
link: /press-kit
76+
- text: Social Media
77+
link: /about/#social-media

content/es/config.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
languageName: Español
2+
params:
3+
description: Why SciPy? Fundamental algorithms. Broadly applicable. Foundational. Interoperable. Performant. Open source.
4+
navbarlogo:
5+
image: logo.svg
6+
altText: A blue circle with a snake in the shape of the letter 'S'.
7+
text: SciPy
8+
link: /es/
9+
hero:
10+
# Main hero title
11+
title: SciPy
12+
# Hero subtitle (optional)
13+
subtitle: Fundamental algorithms for scientific computing in Python
14+
# Button text
15+
buttontext: Get started
16+
# Where the main hero button links to
17+
buttonlink: "/es/install"
18+
# Hero image (from static/images/___)
19+
image: logo.svg
20+
21+
section5: false
22+
23+
navbar:
24+
- title: Install
25+
url: /es/install
26+
- title: Documentation
27+
url: https://docs.scipy.org/doc/scipy/
28+
- title: Community
29+
url: /es/community
30+
- title: About Us
31+
url: /es/about
32+
- title: Contribute
33+
url: /es/contribute
34+
footer:
35+
logo: logo.svg
36+
socialmediatitle: ""
37+
socialmedia:
38+
- link: https://github.com/scipy/scipy
39+
icon: github
40+
- link: https://discuss.scientific-python.org/c/contributor/scipy/
41+
icon: scientific-python
42+
quicklinks:
43+
column1:
44+
title: ""
45+
links:
46+
- text: Install
47+
link: /es/install
48+
- text: Documentation
49+
link: https://docs.scipy.org/doc/scipy/
50+
- text: Citing SciPy
51+
link: /es/citing-scipy
52+
- text: Roadmap
53+
link: https://scipy.github.io/devdocs/dev/roadmap.html
54+
column2:
55+
links:
56+
- text: About Us
57+
link: /es/about
58+
- text: Community
59+
link: /es/community
60+
- text: SciPy Conference
61+
link: https://conference.scipy.org/
62+
- text: Contribute
63+
link: /es/contribute
64+
- text: Code of Conduct
65+
link: https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html
66+
column3:
67+
links:
68+
- text: FAQ
69+
link: /es/faq
70+
- text: Terms of Use
71+
link: /es/terms
72+
- text: Privacy
73+
link: /es/privacy
74+
- text: Press Kit
75+
link: /es/press-kit
76+
- text: Social Media
77+
link: /es/about/#social-media

0 commit comments

Comments
 (0)