Skip to content

multiple languages (i18n) #22

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
19 changes: 8 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
.jupyter_cache
.ipynb_checkpoints

# Temp files
.DS_Store
*~

# Compiled files
.venv/
__pycache__
.mypy_cache/
.ruff_cache/
__pycache__/
.ipynb_checkpoints/
/.jupyter_cache
/.venv/
/.*cache/


# Distribution / packaging
/build/
/dist/
/*.egg-info/
/hatch.toml

# Tests and coverage
/.pytest_cache/
/.cache/
/data/

# docs
Expand All @@ -29,3 +24,5 @@ __pycache__
# IDEs
/.idea/
/.vscode/
/docs/locale/de/LC_MESSAGES/build/
*.mo
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
# The full version, including alpha/beta/rc tags
release = info["Version"]

locale_dirs = ["locale/"] # path is example but recommended.
gettext_compact = False

bibtex_bibfiles = ["references.bib"]
templates_path = ["_templates"]
nitpicky = True # Warn about broken links
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ notebooks/tutorial_axes_anndata_mudata
notebooks/scverse_data_backed
notebooks/scverse_data_interoperability
notebooks/tutorial_concatenation_anndata_mudata

notebooks/example_md.md
references.md
```
40 changes: 40 additions & 0 deletions docs/locale/de/LC_MESSAGES/index.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, scverse team.
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-08 13:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"

#: ../../../README.md:2
msgid "scverse tutorials"
msgstr "scverse tutorials DEUTSCH"

#: ../../../README.md:4
msgid ""
"[![Tests][badge-tests]][link-tests] [![Documentation][badge-docs]][link-"
"docs]"
msgstr ""

#: ../../../README.md:4
msgid "Tests"
msgstr "Prüfungen"

#: ../../../README.md:4
msgid "Documentation"
msgstr "Dokumentation"

#: ../../../README.md:11
msgid "Collection of tutorials for scverse packages."
msgstr "Sammlung von Tutorials für scverse-Pakete."
22 changes: 22 additions & 0 deletions docs/locale/de/LC_MESSAGES/notebooks/example.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, scverse team.
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-08 13:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"

#: ../../notebooks/example.ipynb:10002
msgid "Example notebook"
msgstr ""
22 changes: 22 additions & 0 deletions docs/locale/de/LC_MESSAGES/notebooks/example_md.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, scverse team.
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-08 14:58+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"

#: ../../notebooks/example_md.md:16
msgid "Example notebook"
msgstr ""
22 changes: 22 additions & 0 deletions docs/locale/de/LC_MESSAGES/references.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2022, scverse team.
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-08 13:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"

#: ../../references.md:1
msgid "References"
msgstr "Referenzen"
12 changes: 10 additions & 2 deletions docs/notebooks/anndata_getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
"execution_count": 1,
"id": "e6a75c19-d507-41d5-af0a-577dc7a9c3eb",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Matplotlib is building the font cache; this may take a moment.\n"
]
}
],
"source": [
"import numpy as np\n",
"import anndata\n",
Expand Down Expand Up @@ -2736,7 +2744,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_2325/3524272241.py:1: ImplicitModificationWarning: Trying to modify attribute `.obs` of view, initializing view as actual.\n",
"/tmp/ipykernel_2167/3524272241.py:1: ImplicitModificationWarning: Trying to modify attribute `.obs` of view, initializing view as actual.\n",
" adata_view.obs[\"new_column\"] = \"Test\" # add a new column to the `obs` dataframe\n"
]
},
Expand Down
314 changes: 154 additions & 160 deletions docs/notebooks/basic-scrna-tutorial.ipynb

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions docs/notebooks/example_md.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.14.2
kernelspec:
display_name: Python 3.6.8 64-bit
language: python
name: python3
---

+++ {"pycharm": {"name": "#%% md\n"}}

# Example notebook

```{code-cell} ipython3
---
pycharm:
name: '#%%

'
---
import numpy as np
from anndata import AnnData
import scverse_doc
```

```{code-cell} ipython3
---
pycharm:
name: '#%%

'
---
adata = AnnData(np.random.normal(size=(20, 10)))
```

```{code-cell} ipython3
---
pycharm:
name: '#%%

'
---
scverse_doc.pp.basic_preproc(adata)
```
Loading