Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy.docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
pip install -r workshop/content/requirements.txt
- name: Build site 📦
run: |
cd workshop/content
zensical build --clean --strict
zensical build --clean --strict --config-file zensical.toml
zensical build --strict --config-file zensical.pt.toml
mv site /tmp/
- name: checkout gh-pages branch
uses: actions/checkout@master
Expand Down
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,35 @@ zensical serve # website is made available on http://localhost:8000

### Translating the workshop to a different language

The workshop is setup to support content in different languages, via the [mkdocs-static-i18n](https://pypi.org/project/mkdocs-static-i18n) plugin. To add an additional language to the workshop:

- in `mkdocs.yml`, section `plugins.i18n.languages`, add a section with at least the `locale`, `name`, and `build` directives. For example, to add Greek:

```yaml
- locale: el
name: Ελληνικά
build: true
```

- foreach `.md` page in `workshop/content/docs`, add an equivalant page in the language with the locale code as part of the filename. For example:
Support to multiple languages is native in Zensical. To add an additional language to the workshop, create another toml file with the locale code as part of the filename. See an example [here](./workshop/content/zensical.pt.toml).

- To enable the language switcher, update this block at the end of [the main configuration file](./workshop/content/zensical.toml):
```
alternate =[
{ name = "English", link = "/", lang = "en" },
{ name = "Português", link = "/pt/", lang = "pt" }
]
```
- foreach `.md` page in `workshop/content/docs`, add an equivalent page in the language with the locale code as part of the filename. For example:
- `ogcapi-records.md` -> `ogcapi-records.el.md`
- Update the [GitHub action](https://github.com/geopython/diving-into-pygeoapi/blob/main/.github/workflows/deploy.docs.yml), to also include a build for this language; example: `zensical build --strict --config-file zensical.pt.toml`

- commit to your fork and issue a GitHub Pull Request

NOTE: see [issue 217](https://github.com/geopython/diving-into-pygeoapi/issues/217) to track the implementation of auto-translation.

Note: Zensical can only serve one language at a time. Example:
`zensical serve --config-file zensical.pt.toml`

If you want to test the language switcher: build the default English site, build the other language sites and spin up a basic local web server to view the combined output:

```
zensical build --config-file zensical.toml

zensical build --config-file zensical.pt.toml

python3 -m http.server --directory site
```

## Contributing updates

Expand Down
70 changes: 70 additions & 0 deletions workshop/content/zensical.pt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[project]
site_name = "Diving into pygeoapi"
site_description = "pygeoapi is an OGC Reference Implementation supporting numerous OGC API specifications. This workshop will cover publishing geospatial data to the Web using pygeoapi in support of the suite of OGC API standards."
site_author = "The pygeoapi community"
copyright = "© 2022 - 2026 pygeoapi community"
site_url = "https://dive.pygeoapi.io/"
repo_url = "https://github.com/geopython/diving-into-pygeoapi"
edit_uri = "edit/main/workshop/content/docs"
docs_dir = "docs"
site_dir = "site/pt"
directory_urls = true
extra_css = [
"assets/stylesheets/pygeoapi.css"
]

# Native translated nav for Portuguese
nav =[
{ "Início" = "index.pt.md"},
{ "Introdução á pygeoapi" = "introduction.pt.md"},
{ "Configuração do ambiente da workshop" = "setup.pt.md"},
{ "Normas" = "standards.pt.md"},
{ "Publicação" =[
{ "Index" = "publishing/index.md"},
{ "Exercício 1 - O meu primeiro conjunto de dados" = "publishing/first.pt.md"},
{ "Exercício 2 - Dados vetoriais via OGC API - Features" = "publishing/ogcapi-features.pt.md"},
{ "Exercício 3 - Dados raster via OGC API - Coverages" = "publishing/ogcapi-coverages.pt.md"},
{ "Exercício 4 - Mapas de dados geoespaciais via OGC API - Maps" = "publishing/ogcapi-maps.pt.md"},
{ "Exercício 5 - Tiles de dados geoespaciais via OGC API - Tiles" = "publishing/ogcapi-tiles.pt.md"},
{ "Exercício 6 - Metadados via OGC API - Records" = "publishing/ogcapi-records.pt.md"},
{ "Exercício 7 - Dados ambientais via OGC API - Environmental Data Retrieval" = "publishing/ogcapi-edr.pt.md"},
{ "Exercício 8 - Funções via OGC API - Processes" = "publishing/ogcapi-processes.pt.md"}
]},
{ "Tópicos avançados" =[
{ "Index" = "advanced/index.pt.md"},
{ "Suporte multilíngue" = "advanced/i18n.pt.md"},
{ "Suporte a CRS" = "advanced/crs.pt.md"},
{ "Personalização de UI e templating" = "advanced/ui-custom-templates.pt.md"},
{ "Uso da pygeoapi em aplicações downstream" = "advanced/downstream-applications.pt.md"},
{ "Otimização para mecanismos de busca (SEO)" = "advanced/seo.pt.md"},
{ "Segurança e controle de acessos" = "advanced/security-access-control.pt.md"},
{ "Web Semântica e Linked Data" = "advanced/semantic-web-linked-data.pt.md"},
{ "Implantação na cloud" = "advanced/cloud.pt.md"},
{ "Suporte INSPIRE" = "advanced/inspire.pt.md"},
{ "Administração" = "advanced/administration.pt.md"},
{ "Exercício 9 - pygeoapi como uma ponte para outros serviços" = "advanced/bridges.pt.md"}
]},
{ "Conclusão" = "conclusion.pt.md"}
]
[project.theme]
language = "pt"
variant = "classic"
primary = "black"
favicon = "assets/favicon.ico"
logo = "assets/images/pygeoapi-icon-notrans.png"
features =[
"content.action.edit",
"content.action.view",
"navigation.top",
"navigation.tracking.prev_next",
"navigation.tracking.section",
"navigation.indexes"
]

[project.extra]
homepage = "https://dive.pygeoapi.io"

alternate =[
{ name = "English", link = "/", lang = "en" },
{ name = "Português", link = "/pt/", lang = "pt" }
]
15 changes: 10 additions & 5 deletions workshop/content/zensical.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,14 @@ features = [
[project.extra]
homepage = "https://dive.pygeoapi.io"

default_language = "en"
languages = ["en", "pt"]
generate_language_paths = true
#default_language = "en"
#languages = ["en", "pt"]
#generate_language_paths = true

[i18n.routing]
prefix_default_language = false
#[i18n.routing]
#prefix_default_language = false

alternate =[
{ name = "English", link = "/", lang = "en" },
{ name = "Português", link = "/pt/", lang = "pt" }
]
Loading