Skip to content

Add language switcher and translations #617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ clean: ## remove the build artifacts, mainly the "public" directory

prepare: clean
git submodule update --init
python gen_config.py

# All translations share the <team>.toml files in the en translation
TEAMS_DIR = content/en/teams
TEAMS = emeritus-maintainers maintainers triage-team web-team
TEAMS_QUERY = python themes/scientific-python-hugo-theme/tools/team_query.py
Expand Down
110 changes: 89 additions & 21 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,48 @@
baseURL: https://scipy.scientific-python.org/
baseURL: https://scipy.org/
languageCode: en-us
theme: scientific-python-hugo-theme
disableKinds: ["taxonomy", "term"]
disableKinds:
- taxonomy
- term
DefaultContentLanguage: en
markup:
goldmark:
renderer:
unsafe: true

# Uncomment this to disable the translations for the specified languages.
# This may be useful to be able to merge partial translations without deploying
# them to scipy.org immediately.
# disableLanguages: ["pt", "ja"]

disableLanguages: []
params:
images:
- /images/logo.svg
navColor: blue
font:
name: "Lato"
sizes: [400, 900]
name: Lato
sizes:
- 400
- 900
plausible:
dataDomain: scipy.org

languages:
en:
title: SciPy
weight: 1
contentDir: content/en

languageName: English
params:
description: Why SciPy? Fundamental algorithms. Broadly applicable. Foundational. Interoperable. Performant. Open source.
description:
Why SciPy? Fundamental algorithms. Broadly applicable. Foundational.
Interoperable. Performant. Open source.
navbarlogo:
image: logo.svg
altText: A blue circle with a snake in the shape of the letter 'S'.
text: SciPy
link: /
hero:
# Main hero title
title: SciPy
# Hero subtitle (optional)
subtitle: Fundamental algorithms for scientific computing in Python
# Button text
buttontext: Get started
# Where the main hero button links to
buttonlink: "/install"
# Hero image (from static/images/___)
buttonlink: /install
image: logo.svg

section5: false

navbar:
- title: Install
url: /install
Expand Down Expand Up @@ -106,3 +98,79 @@ languages:
link: /press-kit
- text: Social Media
link: /about/#social-media
pt:
title: SciPy
weight: 2
contentDir: content/pt
languageName: "Portugu\xEAs"
params:
description:
Por que SciPy? Algoritmos fundamentais. Broadly applicable. Foundational.
Interoperable. Performant. Open source.
navbarlogo:
image: logo.svg
altText: A blue circle with a snake in the shape of the letter 'S'.
text: SciPy
link: /pt/
hero:
title: SciPy
subtitle: Fundamental algorithms for scientific computing in Python
buttontext: Get started
buttonlink: /pt/install
image: logo.svg
section5: false
navbar:
- title: Install
url: /pt/install
- title: Documentation
url: https://docs.scipy.org/doc/scipy/
- title: Community
url: /pt/community
- title: About Us
url: /pt/about
- title: Contribute
url: /pt/contribute
footer:
logo: logo.svg
socialmediatitle: ""
socialmedia:
- link: https://github.com/scipy/scipy
icon: github
- link: https://discuss.scientific-python.org/c/contributor/scipy/
icon: scientific-python
quicklinks:
column1:
title: ""
links:
- text: Install
link: /pt/install
- text: Documentation
link: https://docs.scipy.org/doc/scipy/
- text: Citing SciPy
link: /pt/citing-scipy
- text: Roadmap
link: https://scipy.github.io/devdocs/dev/roadmap.html
column2:
links:
- text: About Us
link: /pt/about
- text: Community
link: /pt/community
- text: SciPy Conference
link: https://conference.scipy.org/
- text: Contribute
link: /pt/contribute
- text: Code of Conduct
link: https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html
column3:
links:
- text: FAQ
link: /pt/faq
- text: Terms of Use
link: /pt/terms
- text: Privacy
link: /pt/privacy
- text: Press Kit
link: /pt/press-kit
- text: Social Media
link: /pt/about/#social-media
53 changes: 53 additions & 0 deletions config.yaml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
baseURL: https://scipy.org/
languageCode: en-us
theme: scientific-python-hugo-theme
disableKinds: ["taxonomy", "term"]
DefaultContentLanguage: en
markup:
goldmark:
renderer:
unsafe: true

