Skip to content

Commit

Permalink
Merge branch 'feature/mini18n'
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Mar 24, 2024
2 parents 892017e + ef07c0d commit f14b935
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
- name: 'Build website'
run: |
rye sync --no-lock
rye run make dirhtml
rye run make mini18n-dirhtml
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: build/dirhtml/
path: build/mini18-dirhtml/
deploy:
needs: build
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ help:

.PHONY: help Makefile

intl:
@$(SPHINXBUILD) -M gettext "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
sphinx-intl update --language=ja

local:
sphinx-autobuild -b dirhtml $(SOURCEDIR) $(BUILDDIR)/dirhtml $(O)

Expand Down
3 changes: 3 additions & 0 deletions contents/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ html {
.bd-header label.sidebar-toggle {
color: var(--pst-custom-navbar-color);
}
div#atsphinx-mini18n-select-component {
color: var(--pst-custom-navbar-color);
}
27 changes: 26 additions & 1 deletion contents/conf.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,49 @@
# noqa: D100

import os

import dotenv
from atsphinx.mini18n import get_template_dir

dotenv.load_dotenv()

# -- Project information
project = "atsphinx"
copyright = "2023, Kazuya Takei"
author = "Kazuya Takei"
release = "2023.5.1"
version = release

# -- General configuration
extensions = []
extensions = [
"atsphinx.color_text",
"atsphinx.mini18n",
"sphinx.ext.todo",
"sphinx.ext.githubpages",
"sphinx_design",
]
templates_path = ["_templates"]
templates_path = ["_templates", get_template_dir()]
exclude_patterns = []

# For i18n
language = "en"
locale_dirs = ["../locales"]
gettext_compact = False
gettext_language_team = "Kazuya Takei <[email protected]>"
gettext_last_translator = os.environ.get("SPHINXINTL_TRANSLATOR", None)

