← GDG /

#266 gdtest_i18n_japanese

#266 gdtest_i18n_japanese OK CONFIG
i18n test with Japanese (CJK script). Docstrings, user guide, and metadata are written in Japanese for full native-language experience.
i18n test with Japanese (CJK script). Sets site.language: ja and enables every translatable widget. Verifies CJK characters render correctly across navbar labels, tooltips, timestamps, and accessibility attributes.
View Site → Build Log 🧪 Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

K51
K51i18n: Japanese (CJK)config

Source Files

📁 gdtest_i18n_japanese/
📄 __init__.py
"""科学計算のための電卓ユーティリティ。"""

__version__ = "0.1.0"
__all__ = [
    "Calculator",
    "add",
    "multiply",
    "divide",
]


class Calculator:
    """
    メモリ機能付きの電卓。

    基本的な四則演算をサポートし、累計値を
    保持します。リセットも可能です。

    Parameters
    ----------
    precision : int
        結果の小数点以下の桁数。

    See Also
    --------
    add
        二つの数値を加算する。
    multiply
        二つの数値を乗算する。

    Examples
    --------
    >>> calc = Calculator(precision=2)
    >>> calc.add_to_total(3.14159)
    3.14

    .. versionadded:: 0.1.0
    """

    def __init__(self, precision: int = 2):
        self.precision = precision
        self._total = 0.0

    def add_to_total(self, value: float) -> float:
        """
        累計に値を加算する。

        Parameters
        ----------
        value : float
            加算する値。

        Returns
        -------
        float
            設定された精度で丸められた更新後の累計。
        """
        self._total += value
        return round(self._total, self.precision)

    def reset(self) -> None:
        """
        累計をゼロにリセットする。
        """
        self._total = 0.0

    def get_total(self) -> float:
        """
        現在の累計を返す。

        Returns
        -------
        float
            現在の累計値。
        """
        return round(self._total, self.precision)


def add(a: float, b: float) -> float:
    """
    二つの数値を加算する。

    Parameters
    ----------
    a : float
        第一オペランド。
    b : float
        第二オペランド。

    Returns
    -------
    float
        a と b の和。

    See Also
    --------
    multiply
        二つの数値を乗算する。
    divide
        二つの数値を除算する。
    Calculator
        メモリ機能付きの電卓。

    .. versionchanged:: 0.1.0 戻り値の型が int から float に変更されました。
    """
    return a + b


def multiply(a: float, b: float) -> float:
    """
    二つの数値を乗算する。

    Parameters
    ----------
    a : float
        第一オペランド。
    b : float
        第二オペランド。

    Returns
    -------
    float
        a と b の積。

    See Also
    --------
    add
        二つの数値を加算する。
    divide
        二つの数値を除算する。
    """
    return a * b


def divide(a: float, b: float) -> float:
    """
    二つの数値を除算する。

    Parameters
    ----------
    a : float
        被除数。
    b : float
        除数。ゼロは不可。

    Returns
    -------
    float
        a を b で割った商。

    Raises
    ------
    ZeroDivisionError
        b がゼロの場合。

    .. deprecated:: 0.1.0
        Calculator.divide() メソッドを使用してください。
    """
    return a / b
📁 user_guide/
📄 01-quickstart.qmd
---
title: "クイックスタート"
guide-section: "はじめに"
---

# クイックスタート

電卓パッケージの基本的な使い方を紹介します。

## インストール

pip でインストールします:

```bash
pip install gdtest-i18n-japanese
```

## 基本的な使い方

```python
from gdtest_i18n_japanese import Calculator

calc = Calculator(precision=3)
calc.add_to_total(10.5)
calc.add_to_total(20.3)
print(calc.get_total())  # 30.8
```
📄 02-functions.qmd
---
title: "関数リファレンス"
guide-section: "はじめに"
---

# 関数リファレンス

個別の算術関数を使った簡単な計算方法を紹介します。

```python
from gdtest_i18n_japanese import add, multiply, divide

result = add(10, 20)
product = multiply(3, 7)
quotient = divide(100, 4)
```

## 利用可能な関数

| 関数       | 説明               |
|------------|------------------------|
| `add`      | 二つの数値を加算   |
| `multiply` | 二つの数値を乗算   |
| `divide`   | 二つの数値を除算   |
📄 03-table-explorer.qmd
---
title: "テーブルエクスプローラー"
guide-section: "はじめに"
---

# テーブルエクスプローラー

`tbl_explorer()` を使ってデータをインタラクティブに探索できます。

```{python}
#| echo: false
import tempfile
from great_docs import tbl_explorer
rows = "名前,年齢,都市,得点\n太郎,28,東京,92.5\n花子,35,大阪,87.3\n次郎,22,京都,95.1\n美月,41,横浜,78.6\n健,30,福岡,88.9\nさくら,27,名古屋,91.2\n誠,33,札幌,84.7"
tf = tempfile.NamedTemporaryFile(mode="w", suffix=".csv", delete=False)
tf.write(rows)
tf.close()
tbl_explorer(tf.name)
```
📄 README.md
# gdtest-i18n-japanese

科学計算のための電卓ユーティリティ。

## 機能

- メモリ機能付き電卓クラス
- 基本的な四則演算関数
- 精度設定が可能

## ライセンス

MIT
📄 great-docs.yml
site:
  language: ja
announcement: ようこそ!新しいクイックスタートガイドをご覧ください。
github_url: "https://github.com/test-org/gdtest-i18n-japanese"
dark_mode_toggle: true
back_to_top: true
copy_code: true
page_metadata: true
funding:
  name: 科学技術振興財団