diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79b826a483f..f101bd3f7cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,26 +6,26 @@ Thanks for your interest in contributing to Ionic's documentation! :tada: Check TABLE OF CONTENTS -- [Development Workflow](#development-workflow) - - [Previewing Changes](#previewing-changes) +- [開発ワークフロー](#development-workflow) + - [変更のプレビュー](#previewing-changes) - [Checking Links](#checking-links) - - [Linting Documentation](#linting-documentation) - - [Spell Check](#spell-check) + - [ドキュメントのリンティング](#linting-documentation) + - [スペルチェック](#spell-check) - [Heading IDs](#heading-ids) -- [Using VS Code on Windows](#using-vs-code-on-windows) -- [Project Structure](#project-structure) - - [Directories](#directories) -- [Authoring Content](#authoring-content) +- [Windows での VS Code の使用](#using-vs-code-on-windows) +- [プロジェクト構造](#project-structure) + - [ディレクトリ](#directories) +- [コンテンツ作成](#authoring-content) - [Admonitions](#admonitions) - - [Links and Headings](#links-and-headings) + - [リンクと見出し](#links-and-headings) - [Playgrounds](#playgrounds) - - [Reference Content](#reference-content) -- [Translation](#translation) -- [Reporting Issues](#reporting-issues) -- [Pull Request Guidelines](#pull-request-guidelines) -- [Deploying](#deploying) - - [Archiving a Version](#archiving-a-version) -- [License](#license) + - [参照コンテンツ](#reference-content) +- [翻訳](#translation) +- [問題報告](#reporting-issues) +- [プルリクエストガイドライン](#pull-request-guidelines) +- [デプロイ](#deploying) + - [バージョンのアーカイブ](#archiving-a-version) +- [ライセンス](#license) --- @@ -33,7 +33,7 @@ Thanks for your interest in contributing to Ionic's documentation! :tada: Check ### Previewing Changes -In order to run the documentation locally, use Node.js 24 or later, install the dependencies and run the development server: +ローカルでドキュメントを表示するには、Node.js 24 以降を使い、依存関係をインストールして開発サーバーを起動します。 ```sh npm ci @@ -42,53 +42,53 @@ npm start #### GitHub Token -The documentation build requires a GitHub Personal Access Token to fetch Ionic Framework release notes. The build still works locally without it, with an empty release notes page, but Vercel preview and production builds fail without it. +ドキュメントのビルドでは、Ionic Framework のリリースノートの取得に GitHub Personal Access Token を使います。ローカルではトークンがなくてもビルドできますが、リリースノートのページは空になります。Vercel のプレビューと本番のビルドにはトークンが必須です。 -**Local Development:** +**ローカル開発:** -1. Create a [fine-grained Personal Access Token](https://github.com/settings/personal-access-tokens/new) with: +1. 次の条件で[fine-grained Personal Access Token](https://github.com/settings/personal-access-tokens/new)を作成する: - **Repository access**: Public repositories (read-only) - - **Expiration**: 366 days (update annually) + - **Expiration**: 366 日(毎年更新) -2. Add the token to your shell profile (`~/.zshrc`, `~/.bashrc`, etc.): +2. トークンをシェルのプロファイルに追加します(`~/.zshrc`、`~/.bashrc`、など): ```sh export GITHUB_TOKEN=github_pat_... ``` -3. Reload your shell or run `source ~/.zshrc` (or equivalent) +3. シェルをリロードするか、`source ~/.zshrc`(または同等のもの)を実行してください **Vercel:** -1. Create a [fine-grained Personal Access Token](https://github.com/settings/personal-access-tokens/new) with the same settings as above, but with: +1. 上記と同じ設定で、ただし以下の条件で[fine-grained Personal Access Token](https://github.com/settings/personal-access-tokens/new)を作成します: - - **Owner**: ionic-team organization (not your personal account) + - **Owner**: ionic-team 組織(あなたの個人アカウントではありません) -2. Add the token to Vercel project settings: +2. トークンを Vercel プロジェクトの設定に追加してください: - - Go to your project on Vercel - - Navigate to **Settings → Environment Variables** - - Add `GITHUB_TOKEN` with the token value - - Select Production and Preview environments + - Vercel でプロジェクトに移動する + - **Settings → Environment Variables**に移動する + - `GITHUB_TOKEN`をトークン値で追加する + - Production と Preview の環境を選択する -3. Redeploy the project for the token to take effect +3. トークンを有効にするためにプロジェクトを再デプロイする -If the token is missing, Vercel builds fail with `GITHUB_TOKEN environment variable is required.` +トークンがない場合、Vercel のビルドは `GITHUB_TOKEN environment variable is required.` というエラーで失敗します。 ### Checking Links -The development server does not check for broken links or anchors. Only a build does, and it fails on any it finds. Build the site before pushing a change that adds or moves links or headings: +開発サーバーではリンク切れやアンカーの有無を検証しません。ビルド時に検証し、問題が見つかるとビルドが失敗します。リンクや見出しを追加・移動した場合は、push の前にサイトをビルドしてください。 ```sh npm run build:preview ``` -This builds the English site only, the same build as a Vercel preview. +Vercel のプレビューと同じく、英語版のサイトだけをビルドします。 ### Linting Documentation -This repository uses [ESLint](https://eslint.org/) to catch markup the build cannot check, such as raw links and headings and misaligned JSDoc comments, and [Prettier](https://prettier.io/), an opinionated code formatter, to keep consistent formatting throughout the documentation. Run the following command to report ESLint errors and automatically fix all formatting, and then push any changes: +このリポジトリでは [ESLint](https://eslint.org/) を使って、HTML で直接書かれたリンクや見出し、位置がずれた JSDoc コメントなど、ビルドで検出できない問題をチェックします。また、[Prettier](https://prettier.io/) でドキュメント全体の書式を統一しています。次のコマンドで ESLint のエラーを確認し、書式を自動修正して、変更を push してください。 ``` npm run lint @@ -141,13 +141,13 @@ In general, we should try to avoid ignoring words unless they are technical term ### Heading IDs -Every heading in `docs/` needs an explicit ID, so that renaming the heading doesn't change its anchor and break links to it: +`docs/` 内の見出しには明示的な ID が必要です。見出しの名前を変えてもアンカーが変わらず、リンクが有効なままになります。 ```mdx ## Basic Usage {/* #basic-usage */} ``` -Run the following command to add IDs to any new headings, and then push the changes. CI fails if a heading is missing one. +次のコマンドで新しい見出しに ID を追加し、変更を push してください。ID のない見出しがあると CI が失敗します。 ``` npm run heading-ids @@ -157,7 +157,7 @@ npm run heading-ids ## Using VS Code on Windows -Prettier expects LF line endings, and CI fails if `npm run lint` changes any file. To contribute on Windows, do the following: +Prettier は LF 改行を前提としており、`npm run lint` がファイルを書き換えると CI が失敗します。Windows で開発する場合は次の手順に従ってください。 - Configure VS Code to read/save files using line breaks (LF) instead of carriage returns (CRLF). Set it globally by navigating to: Settings -> Text Editor -> Files -> Eol. Set to `\n`. - Check that the Git setting `core.autocrlf` is set to `false`: run `git config -l | grep autocrlf`. Switch it to false using: `git config --global core.autocrlf false`. @@ -169,19 +169,19 @@ Ionic's documentation is built using [Docusaurus](https://docusaurus.io/). The c ### Directories -- `_templates/` - templates used by `npm run playground:new` -- `docs/` - content of the current version of the docs -- `plugins/` - local Docusaurus plugins, such as the one that generates the component API pages +- `_templates/` - `npm run playground:new` が使用するテンプレート +- `docs/` - 現行版のドキュメント本文 +- `plugins/` - コンポーネントの API ページ生成などに使う、このリポジトリの Docusaurus プラグイン - `scripts/` - build scripts used to generate markdown or json files -- `src/` - source code of the site +- `src/` - サイトのソースコード - `components/` - components used across the site - `global/` - components used globally - `page/` - components used on a single page or in a limited scope - - `css/` - global styles, refer to its [README](src/css/README.md) - - `theme/` - overrides for the markup Docusaurus's theme renders - - `theme/` - Docusaurus theme components that have been swizzled + - `css/` - グローバルスタイル。詳細は [README](src/css/README.md) を参照してください + - `theme/` - Docusaurus テーマがレンダリングするマークアップに適用するスタイルの上書き + - `theme/` - swizzle した Docusaurus のテーマコンポーネント - `static/` - - `code/` - StackBlitz project templates used by the playgrounds + - `code/` - Playground で使用する StackBlitz のプロジェクトテンプレート - `demos/` - self-contained demos, optionally presented by pages via `demoUrl` YAML frontmatter - `usage/` - playgrounds that can be created by running `npm run playground:new` [(docs)](_templates/README.md#new-playground-template) - `versioned_docs/` - versions of the docs created by the docusaurus versioning command @@ -198,21 +198,21 @@ The content of the Ionic docs is written as [Markdown](https://commonmark.org/) /docs/v8/intro/cli => versioned_docs/version-v8/intro/cli.mdx ``` -`/docs` maps to `docs/index.mdx` through `slug: /` in its frontmatter. Older versions live in `versioned_docs/` and are served under their version, such as `/docs/v8/`. +`/docs` は frontmatter の `slug: /` によって `docs/index.mdx` に対応します。旧版は `versioned_docs/` にあり、`/docs/v8/` のようにバージョンごとのパスで公開されます。 -Every page needs a `description` in its frontmatter. Docusaurus uses it for the meta description, link previews, and llms.txt, and `npm run lint` flags a page without one. Files and folders whose names start with `_` are not pages, so use that prefix for a file that other pages only import, such as `developing/config/_global.mdx`. +各ページの frontmatter には `description` が必要です。Docusaurus はこれを meta description、リンクプレビュー、llms.txt に使います。説明がないページは `npm run lint` で検出されます。名前が `_` で始まるファイルやフォルダーはページとして扱われないため、`developing/config/_global.mdx` のように他のページから import するだけのファイルにはこの接頭辞を使ってください。 -The frontmatter `title` names the page everywhere: its heading, the sidebar, cards, and link previews. To show a longer title only in search results and the browser tab, put it in ``, such as `ion-button: Style Buttons with Custom CSS Properties`. A description in `` has no such use, since Docusaurus only reads it from the frontmatter. +frontmatter の `title` は、見出し、サイドバー、カード、リンクプレビューに表示されるページ名です。検索結果とブラウザーのタブだけに長いタイトルを表示するには、`ion-button: Style Buttons with Custom CSS Properties` のように `` に記述します。説明文は frontmatter からのみ読み込まれるため、`` に書いてもこの用途には使われません。 -Versions listed in [`versions.json`](versions.json) are actively maintained. If your change also applies to one of them, make the same change in its `versioned_docs/version-/` folder. Versions listed in [`versionsArchived.json`](versionsArchived.json) are frozen deployments that are no longer built, so changes to their folders never reach the site. +[`versions.json`](versions.json) にあるバージョンはメンテナンス対象です。変更が旧版にも該当する場合は、その `versioned_docs/version-/` フォルダーにも同じ変更を加えてください。[`versionsArchived.json`](versionsArchived.json) にあるバージョンはデプロイ済みの状態で固定され、再ビルドされないため、フォルダーを更新しても公開サイトには反映されません。 -Markdown links resolve within their own version, but JSX paths such as `` and `useBaseUrl` do not. In an older version, prefix them with the version, such as ``. +Markdown のリンクは同じバージョン内で解決されます。`` や `useBaseUrl` のような JSX のパスでは、旧版の場合に `` のようにバージョンを先頭に付けてください。 -You can make copy edits to the site by [editing the Markdown files directly on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). In your pull request, please explain what was missing from or inaccurate about the content. +文章を修正するには、[GitHub 上で Markdown ファイルを直接編集](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files)できます。Pull Request には、足りなかった情報や不正確だった箇所を記載してください。 ### Admonitions -Give an admonition a title with square brackets. The older `:::note My Title` form renders as plain text with no build error, so CI fails on it: +注記のタイトルは角括弧で囲みます。古い `:::note My Title` 形式はビルドエラーにならず、そのままテキストとして表示されるため、CI でエラーにしています。 ```mdx :::note[My Title] @@ -222,20 +222,20 @@ Content ::: ``` -Keep the blank lines after the opening marker, before the closing `:::`, and after it. `npm run lint` puts each paragraph on one line, so without them it merges the markers into the surrounding text and the admonition renders as plain text. +開始マーカーの直後、終了マーカー `:::` の直前と直後に空行を残してください。`npm run lint` は段落を1行にまとめるため、空行がないとマーカーが前後のテキストに連結され、注記が通常のテキストとして表示されます。 ### Links and Headings -Use Markdown for links and headings whenever possible. When you need JSX, such as inside a component prop or in `src/`, use the Docusaurus components instead of raw HTML: +リンクと見出しにはできるだけ Markdown を使います。コンポーネントの prop や `src/` 内など、JSX が必要な場合は、HTML タグの代わりに次の Docusaurus コンポーネントを使ってください。 -- [``](https://docusaurus.io/docs/docusaurus-core#link) from `@docusaurus/Link` instead of ``. It handles the base URL and locale, and opens external URLs in a new tab with `rel="noopener noreferrer"`. -- [``](https://docusaurus.io/docs/api/misc/@docusaurus/eslint-plugin/prefer-docusaurus-heading) from `@theme/Heading` instead of `

