Skip to content

Commit 4f0ced5

Browse files
authored
Merge pull request #115 from adf-python/develop
chore
2 parents 6fc2162 + 349596d commit 4f0ced5

File tree

12 files changed

+2512
-256
lines changed

12 files changed

+2512
-256
lines changed

docs/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@
66
sphinx-apidoc -f -o ./docs/source/adf_core_python ./src/adf_core_python
77
sphinx-build -M html ./docs/source ./docs/build -a
88
```
9+
10+
## Generate localized documentation (Japanese)
11+
12+
```bash
13+
sphinx-apidoc -f -o ./docs/source/adf_core_python ./src/adf_core_python
14+
sphinx-build -M html ./docs/source ./docs/build -D language=ja -a
15+
```

docs/build.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import os
22
import subprocess
3-
import yaml
43

54
# a single build step, which keeps conf.py and versions.yaml at the main branch
65
# in generall we use environment variables to pass values to conf.py, see below
76
# and runs the build as we did locally
8-
def build_doc(version, language, tag):
9-
os.environ["current_version"] = version
7+
def build_doc(language):
108
os.environ["current_language"] = language
11-
subprocess.run("git checkout " + tag, shell=True)
12-
subprocess.run("git checkout main -- conf.py", shell=True)
13-
subprocess.run("git checkout main -- versions.yaml", shell=True)
149
subprocess.run("doxygen Doxyfile", shell=True)
1510
os.environ['SPHINXOPTS'] = "-D language='{}'".format(language)
1611
subprocess.run("make html", shell=True)
@@ -26,18 +21,7 @@ def move_dir(src, dst):
2621
os.environ["pages_root"] = "https://adf-python.github.io/adf-core-python/"
2722

2823
# manually the main branch build in the current supported languages
29-
build_doc("latest", "en", "main")
24+
build_doc("en")
3025
move_dir("./build/html/", "./pages/en")
31-
build_doc("latest", "ja", "main")
32-
move_dir("./build/html/", "./pages/ja/")
33-
34-
# reading the yaml file
35-
with open("versions.yaml", "r") as yaml_file:
36-
docs = yaml.safe_load(yaml_file)
37-
38-
# and looping over all values to call our build with version, language and its tag
39-
# for version, details in docs.items():
40-
# tag = details.get('tag', '')
41-
# for language in details.get('languages', []):
42-
# build_doc(version, language, version)
43-
# move_dir("./build/html/", "./pages/"+version+'/'+language+'/')
26+
build_doc("ja")
27+
move_dir("./build/html/", "./pages/ja")

docs/source/conf.py

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import os
77
import sys
8-
import yaml
98

109
sys.path.insert(0, os.path.abspath("../../"))
1110

@@ -15,7 +14,7 @@
1514
project = "adf-core-python"
1615
copyright = "2024, Haruki Uehara, Yuki Shimada"
1716
author = "Haruki Uehara, Yuki Shimada"
18-
release = "0.1.0"
17+
release = "0.2.2"
1918

2019
# -- General configuration ---------------------------------------------------
2120
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -54,39 +53,12 @@
5453

5554
# if not there, we dont call this
5655
if build_all_docs is not None:
57-
# we get the current language and version
5856
current_language = os.environ.get("current_language")
59-
current_version = os.environ.get("current_version")
6057

61-
# we set the html_context wit current language and version
62-
# and empty languages and versions for now
6358
html_context = {
6459
'current_language' : current_language,
6560
'languages' : [],
66-
'current_version' : current_version,
67-
'versions' : [],
6861
}
6962

70-
71-
# and we append all versions and langauges accordingly
72-
# we treat t he main branch as latest
73-
if (current_version == 'latest'):
74-
html_context['languages'].append(['en', pages_root])
75-
html_context['languages'].append(['ja', pages_root+'/ja'])
76-
77-
if (current_language == 'en'):
78-
html_context['versions'].append(['latest', pages_root])
79-
if (current_language == 'ja'):
80-
html_context['versions'].append(['latest', pages_root+'/ja'])
81-
82-
# and loop over all other versions from our yaml file
83-
# to set versions and languages
84-
with open("../versions.yaml", "r") as yaml_file:
85-
docs = yaml.safe_load(yaml_file)
86-
87-
if (current_version != 'latest'):
88-
for language in docs[current_version].get('languages', []):
89-
html_context['languages'].append([language, pages_root+'/'+current_version+'/'+language])
90-
91-
for version, details in docs.items():
92-
html_context['versions'].append([version, pages_root+'/'+version+'/'+current_language])
63+
html_context['languages'].append(['en', pages_root])
64+
html_context['languages'].append(['ja', pages_root+'/ja'])

docs/source/locale/en/LC_MESSAGES/adf_core_python.po

Lines changed: 2052 additions & 7 deletions
Large diffs are not rendered by default.

docs/source/locale/en/LC_MESSAGES/hands-on.po

Lines changed: 115 additions & 40 deletions
Large diffs are not rendered by default.

docs/source/locale/en/LC_MESSAGES/index.po

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
msgstr ""
1010
"Project-Id-Version: adf-core-python \n"
1111
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2024-12-19 13:59+0900\n"
12+
"POT-Creation-Date: 2025-11-22 21:57+0900\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1515
"Language: en\n"
@@ -18,25 +18,29 @@ msgstr ""
1818
"MIME-Version: 1.0\n"
1919
"Content-Type: text/plain; charset=utf-8\n"
2020
"Content-Transfer-Encoding: 8bit\n"
21-
"Generated-By: Babel 2.16.0\n"
21+
"Generated-By: Babel 2.17.0\n"
2222

23-
#: ../../source/index.rst:35
23+
#: ../../source/index.rst:40
2424
msgid "インストール"
2525
msgstr "Installation"
2626

27-
#: ../../source/index.rst:42
27+
#: ../../source/index.rst:47
2828
msgid "クイックスタート"
2929
msgstr "Quick Start"
3030

31-
#: ../../source/index.rst:48
31+
#: ../../source/index.rst:53
3232
msgid "チュートリアル"
3333
msgstr "Tutorial"
3434

35-
#: ../../source/index.rst:58
35+
#: ../../source/index.rst:63
3636
msgid "ハンズオン"
3737
msgstr "Hands-On"
3838

39-
#: ../../source/index.rst:65
39+
#: ../../source/index.rst:70
40+
msgid "開発ガイド"
41+
msgstr "Development Guide"
42+
43+
#: ../../source/index.rst:76
4044
msgid "APIドキュメント"
4145
msgstr "API Documentation"
4246

@@ -50,49 +54,61 @@ msgstr "This package is currently under development. Breaking changes may occur.
5054

5155
#: ../../source/index.rst:15
5256
msgid "パッケージとしてまだ公開していないため、pip でインストールすることはできません。"
53-
msgstr "Since it has not been released as a package yet, it cannot be installed via pip."
57+
msgstr ""
58+
"Since it has not been released as a package yet, it cannot be installed "
59+
"via pip."
5460

5561
#: ../../source/index.rst:19
5662
msgid "以下の言語のドキュメントは機械翻訳を使用しています。翻訳の正確性については保証できません。 英語"
57-
msgstr "The following language documents use machine translation. The accuracy of the translation cannot be guaranteed. English"
63+
msgstr ""
64+
"The following language documents use machine translation. The accuracy of"
65+
" the translation cannot be guaranteed. English"
5866

59-
#: ../../source/index.rst:19
67+
#: ../../source/index.rst:24
6068
msgid "概要"
6169
msgstr "Overview"
6270

63-
#: ../../source/index.rst:20
71+
#: ../../source/index.rst:25
6472
msgid ""
6573
"adf-core-pythonは、RoboCup Rescue "
6674
"Simulation(RRS)におけるエージェント開発を支援するためのライブラリ及びフレームワークです。 adf-core-"
6775
"pythonを使用することで、エージェントの開発を効率化し、再利用性を向上させることができます。"
6876
msgstr ""
69-
"adf-core-python is a library and framework to support agent development in RoboCup Rescue "
70-
"Simulation (RRS). By using adf-core-python, you can streamline agent development and improve reusability."
77+
"adf-core-python is a library and framework to support agent development "
78+
"in RoboCup Rescue Simulation (RRS). By using adf-core-python, you can "
79+
"streamline agent development and improve reusability."
7180

72-
#: ../../source/index.rst:24
81+
#: ../../source/index.rst:29
7382
msgid "特徴"
7483
msgstr "Features"
7584

76-
#: ../../source/index.rst:25
85+
#: ../../source/index.rst:30
7786
msgid "adf-core-pythonには以下のような特徴があります。"
7887
msgstr "adf-core-python has the following features:"
7988

80-
#: ../../source/index.rst:27
89+
#: ../../source/index.rst:32
8190
msgid "**モジュール単位での開発**: モジュール単位でエージェント開発を行い、モジュールの入れ替えが容易です。"
82-
msgstr "**Module-based development**: Develop agents on a module basis, making it easy to replace modules."
91+
msgstr ""
92+
"**Module-based development**: Develop agents on a module basis, making it"
93+
" easy to replace modules."
8394

84-
#: ../../source/index.rst:28
95+
#: ../../source/index.rst:33
8596
msgid "**モジュールの再利用**: 他のエージェントで使用されているモジュールを再利用することができます。"
8697
msgstr "**Module reuse**: Reuse modules used by other agents."
8798

88-
#: ../../source/index.rst:29
99+
#: ../../source/index.rst:34
89100
msgid "**エージェントの開発に集中**: シミュレーションサーバーとの通信やログ出力などの共通処理をライブラリが提供します。"
90-
msgstr "**Focus on agent development**: The library provides common processing such as communication with the simulation server and log output."
101+
msgstr ""
102+
"**Focus on agent development**: The library provides common processing "
103+
"such as communication with the simulation server and log output."
91104

92-
#: ../../source/index.rst:32
105+
#: ../../source/index.rst:37
93106
msgid "はじめに"
94107
msgstr "Getting Started"
95108

96-
#: ../../source/index.rst:33
109+
#: ../../source/index.rst:38
97110
msgid "adf-core-pythonを始めるには、インストールに従い、このドキュメントに記載されているチュートリアルやハンズオンを参照してください。"
98-
msgstr "To get started with adf-core-python, follow the installation and refer to the tutorials and hands-on in this document."
111+
msgstr ""
112+
"To get started with adf-core-python, follow the installation and refer to"
113+
" the tutorials and hands-on in this document."
114+

0 commit comments

Comments
 (0)