# -- Options for HTML output
html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
html_css_files = ["css/custom.css"]
html_title = project
html_permalinks = False
html_theme_options = {
"navbar_end": [
"navbar-icon-links",
"mini18n/snippets/select-lang",
],
"article_footer_items": [],
"icon_links": [
{
Expand All @@ -37,3 +58,7 @@
# -- Options for extensions
# sphinx.ext.todo
todo_include_todos = True

# atsphinx.mini18n
mini18n_default_language = "en"
mini18n_support_languages = ["en", "ja"]
49 changes: 49 additions & 0 deletions locales/ja/LC_MESSAGES/contributing.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, Kazuya Takei
# This file is distributed under the same license as the atsphinx package.
# Kazuya Takei <[email protected]>, 2024.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: atsphinx 2023.5.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-25 01:39+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kazuya Takei <[email protected]>\n"
"Language: ja\n"
"Language-Team: Kazuya Takei <[email protected]>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"

#: ../../contents/contributing.rst:3
msgid "Contributing for projects"
msgstr ""

#: ../../contents/contributing.rst:5
msgid "This is guideline to contribute for ``atsphinx`` packages."
msgstr "このページは、 ``atsphinx`` シリーズのパッケージへのコントリビューションのための案内です。"

#: ../../contents/contributing.rst:7
msgid "Todo"
msgstr ""

#: ../../contents/contributing.rst:7
msgid "This is empty content."
msgstr ""

#: ../../contents/contributing.rst:9
msgid "Add document"
msgstr ""

#: ../../contents/contributing.rst:10
msgid "Link from current packages' documentation"
msgstr ""

#: ../../contents/contributing.rst:11
msgid "Configure into cookiecutter"
msgstr ""

89 changes: 89 additions & 0 deletions locales/ja/LC_MESSAGES/index.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, Kazuya Takei
# This file is distributed under the same license as the atsphinx package.
# Kazuya Takei <[email protected]>, 2024.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: atsphinx 2023.5.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-25 01:39+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kazuya Takei <[email protected]>\n"
"Language: ja\n"
"Language-Team: Kazuya Takei <[email protected]>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"

#: ../../contents/index.rst:5
msgid "Contributing"
msgstr ""

#: ../../contents/index.rst:3
msgid "atsphinx project"
msgstr "atsphinxプロジェクト"

#: ../../contents/index.rst:10
msgid ""
"**atsphinx** is attakei's Sphinx extension collection and personal "
"namespace of PyPI."
msgstr "**atsphinx** は @attakei が開発しているSphinx拡張のコレクションの総称で、名前空間です。"

#: ../../contents/index.rst:13
msgid "Featured packages"
msgstr "主なパッケージ"

#: ../../contents/index.rst:17
msgid "Footnotes"
msgstr ""

#: ../../contents/index.rst:19
msgid "Collect all footnotes in document and display to **foot** of doc."
msgstr "ドキュメント内にある脚注構文を集約して、「文末」に表示させるようにします。"

#: ../../contents/index.rst:21
msgid "OG Article"
msgstr ""

#: ../../contents/index.rst:23
msgid "Render ``article:*`` metatags."
msgstr "OGPの ``article:*`` メタ情報を出力します。"

#: ../../contents/index.rst:25
msgid "Feed"
msgstr ""

#: ../../contents/index.rst:27
msgid ""
"Generate Atom feed from ``og-article`` directrive of ``atsphinx-og-"
"article``."
msgstr "``atsphinx-og-article`` で用いる ``og-article`` ディレクティブを参照してAtomフィードを生成します。"

#: ../../contents/index.rst:29
msgid "Highlight.js"
msgstr ""

#: ../../contents/index.rst:31
msgid "Syntax highlighting by Highlight.js instead of Pygments."
msgstr "Highlight.jsを利用したコードシンタックスハイライト。"

#: ../../contents/index.rst:33
msgid "SQLite3 FTS"
msgstr ""

#: ../../contents/index.rst:35
msgid "Extra search using SQLite3 FTS and SQL.js."
msgstr "SQLite3とSQL.jsを利用した、新しいドキュメント検索を提供します。"

#: ../../contents/index.rst:37
msgid "Color text"
msgstr ""

#: ../../contents/index.rst:39
msgid "Write :color:red:`color text` by role."
msgstr "ロールを用いた :color:red:`色付き文字` の出力。"

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencies = [
"sphinx==6.*",
"pydata-sphinx-theme~=0.13.0",
"sphinx_design~=0.4.0",
"python-dotenv~=1.0.1",
"atsphinx-mini18n~=0.2.1",
]
license = "Apache-2.0"
readme = "README.rst"
Expand All @@ -20,6 +22,7 @@ managed = true
virtual = true
dev-dependencies = [
"sphinx-autobuild>=2021.3.14",
"sphinx-intl~=2.1.0",
]

[tool.rye.scripts]
Expand Down
10 changes: 10 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ accessible-pygments==0.0.4
alabaster==0.7.16
# via sphinx
atsphinx-color-text==0.1.1
atsphinx-mini18n==0.2.1
babel==2.14.0
# via pydata-sphinx-theme
# via sphinx
# via sphinx-intl
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via sphinx-intl
colorama==0.4.6
# via sphinx-autobuild
docutils==0.19
Expand All @@ -44,8 +48,11 @@ pygments==2.17.2
# via accessible-pygments
# via pydata-sphinx-theme
# via sphinx
python-dotenv==1.0.1
requests==2.31.0
# via sphinx
setuptools==69.2.0
# via sphinx-intl
six==1.16.0
# via livereload
snowballstemmer==2.2.0
Expand All @@ -54,11 +61,14 @@ soupsieve==2.5
# via beautifulsoup4
sphinx==6.2.1
# via atsphinx-color-text
# via atsphinx-mini18n
# via pydata-sphinx-theme
# via sphinx-autobuild
# via sphinx-design
# via sphinx-intl
sphinx-autobuild==2024.2.4
sphinx-design==0.4.1
sphinx-intl==2.1.0
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
Expand Down
3 changes: 3 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ accessible-pygments==0.0.4
alabaster==0.7.16
# via sphinx
atsphinx-color-text==0.1.1
atsphinx-mini18n==0.2.1
babel==2.14.0
# via pydata-sphinx-theme
# via sphinx
Expand Down Expand Up @@ -40,6 +41,7 @@ pygments==2.17.2
# via accessible-pygments
# via pydata-sphinx-theme
# via sphinx
python-dotenv==1.0.1
requests==2.31.0
# via sphinx
snowballstemmer==2.2.0
Expand All @@ -48,6 +50,7 @@ soupsieve==2.5
# via beautifulsoup4
sphinx==6.2.1
# via atsphinx-color-text
# via atsphinx-mini18n
# via pydata-sphinx-theme
# via sphinx-design
sphinx-design==0.4.1
Expand Down

0 comments on commit f14b935

Please sign in to comment.