Skip to content

Commit d752294

Browse files
committed
i18n(ja): Japanese Texts for first 6 files in Plugins Section
1 parent d64a11e commit d752294

File tree

6 files changed

+1036
-0
lines changed

6 files changed

+1036
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
title: Autostart(自動起動)
3+
description: システム起動時にアプリを自動的に起動します。
4+
plugin: autostart
5+
i18nReady: true
6+
---
7+
8+
import PluginLinks from '@components/PluginLinks.astro';
9+
import Compatibility from '@components/plugins/Compatibility.astro';
10+
11+
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';
12+
import CommandTabs from '@components/CommandTabs.astro';
13+
import PluginPermissions from '@components/PluginPermissions.astro';
14+
import TranslationNote from '@components/i18n/TranslationNote.astro';
15+
16+
<TranslationNote lang="ja">
17+
18+
**Plugin 説明内容の英語表記部分について** Plugin 関連の各章は、「Astro Web フレームワーク」により原文データからページ内容の一部が自動生成されているため、英語表記のままの部分があります。
19+
20+
</TranslationNote>
21+
22+
<PluginLinks plugin={frontmatter.plugin} />
23+
24+
システム起動時にアプリを自動的に起動します。
25+
26+
## 対応プラットフォーム
27+
28+
<Compatibility plugin={frontmatter.plugin} />
29+
30+
## セットアップ
31+
32+
はじめに、「Autostart(自動起動)」プラグインをインストールしてください。
33+
34+
<Tabs>
35+
<TabItem label="自動">
36+
37+
自分のプロジェクトのパッケージ・マネージャーを使用して依存関係を追加します:
38+
39+
{' '}
40+
41+
<CommandTabs
42+
npm="npm run tauri add autostart"
43+
yarn="yarn run tauri add autostart"
44+
pnpm="pnpm tauri add autostart"
45+
deno="deno task tauri add autostart"
46+
bun="bun tauri add autostart"
47+
cargo="cargo tauri add autostart"
48+
/>
49+
50+
</TabItem>
51+
<TabItem label="手動">
52+
<Steps>
53+
54+
1. `src-tauri` フォルダで次のコマンドを実行して、`Cargo.toml` 内のプロジェクトの依存関係にこのプラグインを追加します:
55+
56+
```sh frame=none
57+
cargo add tauri-plugin-autostart --target 'cfg(any(target_os = "macos", windows, target_os = "linux"))'
58+
```
59+
60+
2. 追加したプラグインを初期化するために `lib.rs` を修正します:
61+
62+
```rust title="src-tauri/src/lib.rs" ins={5-6}
63+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
64+
pub fn run() {
65+
tauri::Builder::default()
66+
.setup(|app| {
67+
#[cfg(desktop)]
68+
app.handle().plugin(tauri_plugin_autostart::init(tauri_plugin_autostart::MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* アプリに渡す任意の数の引数 */));
69+
Ok(())
70+
})
71+
.run(tauri::generate_context!())
72+
.expect("error while running tauri application");
73+
}
74+
```
75+
76+
3. お好みの JavaScript パッケージ・マネージャーを使用して、「JavaScript Guest」バインディングをインストールします:
77+
78+
<CommandTabs
79+
npm="npm install @tauri-apps/plugin-autostart"
80+
yarn="yarn add @tauri-apps/plugin-autostart"
81+
pnpm="pnpm add @tauri-apps/plugin-autostart"
82+
deno="deno add npm:@tauri-apps/plugin-autostart"
83+
bun="bun add @tauri-apps/plugin-autostart"
84+
/>
85+
86+
</Steps>
87+
</TabItem>
88+
89+
</Tabs>
90+
91+
## 使用法
92+
93+
「Autostart(自動起動)」プラグインは、JavaScript と Rust の両方で利用できます。
94+
95+
<Tabs syncKey="lang">
96+
<TabItem label="JavaScript">
97+
98+
```javascript
99+
import { enable, isEnabled, disable } from '@tauri-apps/plugin-autostart';
100+
// `"withGlobalTauri": true` を使用する場合は、
101+
// const { enable, isEnabled, disable } = window.__TAURI__.autostart; を使用できます;
102+
103+
// autostart を有効化
104+
await enable();
105+
// 有効化状態を確認
106+
console.log(`registered for autostart? ${await isEnabled()}`);
107+
// autostart を無効化
108+
disable();
109+
```
110+
111+
</TabItem>
112+
<TabItem label="Rust">
113+
114+
```rust
115+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
116+
pub fn run() {
117+
tauri::Builder::default()
118+
.setup(|app| {
119+
#[cfg(desktop)]
120+
{
121+
use tauri_plugin_autostart::MacosLauncher;
122+
use tauri_plugin_autostart::ManagerExt;
123+
124+
app.handle().plugin(tauri_plugin_autostart::init(
125+
MacosLauncher::LaunchAgent,
126+
Some(vec!["--flag1", "--flag2"]),
127+
));
128+
129+
// 「autostart マネージャー」を入手
130+
let autostart_manager = app.autolaunch();
131+
// autostart を有効化
132+
let _ = autostart_manager.enable();
133+
// 有効化状態を確認
134+
println!("registered for autostart? {}", autostart_manager.is_enabled().unwrap());
135+
// autostart を無効化
136+
let _ = autostart_manager.disable();
137+
}
138+
Ok(())
139+
})
140+
.run(tauri::generate_context!())
141+
.expect("error while running tauri application");
142+
}
143+
```
144+
145+
</TabItem>
146+
</Tabs>
147+
148+
## アクセス権の設定
149+
150+
デフォルトでは、潜在的に危険なプラグイン・コマンドとそのスコープ(有効範囲)はすべてブロックされており、アクセスできません。これらを有効にするには、`capabilities` 設定でアクセス権限を変更する必要があります。
151+
152+
詳細については「[セキュリティ・レベル Capabilities](/ja/security/capabilities/)」の章を参照してください。また、プラグインのアクセス権限を設定するには「[プライグン・アクセス権の使用](/ja/learn/security/using-plugin-permissions/)」の章のステップ・バイ・ステップ・ガイドを参照してください。
153+
154+
```json title="src-tauri/capabilities/default.json"
155+
{
156+
"permissions": [
157+
...,
158+
"autostart:allow-enable",
159+
"autostart:allow-disable",
160+
"autostart:allow-is-enabled"
161+
]
162+
}
163+
```
164+
165+
<PluginPermissions plugin={frontmatter.plugin} />
166+
167+
<div style="text-align: right;">
168+
【※ この日本語版は、「Feb 22, 2025 英語版」に基づいています】
169+
</div>
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
title: Barcode Scanner(バーコード・スキャナー)
3+
description: モバイル・アプリでカメラを使用し、QR コード、EAN-13、その他のバーコードをスキャン可能にします。
4+
plugin: barcode-scanner
5+
i18nReady: true
6+
---
7+
8+
import PluginLinks from '@components/PluginLinks.astro';
9+
import Compatibility from '@components/plugins/Compatibility.astro';
10+
11+
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';
12+
import CommandTabs from '@components/CommandTabs.astro';
13+
import PluginPermissions from '@components/PluginPermissions.astro';
14+
import TranslationNote from '@components/i18n/TranslationNote.astro';
15+
16+
<TranslationNote lang="ja">
17+
18+
**Plugin 説明内容の英語表記部分について** Plugin 関連の各章は、「Astro Web フレームワーク」により原文データからページ内容の一部が自動生成されているため、英語表記のままの部分があります。
19+
20+
</TranslationNote>
21+
22+
<PluginLinks plugin={frontmatter.plugin} />
23+
24+
モバイル・アプリでカメラを使用し、QR コード、EAN-13、その他のバーコードをスキャン可能にします。
25+
26+
<TranslationNote lang="ja">
27+
28+
**EAN-13** European Article Number: 商品識別コード/バーコード規格のひとつで、13 桁の「欧州商品番号」の意味。日本で最も普及している商品識別コードである「JAN コード」と同等のもの。《[Wikipedia](https://ja.wikipedia.org/wiki/EANコード)
29+
30+
</TranslationNote>
31+
32+
## 対応プラットフォーム
33+
34+
<Compatibility plugin={frontmatter.plugin} />
35+
36+
## セットアップ
37+
38+
はじめに、「Barcode Scanner(バーコード・スキャナー)」プラグインをインストールしてください。
39+
40+
<Tabs>
41+
<TabItem label="自動">
42+
43+
自分のプロジェクトのパッケージ・マネージャーを使用して依存関係を追加します:
44+
45+
{' '}
46+
47+
<CommandTabs
48+
npm="npm run tauri add barcode-scanner"
49+
yarn="yarn run tauri add barcode-scanner"
50+
pnpm="pnpm tauri add barcode-scanner"
51+
deno="deno task tauri add barcode-scanner"
52+
bun="bun tauri add barcode-scanner"
53+
cargo="cargo tauri add barcode-scanner"
54+
/>
55+
56+
</TabItem>
57+
<TabItem label="手動">
58+
<Steps>
59+
60+
1. `src-tauri` フォルダで次のコマンドを実行して、`Cargo.toml` 内のプロジェクトの依存関係にこのプラグインを追加します:
61+
62+
```sh frame=none
63+
cargo add tauri-plugin-barcode-scanner --target 'cfg(any(target_os = "android", target_os = "ios"))'
64+
```
65+
66+
2. 追加したプラグインを初期化するために `lib.rs` を修正します:
67+
68+
```rust title="src-tauri/src/lib.rs" ins={5-6}
69+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
70+
pub fn run() {
71+
tauri::Builder::default()
72+
.setup(|app| {
73+
#[cfg(mobile)]
74+
app.handle().plugin(tauri_plugin_barcode_scanner::init());
75+
Ok(())
76+
})
77+
.run(tauri::generate_context!())
78+
.expect("error while running tauri application");
79+
}
80+
```
81+
82+
3. お好みの JavaScript パッケージ・マネージャーを使用して、「JavaScript Guest」バインディングをインストールします:
83+
84+
<CommandTabs
85+
npm="npm install @tauri-apps/plugin-barcode-scanner"
86+
yarn="yarn add @tauri-apps/plugin-barcode-scanner"
87+
pnpm="pnpm add @tauri-apps/plugin-barcode-scanner"
88+
deno="deno add npm:@tauri-apps/plugin-barcode-scanner"
89+
bun="bun add @tauri-apps/plugin-barcode-scanner"
90+
/>
91+
92+
</Steps>
93+
94+
</TabItem>
95+
</Tabs>
96+
97+
## 設定
98+
99+
iOS では、「Barcode Scanner」プラグインに、あなたのアプリがカメラを使用する理由を説明する `NSCameraUsageDescription` 情報プロパティ・リストの値が必要です。
100+
101+
`src-tauri/Info.ios.plist` ファイルには、以下のスニペット(内容)を追加してください。
102+
103+
```xml title=src-tauri/Info.ios.plist
104+
<?xml version="1.0" encoding="UTF-8"?>
105+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
106+
<plist version="1.0">
107+
<dict>
108+
<key>NSCameraUsageDescription</key>
109+
<string>Read QR codes</string>
110+
</dict>
111+
</plist>
112+
```
113+
114+
## 使用法
115+
116+
「Barcode Scanner」プラグインは JavaScript で利用できます。
117+
118+
```javascript
119+
import { scan, Format } from '@tauri-apps/plugin-barcode-scanner';
120+
// `"withGlobalTauri": true` を使用する場合は、
121+
// const { scan, Format } = window.__TAURI__.barcodeScanner; を使用できます;
122+
123+
// `windowed: true` は、カメラ用に別のビューを開くのではなく、
124+
// 実際には Webview を透明に設定します
125+
// 要素の透明化により下にあるものが表示されるように、ユーザーインターフェースを設定しておいてください
126+
scan({ windowed: true, formats: [Format.QRCode] });
127+
```
128+
129+
## アクセス権の設定
130+
131+
デフォルトでは、潜在的に危険なプラグイン・コマンドとそのスコープ(有効範囲)はすべてブロックされており、アクセスできません。これらを有効にするには、`capabilities` 設定でアクセス権限を変更する必要があります。
132+
133+
詳細については「[セキュリティ・レベル Capabilities](/ja/security/capabilities/)」の章を参照してください。また、プラグインのアクセス権限を設定するには「[プライグン・アクセス権の使用](/ja/learn/security/using-plugin-permissions/)」の章のステップ・バイ・ステップ・ガイドを参照してください。
134+
135+
```json title="src-tauri/capabilities/mobile.json"
136+
{
137+
"$schema": "../gen/schemas/mobile-schema.json",
138+
"identifier": "mobile-capability",
139+
"windows": ["main"],
140+
"platforms": ["iOS", "android"],
141+
"permissions": ["barcode-scanner:allow-scan", "barcode-scanner:allow-cancel"]
142+
}
143+
```
144+
145+
<PluginPermissions plugin={frontmatter.plugin} />
146+
147+
<div style="text-align: right;">
148+
【※ この日本語版は、「Jul 1, 2025 英語版」に基づいています】
149+
</div>

0 commit comments

Comments
 (0)