# Uncomment this to disable the translations for the specified languages.
# This may be useful to be able to merge partial translations without deploying
# them to scipy.org immediately.
disableLanguages: []

params:
images:
- /images/logo.svg
navColor: blue
font:
name: "Lato"
sizes: [400, 900]
plausible:
dataDomain: scipy.org

languages:
en:
title: SciPy
weight: 1
contentDir: content/en
include-files:
- content/en/config.yaml

es:
title: SciPy
weight: 3
contentDir: content/es
include-files:
- content/es/config.yaml

ja:
title: SciPy
weight: 4
contentDir: content/ja
include-files:
- content/ja/config.yaml

pt:
title: SciPy
weight: 2
contentDir: content/pt
include-files:
- content/pt/config.yaml
77 changes: 77 additions & 0 deletions content/en/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
languageName: English
params:
description: Why SciPy? Fundamental algorithms. Broadly applicable. Foundational. Interoperable. Performant. Open source.
navbarlogo:
image: logo.svg
altText: A blue circle with a snake in the shape of the letter 'S'.
text: SciPy
link: /
hero:
# Main hero title
title: SciPy
# Hero subtitle (optional)
subtitle: Fundamental algorithms for scientific computing in Python
# Button text
buttontext: Get started
# Where the main hero button links to
buttonlink: "/install"
# Hero image (from static/images/___)
image: logo.svg

section5: false

navbar:
- title: Install
url: /install
- title: Documentation
url: https://docs.scipy.org/doc/scipy/
- title: Community
url: /community
- title: About Us
url: /about
- title: Contribute
url: /contribute
footer:
logo: logo.svg
socialmediatitle: ""
socialmedia:
- link: https://github.com/scipy/scipy
icon: github
- link: https://discuss.scientific-python.org/c/contributor/scipy/
icon: scientific-python
quicklinks:
column1:
title: ""
links:
- text: Install
link: /install
- text: Documentation
link: https://docs.scipy.org/doc/scipy/
- text: Citing SciPy
link: /citing-scipy
- text: Roadmap
link: https://scipy.github.io/devdocs/dev/roadmap.html
column2:
links:
- text: About Us
link: /about
- text: Community
link: /community
- text: SciPy Conference
link: https://conference.scipy.org/
- text: Contribute
link: /contribute
- text: Code of Conduct
link: https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html
column3:
links:
- text: FAQ
link: /faq
- text: Terms of Use
link: /terms
- text: Privacy
link: /privacy
- text: Press Kit
link: /press-kit
- text: Social Media
link: /about/#social-media
77 changes: 77 additions & 0 deletions content/es/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
languageName: Español
params:
description: Why SciPy? Fundamental algorithms. Broadly applicable. Foundational. Interoperable. Performant. Open source.
navbarlogo:
image: logo.svg
altText: A blue circle with a snake in the shape of the letter 'S'.
text: SciPy
link: /es/
hero:
# Main hero title
title: SciPy
# Hero subtitle (optional)
subtitle: Fundamental algorithms for scientific computing in Python
# Button text
buttontext: Get started
# Where the main hero button links to
buttonlink: "/es/install"
# Hero image (from static/images/___)
image: logo.svg

section5: false

navbar:
- title: Install
url: /es/install
- title: Documentation
url: https://docs.scipy.org/doc/scipy/
- title: Community
url: /es/community
- title: About Us
url: /es/about
- title: Contribute
url: /es/contribute
footer:
logo: logo.svg
socialmediatitle: ""
socialmedia:
- link: https://github.com/scipy/scipy
icon: github
- link: https://discuss.scientific-python.org/c/contributor/scipy/
icon: scientific-python
quicklinks:
column1:
title: ""
links:
- text: Install
link: /es/install
- text: Documentation
link: https://docs.scipy.org/doc/scipy/
- text: Citing SciPy
link: /es/citing-scipy
- text: Roadmap
link: https://scipy.github.io/devdocs/dev/roadmap.html
column2:
links:
- text: About Us
link: /es/about
- text: Community
link: /es/community
- text: SciPy Conference
link: https://conference.scipy.org/
- text: Contribute
link: /es/contribute
- text: Code of Conduct
link: https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html
column3:
links:
- text: FAQ
link: /es/faq
- text: Terms of Use
link: /es/terms
- text: Privacy
link: /es/privacy
- text: Press Kit
link: /es/press-kit
- text: Social Media
link: /es/about/#social-media
Loading
Loading