` to `

`. +- `` の代わりに `@docusaurus/Link` の [``](https://docusaurus.io/docs/docusaurus-core#link) を使います。ベース URL とロケールを処理し、外部 URL は `rel="noopener noreferrer"` を付けて新しいタブで開きます。 +- `

` から `

` までの見出しには、`@theme/Heading` の [``](https://docusaurus.io/docs/api/misc/@docusaurus/eslint-plugin/prefer-docusaurus-heading) を使います。 -Link to another doc by its relative file path, with the extension, such as `[Accordion](./accordion.mdx)` or `[Config](../developing/config.mdx)`. Docusaurus resolves it to the page in the same version, the build fails if the file doesn't exist, and editors can follow it to the file. A JSX prop such as `href` skips that step, so use the URL path without `/docs` or an extension instead: `/api/accordion`, or `/v8/api/accordion` on a v8 page. In either form, don't link to a doc by its full `ionicframework.com/docs` URL, which always opens the current version. `npm run lint` flags a link that doesn't follow this, though it only catches a full URL in a Markdown link. +別のドキュメントには `[Accordion](./accordion.mdx)` や `[Config](../developing/config.mdx)` のように拡張子付きの相対ファイルパスでリンクします。Docusaurus は同じバージョンのページに解決し、ファイルがなければビルドが失敗します。エディターでもリンクからファイルを開けます。`href` のような JSX の prop はこの処理を経ないため、`/api/accordion`、v8 のページなら `/v8/api/accordion` のように、`/docs` と拡張子を省いた URL パスを使います。どちらの形式でも、常に現行版を開く `ionicframework.com/docs` の完全な URL は使わないでください。`npm run lint` はこの規則に従わないリンクを検出しますが、完全な URL を検出できるのは Markdown リンク内だけです。 -The build only checks links and anchors that go through Markdown or these components. A raw `` to a page that doesn't exist builds without errors, and a raw heading's `id` can't be used as a link target. +ビルドが検証するのは Markdown またはこれらのコンポーネントを介したリンクとアンカーです。`` を直接書くと、存在しないページへのリンクもビルドを通過します。HTML の見出しに直接指定した `id` もリンク先には使えません。 -Markup inside code samples is exempt, since it's example code rather than part of the page. CI fails on a raw `` or heading anywhere else. To check before pushing, run: +サンプルコード内のマークアップはページ自体の一部ではないため対象外です。それ以外の場所に `` や HTML の見出しを直接書くと CI が失敗します。push の前に次のコマンドで確認できます。 ``` npm run lint @@ -243,15 +243,15 @@ npm run lint ### Playgrounds -A playground is the interactive example on a component page. It shows a live demo that switches between iOS and Material Design modes, the code for JavaScript, Angular, React and Vue, and a button to open the example in StackBlitz. +Playground はコンポーネントのページにある操作可能なサンプルです。iOS と Material Design の表示を切り替えられるデモ、JavaScript、Angular、React、Vue のコード、StackBlitz でサンプルを開くボタンが含まれます。 -Each playground is a folder in `static/usage////`: +各 Playground は `static/usage////` 内のフォルダーにあり、次のファイルで構成されます。 -- `demo.html`: the live demo, so update it along with the framework code -- `javascript.md`, `react.md`, `vue.md` and `angular/`: the code shown for each framework -- `index.mdx`: renders the `Playground` component with those files +- `demo.html` - 実際に動作するデモ。各フレームワークのコードと一緒に更新します +- `javascript.md`、`react.md`、`vue.md`、`angular/` - 各フレームワークで表示するコード +- `index.mdx` - これらのファイルを使って `Playground` コンポーネントを表示します -Run the following command to generate a playground, and then import its `index.mdx` into the page: +次のコマンドで Playground を生成し、その `index.mdx` をページに import してください。 ``` npm run playground:new @@ -263,17 +263,17 @@ import Basic from '@site/static/usage/v9/button/basic/index.mdx'; ``` -For the generator's prompts, refer to the [playground template docs](_templates/README.md#new-playground-template). For the `Playground` options, refer to its [README](src/components/global/Playground/README.md). +ジェネレーターで入力する項目は [Playground テンプレートのドキュメント](_templates/README.md#new-playground-template) を、`Playground` のオプションは [README](src/components/global/Playground/README.md) を参照してください。 ### Reference Content The Markdown in `docs/` does not only contain manually written markdown files: -- The properties, events, methods, and other API tables on `/docs/api/*` pages are built from the [Ionic Framework](https://github.com/ionic-team/ionic-framework) source code -- Paths matching `/docs/native/*` are built from the [Capacitor plugins](https://github.com/ionic-team/capacitor-plugins) READMEs +- `/docs/api/*` ページのプロパティ、イベント、メソッドなどの API 表は [Ionic Framework](https://github.com/ionic-team/ionic-framework) のソースコードから生成します +- `/docs/native/*` に一致するパスは [Capacitor plugins](https://github.com/ionic-team/capacitor-plugins) の README から生成します - Paths matching `/docs/cli/commands/*` are built from the [Ionic CLI](https://github.com/ionic-team/ionic-cli) source code -The `native/` and `cli/commands/` pages are generated when you run `npm start` or build the site, and they are not committed. To change them, edit the plugin's README in [capacitor-plugins](https://github.com/ionic-team/capacitor-plugins) or the command's source in [ionic-cli](https://github.com/ionic-team/ionic-cli). +`native/` と `cli/commands/` のページは `npm start` の実行時またはサイトのビルド時に生成され、コミット対象には含まれません。変更するには [capacitor-plugins](https://github.com/ionic-team/capacitor-plugins) のプラグインの README、または [ionic-cli](https://github.com/ionic-team/ionic-cli) のコマンドのソースを編集してください。 ## Translation @@ -285,7 +285,7 @@ _Please submit translation issues to the Crowdin page and not the Ionic Docs Git -The Japanese translation of the docs were built by an independent team, led by [rdlabo](https://github.com/rdlabo) and can be found and contributed to on the [ionic-jp group's `ionic-docs` project page](https://github.com/ionic-jp/ionic-docs). +日本語訳は [rdlabo](https://github.com/rdlabo) が率いる独立したチームが作成しています。翻訳の閲覧やコントリビューションは [ionic-jp の `ionic-docs` プロジェクトページ](https://github.com/ionic-jp/ionic-docs) から行えます。 ## Reporting Issues @@ -296,7 +296,7 @@ If the issue you're reporting is a bug, please be sure it is an issue with the I - Steps to reproduce - Expected behavior - OS and browser versions -- If possible, a demo repo or StackBlitz +- 可能であれば、デモ用のリポジトリまたは StackBlitz > [!NOTE] > Some [reference content](#reference-content) is pulled from other Ionic repos. In that case, please submit your issue on the docs repo with a link to the repo where the content lives. @@ -307,9 +307,9 @@ If the issue you're reporting is a bug, please be sure it is an issue with the I When submitting pull requests, please keep the scope of your change contained to a single feature or bug. When in doubt, err on the side of smaller pull requests. If your pull request is a new feature, we would recommend opening an issue first to come to an agreement about the feature before putting in significant time. -Title your pull request in the [Conventional Commits](https://www.conventionalcommits.org/) format, such as `docs(button): add an icon-only example`. Pull requests are squash merged, so the title becomes the commit message on `main`. +Pull Request のタイトルは `docs(button): add an icon-only example` のように [Conventional Commits](https://www.conventionalcommits.org/) の形式で書いてください。Squash merge するため、タイトルが `main` 上のコミットメッセージになります。 -Each pull request gets a Vercel preview deployment. Use it to check your change on the built site. +Pull Request ごとに Vercel のプレビューが作成されます。ビルド後のサイトで変更を確認してください。 --- @@ -319,21 +319,21 @@ The Ionic documentation's `main` branch is deployed automatically and separately ### Archiving a Version -Archived versions are served from a frozen Vercel deployment instead of being rebuilt on every `main` deploy, which keeps build times and memory usage low. That deployment is a full snapshot of the site, so it serves every version that was in the build. Two files control this: +アーカイブしたバージョンは固定した Vercel デプロイから配信します。`main` のデプロイのたびに再ビルドしないため、ビルド時間とメモリ使用量を抑えられます。そのデプロイにはサイト全体が保存され、ビルドに含まれたすべてのバージョンを配信します。設定には次の2ファイルを使います。 -- [`versions.json`](./versions.json): lists the older versions Docusaurus rebuilds on every deploy. It does not include the current version, which is built from `docs/` and takes its label from `versions.current` in `docusaurus.config.js`. -- [`versionsArchived.json`](./versionsArchived.json): maps each archived version to the frozen deployment URL the version picker links to. +- [`versions.json`](./versions.json) - Docusaurus がデプロイのたびに再ビルドする旧版の一覧です。現行版は `docs/` からビルドされ、`docusaurus.config.js` の `versions.current` をラベルに使うため、この一覧には含まれません。 +- [`versionsArchived.json`](./versionsArchived.json):各アーカイブされたバージョンを、バージョンピッカーがリンクする固定されたデプロイ URL にマッピングします。 -The docs keep the current version plus one older version rebuildable, so each major release archives one version and involves two different version numbers. The steps below refer to them as: +再ビルドの対象は現行版と1つ前のバージョンです。メジャーリリースごとに1つの版をアーカイブするため、手順には2つのバージョン番号が登場します。以下ではそれぞれを次のように表記します。 -- ``: the version being frozen and removed from `versions.json`. -- ``: the version that just stopped being current and moved into `versions.json`. It is not being archived, but step 1 has to account for it. +- `` - 配信内容を固定し、`versions.json` から削除するバージョン。 +- `` - 現行版から旧版になり、`versions.json` に移ったバージョン。アーカイブの対象ではありませんが、手順1で考慮します。 -For example, when `v9` becomes current: `v8` is `` and `v7` is ``. +たとえば `v9` が現行版になるとき、`v8` は ``、`v7` は `` に該当します。 -The archived URL has to point at a build that _included_ ``, so you build it first, then move it to `versionsArchived.json`: +アーカイブ先の URL は `` を含むビルドを指す必要があります。先にビルドしてから `versionsArchived.json` に移します。 -1. **Check the `vercel.json` redirects.** The frozen deployment bakes in whatever `vercel.json` looked like at build time, and it serves every version in that build. Any `:version(...)` group missing a version therefore stays broken on that host for good. Make sure the groups already list ``, which is the one most likely to be missing since it only just moved into `versions.json`. The `angular`, `react`, `vue` and `javascript` landing pages each need a group, as no version ships an index page for them: +1. **`vercel.json` のリダイレクトを確認します。** 固定したデプロイにはビルド時点の `vercel.json` が組み込まれ、そのビルドの全バージョンに適用されます。`:version(...)` グループに含まれないバージョンのリダイレクトは、そのホスト上では後から直せません。特に `` は `versions.json` に移ったばかりで漏れやすいため、各グループに含まれることを確認してください。`angular`、`react`、`vue`、`javascript` にはどのバージョンにも index ページがないため、それぞれのランディングページにグループが必要です。 ```json { @@ -346,14 +346,14 @@ The archived URL has to point at a build that _included_ ``, so you b } ``` - The groups accumulate, so existing entries stay in place whether or not that version is archived and you are only ever adding to them. The `javascript` group only covers versions that have a `javascript/` section. + グループにはバージョンを追加していきます。既存の項目はアーカイブ後も残してください。`javascript` グループの対象は `javascript/` セクションがあるバージョンだけです。 -Everything from here on refers to ``: +以降の手順は `` が対象です。 -2. **Build ``.** Make sure it is in `versions.json`. If you are refreshing an already-archived version, move it out of `versionsArchived.json` and back into `versions.json`, and add it back to the generation scripts in step 10. Commit, push and let Vercel deploy. -3. **Promote the deployment.** In the Vercel dashboard, open that deployment and **Promote to Production** so it does not get cleaned up. Wait for the build to finish before pushing again, or it may get canceled. -4. **Copy its URL.** Use the deployment's unique `ionic-docs--ionic1.vercel.app` URL, not the branch or production alias. -5. **Archive it.** Remove `` from `versions.json`, then add it to `versionsArchived.json` with `/docs/` appended and no trailing slash (a trailing slash causes a brief 404 flash): +2. **`` をビルドします。** `versions.json` に含まれることを確認します。すでにアーカイブ済みのバージョンを更新する場合は、`versionsArchived.json` から `versions.json` に戻し、手順10の生成スクリプトにも追加し直します。コミットして push し、Vercel のデプロイを待ちます。 +3. **デプロイを本番に昇格します。** Vercel ダッシュボードで対象のデプロイを開き、クリーンアップの対象から外すため **Promote to Production** を選びます。ビルドがキャンセルされることがあるため、完了するまで次の push を待ってください。 +4. **URL をコピーします。** ブランチや本番のエイリアスではなく、そのデプロイ固有の `ionic-docs--ionic1.vercel.app` URL を使います。 +5. **アーカイブします。** `` を `versions.json` から削除し、`/docs/` を付けた URL とともに `versionsArchived.json` に追加します。末尾にスラッシュを付けると一瞬 404 が表示されるため、省いてください。 _`versions.json`_ @@ -375,14 +375,14 @@ Everything from here on refers to ``: } ``` -6. **Update `.prettierignore`.** Add the archived version folders to the archived versions group to keep Prettier from formatting generated files: +6. **`.prettierignore` を更新します。** Prettier が生成ファイルを整形しないよう、アーカイブしたバージョンのフォルダーを既存のアーカイブ用グループに追加します。 ``` static/usage/ versioned_docs/version- ``` -7. **Update `cspell.json`.** Add the archived version to the `ignorePaths` array so the spell checker skips generated files: +7. **`cspell.json` を更新します。** スペルチェッカーが生成ファイルをスキップするよう、アーカイブしたバージョンを `ignorePaths` 配列に追加します。 ```diff "ignorePaths": [ @@ -393,7 +393,7 @@ Everything from here on refers to ``: ] ``` -8. **Update `renovate.json`.** Add the archived version's StackBlitz examples to `ignorePaths` so Renovate stops opening dependency PRs against frozen examples: +8. **`renovate.json` を更新します。** アーカイブ済みサンプルの依存関係について Renovate が PR を作らないよう、そのバージョンの StackBlitz サンプルを `ignorePaths` に追加します。 ```diff "ignorePaths": [ @@ -402,16 +402,16 @@ Everything from here on refers to ``: ] ``` - Then remove that version's `@ionic/` `allowedVersions` rule from `packageRules`, since it no longer has anything to match. + 一致する対象がなくなるため、そのバージョンの `@ionic/` の `allowedVersions` ルールを `packageRules` から削除します。 -9. **Update the playground generator.** Remove `` from the version choices in [`_templates/playground/new/index.js`](./_templates/playground/new/index.js) so `npm run playground:new` stops offering a version that is no longer built. The choices are bare numbers, without the `v`: +9. **Playground ジェネレーターを更新します。** `npm run playground:new` がビルド対象外のバージョンを提示しないよう、[`_templates/playground/new/index.js`](./_templates/playground/new/index.js) の選択肢から `` を削除します。選択肢は数字だけで、`v` は付けません。 ```diff - choices: ['', '8', '9'], + choices: ['8', '9'], ``` -10. **Update the generation scripts.** Remove `` from the write lists in [`scripts/native.mjs`](./scripts/native.mjs) and [`scripts/cli.mjs`](./scripts/cli.mjs), so every build stops regenerating content for a version served from a frozen deployment. The remaining targets are `docs/` (the current version) and the one older version still in `versions.json`. +10. **生成スクリプトを更新します。** 固定デプロイから配信する版のコンテンツを毎回生成しないよう、[`scripts/native.mjs`](./scripts/native.mjs) と [`scripts/cli.mjs`](./scripts/cli.mjs) の書き込み先から `` を削除します。残る対象は `docs/`(現行版)と `versions.json` に残っている1つの旧版です。 _`scripts/native.mjs`_ @@ -429,12 +429,12 @@ Everything from here on refers to ``: writeFileSync(`versioned_docs/version-v8/${path}`, data); ``` -11. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building ``. +11. **PR を作成します。** マージされると、バージョン選択メニューはアーカイブを指し、`main` での `` のビルドが終了します。 -Removed versions keep their authored `versioned_docs/` and `versioned_sidebars/` content, so they can be rebuilt anytime by adding them back to `versions.json`. Their `native/` and `cli/commands/` pages are generated rather than committed, so a rebuild also needs the version back in the write lists from step 10. Without it those sections build empty. +アーカイブ後も手書きの `versioned_docs/` と `versioned_sidebars/` は残るため、`versions.json` に戻せば再ビルドできます。`native/` と `cli/commands/` のページは生成され、コミットされていないので、手順10の書き込み先にもその版を戻してください。戻さずにビルドすると、これらのセクションは空になります。 > [!NOTE] -> Ionic v3 and v4 use other build tools and are not managed here. +> Ionic v3 と v4 は別のビルドツールを使用しており、ここでは管理されていません。 --- diff --git a/docs/README.md b/docs/README.md index 12005305278..3ff8bb8ae21 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,16 +1,16 @@ # Docs folder -The `/docs` folder houses all markdown files. The page structure loosely maps to the routing on the site since paths can be changed in the frontmatter. +`/docs` フォルダーにはすべての Markdown ファイルがあります。frontmatter でパスを変更できるため、ページの構成はサイトのルーティングにおおむね対応しています。 ## Versioning -This folder can also contain components, assets, and whatever else is meant to be versioned when the docusaurus versioning script is run. For example, if there is a page component that is only relevant to the `layout` section in the current version of Ionic, it could be added to a `_components/` folder in `docs/layout/`. When the versioning script is run, the component will be copied to `versioned_docs/version-{X}/layout/_components/` and there will now be a separate component in `docs/layout/_components/` that can be deleted or updated to the latest version. The same concept applies to images and other files. +このフォルダには、コンポーネントやアセット、その他、Docusaurus のバージョン管理スクリプトが実行される際にバージョン管理されるべきものが含まれています。例えば、Ionic の現在のバージョンにおいて、`layout`セクションに関連するページコンポーネントがある場合、そのコンポーネントは`docs/layout/`ディレクトリ内の`_components/`フォルダに追加されることがあります。バージョン管理スクリプトが実行されると、そのコンポーネントは`versioned_docs/version-{X}/layout/_components/`にコピーされます。そうすると、`docs/layout/_components/`には、新しいバージョンに更新したり、削除したりできる別のコンポーネントが存在するようになります。この概念は、画像やその他のファイルにも同様に適用されます。 -If components are meant to be shared across versions, they can be put in `src/components/`. If images and other served files are meant to be shared across versions they can be put in `static/`. +もし、コンポーネントが異なるバージョン間で共有される必要がある場合は、`src/components/`に配置します。また、画像やその他のファイルが異なるバージョン間で共有される必要がある場合は、`static/`に配置します。 ## Auto Generated Files -All markdown files in these directories are generated from [scripts](/scripts): +これらのディレクトリ内にあるすべての markdown ファイルは、[スクリプト](/scripts)から生成されています。 - `docs/api/` - `docs/cli/commands/` diff --git a/docs/angular/add-to-existing.mdx b/docs/angular/add-to-existing.mdx index 5cd84231b1b..eaaf448edba 100644 --- a/docs/angular/add-to-existing.mdx +++ b/docs/angular/add-to-existing.mdx @@ -1,6 +1,6 @@ --- title: Add to Existing Angular Project -description: 'Learn how to add Ionic Angular to your existing Angular project. Step-by-step guide for integrating Ionic components and features into an existing Angular application.' +description: '既存の Angular プロジェクトに Ionic Angular を追加し、Ionic のコンポーネントと機能を組み込む手順を説明します。' sidebar_label: Add to Existing --- @@ -11,11 +11,11 @@ import DocsCards from '@components/global/DocsCards'; Add Ionic Angular to Existing Project: Integration Guide -This guide covers how to add Ionic Angular to an existing Angular project. If you're looking to start a new project from scratch, check out the [Ionic Angular Quickstart](./quickstart.mdx) guide. For an overview of how Ionic Angular works with Angular, including version support and tooling, check out the [Ionic Angular Overview](./overview.mdx). +このガイドでは、既存の Angular プロジェクトに Ionic Angular を追加する方法について説明しています。もし、ゼロから新しいプロジェクトを始めたい場合は、[Ionic Angular クイックスタートガイド](./quickstart.mdx)をご覧ください。Ionic Angular が Angular とどのように連携しているか、また、バージョンサポートやツールについては、[Ionic Angular の概要](./overview.mdx)をご覧ください。 :::tip -This guide uses `.css` file extensions for stylesheets. If you created your Angular app with a different stylesheet format (such as `.scss`, `.sass`, or `.less`), use that extension instead. +このガイドでは、スタイルシートは`.css`という拡張子を使用しています。もし、別のスタイルシート形式(例えば`.scss`、`.sass`、`.less`など)で Angular アプリを作成した場合は、その拡張子を使用してください。 ::: @@ -23,25 +23,25 @@ This guide uses `.css` file extensions for stylesheets. If you created your Angu :::info -This guide follows the structure of an Angular app created with the Angular CLI. If you started your Angular app using a different method, your file structure and setup may differ. +このガイドは、Angular CLI を使って作成されたアプリケーションの構造に沿っています。もし、別の方法で Angular アプリを作成した場合、ファイルの構造や設定は異なるかもしれません。 ::: -You can add Ionic Angular to your existing Angular project using the Angular CLI's `ng add` feature or by installing it manually. +Ionic Angular を、既存の Angular プロジェクトに追加するには、Angular CLI の`ng add`機能を使うか、手動でインストールすることができます。 ### Using ng add {/* #using-ng-add */} -The easiest way to add Ionic Angular is to use the Angular CLI's `ng add` feature: +Ionic Angular を追加する最も簡単な方法は、Angular CLI の`ng add`機能を使うことです。 ```bash ng add @ionic/angular ``` -This will install the `@ionic/angular` package and automatically configure the necessary imports and styles. +これにより、`@ionic/angular`パッケージがインストールされ、必要なインポートやスタイルシートも自動的に設定されます。 ### Manual Installation {/* #manual-installation */} -If you prefer to install Ionic Angular manually, you can follow these steps: +もし、Ionic Angular を手動でインストールしたい場合は、以下の手順に従ってください。 #### 1. Install the Package {/* #1-install-the-package */} @@ -51,7 +51,7 @@ npm install @ionic/angular #### 2. Add Ionic Framework Stylesheets {/* #2-add-ionic-framework-stylesheets */} -Replace the existing `styles` array in `angular.json` with the following: +`angular.json`ファイル内の既存の`styles`配列を、以下の内容で置き換えてください。 ```json title="angular.json" "styles": [ @@ -73,7 +73,7 @@ Replace the existing `styles` array in `angular.json` with the following: :::info -While `core.css` is required, `normalize.css`, `structure.css`, and `typography.css` are recommended but not required. They normalize cross-browser differences, ensure proper scrolling behavior, and provide consistent typography and form styling. Without them, you may need to handle these concerns yourself. For more details, refer to [Global Stylesheets](../layout/global-stylesheets.mdx). +`core.css` は必須です。`normalize.css`、`structure.css`、`typography.css` は任意ですが、利用を推奨します。ブラウザーごとの表示の違いを整え、スクロール動作を保ち、文字やフォームのスタイルを統一します。これらを読み込まない場合は、自分で対応が必要になることがあります。詳細は [Global Stylesheets](../layout/global-stylesheets.mdx) を参照してください。 ::: @@ -93,19 +93,19 @@ export const appConfig: ApplicationConfig = { }; ``` -This reflects the Angular 21 and 22 scaffold, which is zoneless by default. If your existing app is on Angular 18 through 20, it still has `provideZoneChangeDetection({ eventCoalescing: true })`; keep that provider and add `provideIonicAngular({})` alongside it. Refer to [Zoneless Change Detection](./zoneless.mdx) for details. +これは、デフォルトで zoneless の Angular 21・22 のプロジェクト構成に対応しています。既存のアプリが Angular 18〜20 の場合は、`provideZoneChangeDetection({ eventCoalescing: true })` の provider を残し、その隣に `provideIonicAngular({})` を追加してください。詳細は [Zoneless Change Detection](./zoneless.mdx) を参照してください。 ## Using Individual Components {/* #using-individual-components */} -After completing the setup above, you can start using Ionic components in your existing Angular app. Here's an example of how to use them: +上記の設定を完了した後、既存の Angular アプリで Ionic コンポーネントを使用し始めることができます。以下は、Ionic コンポーネントを使用する方法の例です。 -Update `src/app/app.html` to the following: +`src/app/app.html`を以下のように更新してください。 ```html title="src/app/app.html" Button ``` -Then, import the components in `src/app/app.ts`: +次に、`src/app/app.ts`ファイル内に、必要なコンポーネントをインポートします。 ```ts title="src/app/app.ts" import { Component } from '@angular/core'; @@ -120,15 +120,15 @@ import { IonButton, IonDatetime } from '@ionic/angular'; export class App {} ``` -Visit the [components](../components.mdx) page for all of the available Ionic components. +利用可能なすべての Ionic コンポーネントについては、[コンポーネント](../components.mdx)ページをご覧ください。 ## Using Ionic Pages {/* #using-ionic-pages */} -If you want to use Ionic pages with full navigation and page transitions, follow these additional setup steps. +もし、Ionic ページを使い、完全なナビゲーション機能やページ間の遷移機能を利用したい場合は、以下の手順に従って設定を行ってください。 #### 1. Add Additional Ionic Framework Stylesheets {/* #1-add-additional-ionic-framework-stylesheets */} -Replace the existing `styles` array in `angular.json` with the following: +`angular.json`ファイル内の既存の`styles`配列を、以下の内容で置き換えてください。 ```json title="angular.json" "styles": [ @@ -169,11 +169,11 @@ Replace the existing `styles` array in `angular.json` with the following: ] ``` -These stylesheets set up the overall page structure and provide [CSS utilities](../layout/css-utilities.mdx) for faster development. Some stylesheets are optional. For details on which stylesheets are required, check out [Global Stylesheets](../layout/global-stylesheets.mdx). +これらのスタイルシートは、ページの構造を定義し、より迅速な開発を可能にするための[CSS ユーティリティ](../layout/css-utilities.mdx)を提供しています。一部のスタイルシートはオプションです。どのスタイルシートが必要かについては、[グローバルスタイルシート](../layout/global-stylesheets.mdx)をご覧ください。 #### 2. Set up Theming {/* #2-set-up-theming */} -Create a `src/theme/variables.css` file with the following content: +`src/theme/variables.css`というファイルを以下の内容で作成してください: ```css title="src/theme/variables.css" /** @@ -188,11 +188,11 @@ Create a `src/theme/variables.css` file with the following content: @import '@ionic/angular/css/palettes/dark.system.css'; ``` -This file enables [dark mode support](../theming/dark-mode.mdx) for your Ionic app when the system is set to prefer a dark appearance. You can customize the theming behavior by uncommenting different dark palette imports or adding custom CSS variables. +このファイルを使用すると、システムがダークテーマを推奨するように設定されている場合、Ionic アプリで[ダークモードのサポート](../theming/dark-mode.mdx)が利用できます。また、さまざまなダークテーマの設定をカスタマイズするためには、コメントを外すか、独自の CSS 変数を追加する必要があります。 #### 3. Update the App Component {/* #3-update-the-app-component */} -Update `src/app/app.html` to the following: +`src/app/app.html`を以下のように更新してください。 ```html title="src/app/app.html" @@ -200,7 +200,7 @@ Update `src/app/app.html` to the following: ``` -Then, update `src/app/app.ts` to include the component imports: +次に、`src/app/app.ts`を更新し、そのコンポーネントのインポートを追加してください。 ```ts title="src/app/app.ts" import { Component } from '@angular/core'; @@ -217,7 +217,7 @@ export class App {} #### 4. Create a Home Page {/* #4-create-a-home-page */} -Start by adding a template at `src/app/home/home.html`: +まず、`src/app/home/home.html`というファイルにテンプレートを追加してください。 ```html title="src/app/home/home.html" @@ -243,7 +243,7 @@ Start by adding a template at `src/app/home/home.html`: ``` -Then, create `src/app/home/home.ts` with the following: +次に、`src/app/home/home.ts`というファイルを以下の内容で作成します。 ```ts title="src/app/home/home.ts" import { Component } from '@angular/core'; @@ -258,7 +258,7 @@ import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular'; export class HomePage {} ``` -Finally, add a `src/app/home/home.css` file: +最後に、`src/app/home/home.css`というファイルを追加してください。 ```css title="src/app/home/home.css" #container { @@ -292,7 +292,7 @@ Finally, add a `src/app/home/home.css` file: #### 5. Set up Routing {/* #5-set-up-routing */} -Update `src/app/app.routes.ts` to add a `home` route: +`src/app/app.routes.ts`を更新し、`home`ルートを追加してください。 ```ts title="src/app/app.routes.ts" import { Routes } from '@angular/router'; @@ -311,16 +311,16 @@ export const routes: Routes = [ ]; ``` -You're all set! Your Ionic Angular app is now configured with full Ionic page support. Run `ng serve` to start your development server and view your app. +すべての準備が整いました!これで、あなたの Ionic Angular アプリは、完全な Ionic ページ機能をサポートするように設定されました。`ng serve`を実行して、開発サーバーを起動し、アプリを確認してください。 ## Next Steps {/* #next-steps */} -Now that you have Ionic Angular integrated into your project, check out: +もう、Ionic Angular をプロジェクトに統合したので、以下の点を確認してください: -

Discover how to handle routing and navigation in Ionic Angular apps using the Angular Router.

+

Angular Router を使って Ionic Angular アプリでルーティングとナビゲーションを扱う方法を学びます。

@@ -328,11 +328,11 @@ Now that you have Ionic Angular integrated into your project, check out: -

Learn how to customize the look and feel of your app with Ionic's powerful theming system.

+

Ionic のテーマ設定を使ってアプリの外観や操作感をカスタマイズする方法を学びます。

-

Explore how to access native device features and deploy your app to iOS, Android, and the web with Capacitor.

+

Capacitor で端末機能を使い、iOS、Android、Web にデプロイする方法を学びます。

diff --git a/docs/angular/build-options.mdx b/docs/angular/build-options.mdx index 0eae09cec7c..dec232d750b 100644 --- a/docs/angular/build-options.mdx +++ b/docs/angular/build-options.mdx @@ -1,5 +1,5 @@ --- -description: 'Choose between standalone components and NgModules when using Ionic in an Angular app, with the benefits and downsides of each approach.' +description: 'Angular アプリで Ionic を使う際の standalone components と NgModules の利点と制約を比較し、構成を選ぶ方法を説明します。' --- import Tabs from '@theme/Tabs'; @@ -7,37 +7,37 @@ import TabItem from '@theme/TabItem'; # Build Options -Developers have two options for using Ionic components: Standalone or Modules. This guide covers both options as well as the benefits and downsides of each approach. +Ionic コンポーネントの使い方には Standalone と Modules の 2 通りがあります。このガイドでは、それぞれの方法と利点、制約を説明します。 -The Standalone approach uses modern Angular APIs and is the recommended way to build Ionic applications. The Modules approach, including `IonicModule`, is **deprecated** and will be removed in a future major release. New projects should use the Standalone approach. Existing apps will continue to work but should plan to migrate. Refer to [Migrating from Modules to Standalone](#migrating-from-modules-to-standalone) for migration guidance. +Standalone は新しい Angular API を利用する方式で、Ionic アプリの開発に推奨されます。`IonicModule` を含む Modules 方式は**非推奨**で、今後のメジャーリリースで削除される予定です。新規プロジェクトには Standalone を使用してください。既存のアプリは引き続き動作しますが、移行を計画してください。手順は [Modules から Standalone への移行](#migrating-from-modules-to-standalone) を参照してください。 ## Standalone {/* #standalone */} :::info -Ionic UI components as Angular standalone components is supported starting in Ionic v7.5. +Ionic v7.5 から、Ionic UI コンポーネントを Angular の standalone コンポーネントとして利用できます。 ::: ### Overview {/* #overview */} -Developers can use Ionic components as standalone components to take advantage of treeshaking and newer Angular features. This option involves importing specific Ionic components in the Angular components you want to use them in. Developers can use Ionic standalone components even if their Angular application is NgModule-based. +Ionic コンポーネントを standalone コンポーネントとして使うと、tree shaking や新しい Angular の機能を利用できます。この方式では、使用する Ionic コンポーネントを、それを使う Angular コンポーネントで個別にインポートします。NgModule ベースの Angular アプリでも Ionic の standalone コンポーネントを使用できます。 -Ionic のスタンドアロンコンポーネントを利用するために、Ionic アプリを更新する方法については、[スタンドアロン移行ガイド](#migrating-from-modules-to-standalone)を参照してください。 +Ionic の standalone コンポーネントを利用するために、Ionic アプリを更新する方法については、[standalone 移行ガイド](#migrating-from-modules-to-standalone)を参照してください。 **Benefits** -1. Enables treeshaking so the final build output only includes the code necessary to run your app which reduces overall build size. -2. Avoids the use of NgModules to streamline the development experience and make your code easier to understand. -3. Allows developers to also use newer Angular features such as [ESBuild](https://angular.io/guide/esbuild). +1. tree shaking により、アプリの実行に必要なコードだけがビルド結果に含まれ、全体のサイズを削減できます。 +2. NgModules を使わないため、開発手順が簡単になり、コードも理解しやすくなります。 +3. [ESBuild](https://angular.io/guide/esbuild) など、Angular の新しい機能も利用できます。 **Drawbacks** -1. Ionic components need to be imported into every Angular component they are used in which can be time consuming to set up. +1. Ionic コンポーネントを使用する Angular コンポーネントごとにインポートする必要があり、設定に時間がかかる場合があります。 :::info[Code splitting] -Ionic ships standalone components from a single entry point (`@ionic/angular`). Bundlers such as Webpack and esbuild cannot split code from a single entry point across separate chunks, so the Ionic components you import are included in the main bundle rather than in the chunk for the route or component where they are used. Unused components are still tree-shaken out of the build. +Ionic は単一の entry point(`@ionic/angular`)から standalone コンポーネントを提供しています。Webpack や esbuild などの bundler は、単一の entry point のコードを複数のチャンクに分割できません。そのため、インポートした Ionic コンポーネントは、使用するルートやコンポーネントのチャンクではなくメインバンドルに含まれます。未使用のコンポーネントは tree shaking で除外されます。 ::: @@ -45,13 +45,13 @@ Ionic ships standalone components from a single entry point (`@ionic/angular`). :::warning -All Ionic imports should be imported from the `@ionic/angular` submodule. This includes imports such as components, directives, providers, and types. Importing from `@ionic/angular/lazy` may pull in lazy loaded Ionic code which can interfere with treeshaking. +コンポーネント、directive、provider、型など、Ionic からのインポートにはすべて `@ionic/angular` サブモジュールを使用してください。`@ionic/angular/lazy` からインポートすると遅延読み込み用の Ionic コードが取り込まれ、tree shaking を妨げることがあります。 ::: **Bootstrapping and Configuration** -Ionic Angular needs to be configured when the Angular application calls `bootstrapApplication` using the `provideIonicAngular` function. Developers can pass any [IonicConfig](../developing/config.mdx#ionicconfig) values as an object in this function. Note that `provideIonicAngular` needs to be called even if no custom config is passed. +Angular アプリケーションが`bootstrapApplication`を呼び出す際には、`provideIonicAngular`関数を使用して Ionic Angular を設定する必要があります。開発者は、この関数内で任意の[IonicConfig](../developing/config.mdx#ionicconfig)値をオブジェクトとして渡すことができます。ただし、カスタム設定が渡されていなくても、`provideIonicAngular`を呼び出す必要があります。 ```typescript title="main.ts" import { enableProdMode, importProvidersFrom } from '@angular/core'; @@ -73,7 +73,7 @@ bootstrapApplication(AppComponent, { **Components** -In the example below, we are importing `IonContent` and `IonButton` from `@ionic/angular` and passing them to `imports` for use in the component template. We would get a compiler error if these components were not imported and provided to the `imports` array. +次の例では、`@ionic/angular` から `IonContent` と `IonButton` をインポートし、コンポーネントのテンプレートで使えるよう `imports` に渡しています。これらをインポートして `imports` 配列に追加しておかないと、コンパイルエラーになります。 ```typescript title="home.page.ts" import { Component } from '@angular/core'; @@ -93,11 +93,11 @@ export class HomePage { **Icons** -The icon SVG data needs to be defined in the Angular component so it can be loaded correctly. Developers can use the `addIcons` function from `ionicons` to map the SVG data to a string name. Developers can then reference the icon by its string name using the `name` property on `IonIcon`. +アイコンを正しく読み込むには、Angular コンポーネントで SVG データを定義します。`ionicons` の `addIcons` 関数を使うと、SVG データに文字列の名前を割り当てられます。その名前を `IonIcon` の `name` プロパティに指定してアイコンを参照できます。 -We recommend calling `addIcons` in the Angular component `constructor` so the data is only added if the Angular component is being used. +Angular コンポーネントの`constructor`内で`addIcons`を呼び出すことをお勧めします。これにより、Angular コンポーネントが使用されている場合にのみデータが追加されます。 -For developers using Ionicons 7.2 or newer, passing only the SVG data will cause the string name to be automatically generated. +Ionicons 7.2 以降を使用している開発者については、SVG データのみを渡すことで、文字列の名前が自動的に生成されます。 ```typescript title="home.page.ts" import { Component } from '@angular/core'; @@ -125,7 +125,7 @@ export class HomePage { } ``` -Icons can also be registered in entry points such as `app.component.ts` to avoid the need to call `addIcons` multiple times. Developers should be aware that the initial application chunk may increase because the registered icons will need to be loaded at application start. However, if your application uses a small number of icons the impact of this may be minimal. +`app.component.ts` などの entry point でアイコンを登録すると、`addIcons` を何度も呼び出さずに済みます。登録したアイコンはアプリ起動時に読み込まれるため、初期チャンクのサイズが大きくなる場合があります。使用するアイコンが少なければ、影響はわずかです。 ```typescript title="app.component.ts" import { Component } from '@angular/core'; @@ -150,7 +150,7 @@ export class AppComponent { } ``` -Icons registered in an application entry point can then be referenced by name anywhere in the application. +アプリケーションの entry point に登録されているアイコンは、アプリケーション内のどこでもその名前で参照することができます。 ```html title="home.page.html" `/pageB` --> `/pageC`。 +`/pageA` --> `/pageB` --> `/pageC` もし `/pageC` で `LocationStrategy.historyGo(-2)` を呼び出すと、 `/pageA` に戻る。その後、 `LocationStrategy.historyGo(2)` を呼び出すと、 `/pageC` に戻る。 @@ -129,7 +129,7 @@ Angular Router には、開発者がアプリケーションの履歴を前後 ## ルートの遅延読み込み {/* #lazy-loading-routes */} -現在のルート設定では、すべての Component が、ルートとなる `app.module` と同じ `chunk` に含まれているので理想的ではありません。代わりに、ルータにはコンポーネントを独自の `chunk` に分離できるように設定されています。 +現在の設定では、各ルートのコンポーネントがアプリの root にある app.module と同じチャンクに含まれます。ルーターの設定を変えれば、コンポーネントごとにチャンクを分けられます。 ```tsx @@ -170,13 +170,13 @@ import { LoginComponent } from './login.component'; ::: -ここでは、`RouterModule` のインポートとともに、典型的な `Angular Module` の設定がありますが、`RouterModule` では `forChild` によってコンポーネントを使用することを宣言しています。この設定では、ビルドを実行するときに、`App Component`(Root)、 `login Component` 、および `detail Component` において別々のチャンクを作成します。 +ここでは通常の Angular Module と同様に RouterModule をインポートし、`forChild` を使ってルートを設定し、コンポーネントを宣言しています。この設定でビルドすると、アプリ本体、ログイン、詳細の各コンポーネントに個別のチャンクが生成されます。 ## Standalone Components {/* #standalone-components */} -Standalone components allow developers to lazy load a component on a route without having to declare the component to an Angular module. +standalone コンポーネントを使用すると、開発者は、Angular モジュールにコンポーネントを宣言することなく、特定のルートでそのコンポーネントを遅延ロードすることができます。 -Developers can use the existing syntax for standalone component routing from Angular: +standalone コンポーネントのルーティングには、Angular の既存の構文を使えます。 ```ts @NgModule({ @@ -194,7 +194,7 @@ export class AppRoutingModule {} :::tip -If you are using `routerLink`, `routerDirection`, or `routerAction` be sure to also import the `IonRouterLink` directive for Ionic components or the `IonRouterLinkWithHref` directive for `
` elements. An example of this is available in the [Ionic Angular Build Options docs](./build-options.mdx#migrating-from-modules-to-standalone). +`routerLink`、`routerDirection`、`routerAction`を使用する場合は、Ionic コンポーネント用の`IonRouterLink` directive や、``要素用の`IonRouterLinkWithHref` directive も必ずインポートしてください。この例は、[Ionic Angular のビルドオプションに関するドキュメント](./build-options.mdx#migrating-from-modules-to-standalone)で確認できます。 ::: @@ -210,9 +210,9 @@ import NavigationPlayground from '@site/static/usage/v9/navigation/index.mdx'; ### Linear Routing {/* #linear-routing */} -If you have built a web app that uses routing, you likely have used linear routing before. Linear routing means that you can move forward or backward through the application history by pushing and popping pages. +ルーティングを使う Web アプリを作ったことがあれば、線形ルーティングを使ったことがあるでしょう。線形ルーティングでは、ページを履歴に push したり履歴から pop したりして、アプリ内を前後に移動します。 -The following is an example of linear routing in a mobile app: +以下は、モバイルアプリにおける線形ルーティングの例です。 -The application history in this example has the following path: +この例におけるアプリケーションの履歴は、以下のパスになっています。 `Accessibility` --> `VoiceOver` --> `Speech` -When we press the back button, we follow that same routing path except in reverse. Linear routing is helpful in that it allows for simple and predictable routing behaviors. It also means we can use router Angular Router APIs such as [LocationStrategy.historyGo()](#navigating-using-locationstrategyhistorygo). +戻るボタンを押すと、同じ経路を逆順にたどります。線形ルーティングはシンプルで、移動先を予測しやすい方式です。[LocationStrategy.historyGo()](#navigating-using-locationstrategyhistorygo) などの Angular Router API も使用できます。 -The downside of linear routing is that it does not allow for complex user experiences such as tab views. This is where non-linear routing comes into play. +線形ルーティングの欠点は、タブビューなどの複雑なユーザー体験を実現できないことです。そこで、非線形ルーティングが役立ちます。 ### Non-Linear Routing {/* #non-linear-routing */} -Non-linear routing is a concept that may be new to many web developers learning to build mobile apps with Ionic. +非線形ルーティングとは、Ionic を使ってモバイルアプリを開発することを学んでいる多くのウェブ開発者にとって、新しい概念かもしれません。 -Non-linear routing means that the view that the user should go back to is not necessarily the previous view that was displayed on the screen. +非線形ルーティングとは、ユーザーが戻るべき表示内容が、必ずしも画面に表示されていた前の表示内容とは限らないということを意味します。 -The following is an example of non-linear routing: +以下は、非線形ルーティングの例です。 -In the example above, we start on the `Originals` tab. Tapping a card brings us to the `Ted Lasso` view within the `Originals` tab. +上の例では、まず「`Originals`」タブから始めます。カードをタップすると、「`Originals`」タブ内の「`Ted Lasso`」の画面に移動します。 -From here, we switch to the `Search` tab. Then, we tap the `Originals` tab again and are brought back to the `Ted Lasso` view. At this point, we have started using non-linear routing. +ここからは、「`Search`」タブに移ります。その後、再び「`Originals`」タブをタップすると、再び「`Ted Lasso`」のビューに戻ります。この時点で、私たちは非線形のルーティングを使用し始めています。 -Why is this non-linear routing? The previous view we were on was the `Search` view. However, pressing the back button on the `Ted Lasso` view should bring us back to the root `Originals` view. This happens because each tab in a mobile app is treated as its own stack. The [Working with Tabs](#working-with-tabs) sections goes over this in more detail. +なぜこれが非線形ルーティングなのでしょうか。直前に表示していたのは `Search` ビューです。それでも `Ted Lasso` ビューの戻るボタンを押すと、そのタブのルートである `Originals` ビューに戻ります。モバイルアプリではタブごとに独立したナビゲーションスタックを持つためです。詳しくは[タブの使い方](#working-with-tabs)を参照してください。 -If tapping the back button simply called `LocationStrategy.historyGo(-1)` from the `Ted Lasso` view, we would be brought back to the `Search` view which is not correct. +もし、バックボタンをタップすると、`Ted Lasso`ビューから`LocationStrategy.historyGo(-1)`というメソッドが呼び出されるだけであれば、私たちは再び`Search`ビューに戻ってしまいます。これは正しくありません。 -Non-linear routing allows for sophisticated user flows that linear routing cannot handle. However, certain linear routing APIs such as `LocationStrategy.historyGo()` cannot be used in this non-linear environment. This means that `LocationStrategy.historyGo()` should not be used when using tabs or nested outlets. +非線形ルーティングでは、線形ルーティングで扱えない複雑な画面遷移を実現できます。ただし、`LocationStrategy.historyGo()` など一部の線形ルーティング API はこの環境で使用できません。タブやネストした outlet を使用するときは `LocationStrategy.historyGo()` を使わないでください。 -### Which one should I choose? {/* #which-one-should-i-choose */} +### どちらを選ぶべきか {/* #which-one-should-i-choose */} -We recommend keeping your application as simple as possible until you need to add non-linear routing. Non-linear routing is very powerful, but it also adds a considerable amount of complexity to mobile applications. +非線形ルーティングを導入する必要があるまで、アプリケーションをできるだけシンプルに保つことをお勧めします。非線形ルーティングは非常に強力ですが、同時にモバイルアプリケーションにかなりの複雑さをもたらします。 -The two most common uses of non-linear routing is with tabs and nested `ion-router-outlet`s. We recommend only using non-linear routing if your application meets the tabs or nested router outlet use cases. +非線形ルーティングの代表的な使用例は、タブと、ネストした `ion-router-outlet` です。アプリがタブまたはネストした router outlet を使う場合にのみ、非線形ルーティングを推奨します。 タブの詳細については、[タブの操作](#working-with-tabs)を参照してください。 -ネストされたルーターアウトレットの詳細については、[ネストされたルート](#nested-routes)を参照してください。 +ネストされた router outlet の詳細については、[ネストされたルート](#nested-routes)を参照してください。 ## Shared URLs versus Nested Routes {/* #shared-urls-versus-nested-routes */} -A common point of confusion when setting up routing is deciding between shared URLs or nested routes. This part of the guide will explain both and help you decide which one to use. +ルーティングを設定する際によくある混乱の原因の一つは、共有 URL とネストされたルートのどちらを使うかを決めることです。このガイドでは、両方について説明し、どちらを使用するべきかを決める手助けをします。 ### Shared URLs {/* #shared-urls */} -Shared URLs is a route configuration where routes have pieces of the URL in common. The following is an example of a shared URL configuration: +共有 URL は、ルートが共通の URL の一部を持つルート設定です。共有 URL 設定の例を次に示します: ```tsx const routes: Routes = [ @@ -291,11 +291,11 @@ const routes: Routes = [ ]; ``` -The above routes are considered "shared" because they reuse the `dashboard` piece of the URL. +上記のルートは、URL の `dashboard` 部分を再利用するため、 "shared" と見なされます。 ### Nested Routes {/* #nested-routes */} -Nested Routes is a route configuration where routes are listed as children of other routes. The following is an example of a nested route configuration: +Nested Routes は、ルートが他のルートの子としてリストされるルート設定です。ネストされたルート設定の例を次に示します: ```tsx const routes: Routes = [ @@ -316,15 +316,15 @@ const routes: Routes = [ ]; ``` -The above routes are nested because they are in the `children` array of the parent route. Notice that the parent route renders the `DashboardRouterOutlet` component. When you nest routes, you need to render another instance of `ion-router-outlet`. +上記のルートは、親ルートの `children` 配列にあるため、ネストされています。親ルートが `DashboardRouterOutlet` コンポーネントをレンダリングしていることに注目してください。ルートをネストする場合は、 `ion-router-outlet` の別のインスタンスをレンダリングする必要があります。 -### Which one should I choose? {/* #which-one-should-i-choose-1 */} +### どちらを選ぶべきか {/* #which-one-should-i-choose-1 */} -Shared URLs are great when you want to transition from page A to page B while preserving the relationship between the two pages in the URL. In our previous example, a button on the `/dashboard` page could transition to the `/dashboard/stats` page. The relationship between the two pages is preserved because of a) the page transition and b) the url. +共有 URL は、URL の 2 つのページ間の関係を維持しながら、ページ A からページ B に遷移する場合に便利です。前述の例では、 `/dashboard` ページのボタンで `/dashboard/stats` ページに移行できます。2 つのページ間の関係は、a) ページの遷移と b) URL によって維持されます。 -ネストされたルートは、アウトレット A でコンテンツを表示しつつ、ネストされたアウトレット B 内にサブコンテンツを表示したい場合に使用するべきです。最も一般的な使用例はタブです。タブの Ionic スターターアプリケーションをロードすると、最初の`ion-router-outlet`が`ion-tab-bar`と`ion-tabs`コンポーネントをレンダリングします。`ion-tabs`コンポーネントは別の`ion-router-outlet`をレンダリングし、各タブの内容を表示する役割を持っています。 +ネストされたルートは、outlet A でコンテンツを表示しつつ、ネストされた outlet B 内にサブコンテンツを表示したい場合に使用するべきです。最も一般的な使用例はタブです。タブの Ionic スターターアプリケーションをロードすると、最初の`ion-router-outlet`が`ion-tab-bar`と`ion-tabs`コンポーネントをレンダリングします。`ion-tabs`コンポーネントは別の`ion-router-outlet`をレンダリングし、各タブの内容を表示する役割を持っています。 -There are very few use cases in which nested routes make sense in mobile applications. When in doubt, use the shared URL route configuration. We strongly caution against using nested routing in contexts other than tabs as it can quickly make navigating your app confusing. +モバイルアプリケーションでネストされたルートが意味をなすユースケースはほとんどありません。疑わしい場合は、共有 URL ルート設定を使用します。ネストされたルーティングをタブ以外のコンテキストで使用すると、アプリのナビゲーションが混乱する可能性があるため、使用しないように強く注意しています。 ## Working with Tabs {/* #working-with-tabs */} @@ -373,19 +373,19 @@ const routes: Routes = [ ``` -Ionic を使ってアプリを作成したことがあれば、このマークアップはおなじみのはずです。`ion-tabs` コンポーネントを作成し、`ion-tab-bar` を提供します。`ion-tab-bar` は、 `tab`と一緒に`ion-tab-button`を提供します。最新の `@ionic/angular` はもはや `` を必要とせず、開発者がタブバーを完全にカスタマイズできるようになり、すべての設定は Router の設定によって行えるようになりました。 +Ionic でアプリを作ったことがあれば、おなじみの構成です。`ion-tabs` コンポーネントを作成し、`ion-tab-bar` を配置します。`ion-tab-bar` 内の `ion-tab-button` は、`tab` プロパティでルーター設定の対応するタブの outlet に関連付けられます。最新の `@ionic/angular` では `` が不要になり、タブバーを自由にカスタマイズできます。タブの構成はルーター設定で一元管理します。 -### How Tabs in Ionic Work {/* #how-tabs-in-ionic-work */} +### Ionic のタブの仕組み {/* #how-tabs-in-ionic-work */} -Each tab in Ionic is treated as an individual navigation stack. This means if you have three tabs in your application, each tab has its own navigation stack. Within each stack you can navigate forwards (push a view) and backwards (pop a view). +Ionic では、各タブは独立したナビゲーションスタックとして扱われます。つまり、アプリケーション内に 3 つのタブがある場合、各タブにはそれぞれ独自のナビゲーションスタックがあります。各スタック内では、前に進む(ビューをプッシュする)ことも、後ろに戻ることもできます。 -This behavior is important to note as it is different than most tab implementations that are found in other web based UI libraries. Other libraries typically manage tabs as one single history stack. +他の Web UI ライブラリに多いタブの実装とは動作が異なる点に注意してください。一般に、他のライブラリではすべてのタブを 1 つの履歴スタックで管理します。 Ionic は開発者がモバイルアプリを構築するのを支援することに重点を置いているため、Ionic のタブはネイティブモバイルのタブにできるだけ近づくように設計されています。その結果、Ionic のタブには他の UI ライブラリのタブ実装とは異なる挙動が見られる場合があります。これらの違いのいくつかについて詳しく知るには、続きを読んでください。 ### Child Routes within Tabs {/* #child-routes-within-tabs */} -When adding additional routes to tabs you should write them as sibling routes with the parent tab as the path prefix. The example below defines the `/tabs/tab1/view` route as a sibling of the `/tabs/tab1` route. Since this new route has the `tab1` prefix, it will be rendered inside of the `Tabs` component, and Tab 1 will still be selected in the `ion-tab-bar`. +タブにルートを追加するときは、親タブのパスをプレフィックスとする兄弟ルートとして定義します。次の例では、`/tabs/tab1/view` を `/tabs/tab1` の兄弟ルートとして定義しています。新しいルートには `tab1` プレフィックスがあるため、`Tabs` コンポーネント内に描画され、`ion-tab-bar` では Tab 1 が選択されたままになります。 ```ts const routes: Routes = [ @@ -441,19 +441,19 @@ const routes: Routes = [ ### Switching Between Tabs {/* #switching-between-tabs */} -Since each tab is its own navigation stack, it is important to note that these navigation stacks should never interact. This means that there should never be a button in Tab 1 that routes a user to Tab 2. In other words, tabs should only be changed by the user tapping a tab button in the tab bar. +各タブは、それ自体が独立したナビゲーションスタックです。したがって、これらのナビゲーションスタックが互いに干渉してはいけない点に注意が必要です。つまり、タブ 1 内に、ユーザーをタブ 2 に移動させるボタンは存在してはいけません。言い換えれば、タブの切り替えは、タブバー内のタブボタンをタップすることによってのみ行われるべきです。 -A good example of this in practice is the iOS App Store and Google Play Store mobile applications. These apps both provide tabbed interfaces, but neither one ever routes the user across tabs. For example, the "Games" tab in the iOS App Store app never directs users to the "Search" tab and vice versa. +実例として、iOS の App Store と Google Play ストアのモバイルアプリがあります。どちらもタブを使いますが、ユーザーを別のタブに移動させることはありません。たとえば iOS の App Store では「Games」タブから「Search」タブに遷移することはなく、その逆もありません。 タブでよくあるいくつかの間違いについて見ていきましょう。 -**A Settings Tab That Multiple Tabs Reference** +**複数のタブから参照する Settings タブ** -A common practice is to create a Settings view as its own tab. This is great if developers need to present several nested settings menus. However, other tabs should never try to route to the Settings tab. As we mentioned above, the only way that the Settings tab should be activated is by a user tapping the appropriate tab button. +Settings ビューを独立したタブにすると、設定メニューに複数の階層があるときに便利です。ただし、他のタブから Settings タブにルーティングしないでください。前述のとおり、Settings タブを開くのはユーザーがそのタブボタンをタップしたときだけです。 -If you find that your tabs need to reference the Settings tab, we recommend making the Settings view a modal by using `ion-modal`. This is a practice found in the iOS App Store app. With this approach, any tab can present the modal without breaking the mobile tabs pattern of each tab being its own stack. +複数のタブから「Settings」タブを開く必要がある場合は、`ion-modal` で「Settings」ビューをモーダルとして表示することを推奨します。iOS の App Store アプリでも採用されている方法です。各タブが独立したスタックを保ったまま、どのタブからでもモーダルを開けます。 -The example below shows how the iOS App Store app handles presenting an "Account" view from multiple tabs. By presenting the "Account" view in a modal, the app can work within the mobile tabs best practices to show the same view across multiple tabs. +次の例は、iOS の App Store アプリが複数のタブから「Account」ビューを表示する方法を示しています。「Account」をモーダルで開くことで、モバイルのタブのベストプラクティスに沿って、どのタブからも同じビューを表示できます。