-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Japanese documentation #1125
Add Japanese documentation #1125
Conversation
WalkthroughThe recent changes involve the addition of a Japanese translation to the README files for the Freezed package, enhancing multilingual support. The primary README.md files across different language resources have been updated to include links to the new Japanese documentation, while a comprehensive README.md file for the Japanese translation has been created, detailing the features and usage of the Freezed package. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant README
participant Translation
User->>README: Access README
README->>Translation: Check available translations
Translation-->>README: Return links (English, Korean, Simplified Chinese, Japanese)
README-->>User: Display available translations
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (9)
resources/translations/ja_JP/README.md (9)
3-7
: Badges are informative and well-placed.The inclusion of badges for build status, package version, and community links is excellent. It provides users with quick access to important project information.
Consider localizing the text "Discord" in the Discord badge to Japanese for consistency with the rest of the document.
Tools
Markdownlint
7-7: null
Images should have alternate text (alt text)(MD045, no-alt-text)
15-30
: Excellent motivation section.This section clearly articulates the challenges of defining models in Dart and how Freezed addresses these issues. The before/after comparison image is a great addition to visually demonstrate the benefits.
Consider adding alt text to the comparison image for improved accessibility. For example:
-![before](https://raw.githubusercontent.com/rrousselGit/freezed/master/resources/before.png) | ![before](https://raw.githubusercontent.com/rrousselGit/freezed/master/resources/after.png) +![Before Freezed: Complex model definition](https://raw.githubusercontent.com/rrousselGit/freezed/master/resources/before.png) | ![After Freezed: Simplified model definition](https://raw.githubusercontent.com/rrousselGit/freezed/master/resources/after.png)
32-68
: Comprehensive table of contents.The table of contents provides an excellent overview of the document structure, making it easy for users to navigate to specific sections of interest.
Consider adjusting the Markdown indentation for better source readability. Use 2 spaces for each level of indentation consistently. For example:
- [モチベーション](#モチベーション) - [目次](#目次) - [使い方](#使い方) - [インストール](#インストール) - [invalid_annotation_targetのwarning無効化および生成されたファイル内のwarning](#invalid_annotation_targetのwarning無効化および生成されたファイル内のwarning) - [ジェネレーターの実行](#ジェネレーターの実行) - [Freezedを使用したモデルの作成](#freezedを使用したモデルの作成) - [イミュータブルクラスの代わりにミュータブルクラスを定義する](#イミュータブルクラスの代わりにミュータブルクラスを定義する) - [Lists/Maps/Setsの変更を許可する](#listsmapssetsの変更を許可する) - [copyWithの仕組み](#copywithの仕組み) - [発展: Deep copy](#発展-deep-copy) - [モデルにゲッターとメソッドを追加する](#モデルにゲッターとメソッドを追加する) - [アサート](#アサート) - [デフォルト値](#デフォルト値) - [デコーダーとコメント](#デコーダーとコメント) - [個々のクラスにミックスインとインタフェースを使用して合成型を作る](#個々のクラスにミックスインとインタフェースを使用して合成型を作る) - [FromJsonとToJson](#fromjsonとtojson) - [fromJson - 複数のコンストラクタを持つクラス](#fromjson---複数のコンストラクタを持つクラス) - [ジェネリッククラスのデシリアライズ](#ジェネリッククラスのデシリアライズ) - [ユニオン型](#ユニオン型) - [共有プロパティ](#共有プロパティ) - [パターンマッチングを使って非共有のプロパティを読み取る方法](#パターンマッチングを使って非共有のプロパティを読み取る方法) - [(レガシー)パターンマッチングユーティリティ](#レガシー-パターンマッチングユーティリティ) - [When](#when) - [Map](#map) - [設定](#設定) - [特定のモデルに対する動作変更](#特定のモデルに対する動作変更) - [プロジェクト全体の動作変更](#プロジェクト全体の動作変更) - [ユーティリティ](#ユーティリティ) - [IDE拡張機能](#ide拡張機能) - [VSCode用のFreezed拡張機能](#vscode用のfreezed拡張機能) - [IntelliJとAndroid StudioのFreezed拡張機能](#intellijとandroid-studioのfreezed拡張機能) - [サードパーティツール](#サードパーティツール) - [DartJ](#dartj) - [スポンサー](#スポンサー)Tools
Markdownlint
37-37: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
38-38: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
39-39: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
40-40: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
41-41: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
42-42: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
43-43: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
44-44: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
45-45: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
46-46: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
47-47: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
48-48: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
49-49: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
50-50: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
51-51: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
53-53: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
54-54: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
55-55: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
56-56: Expected: 6; Actual: 12
Unordered list indentation(MD007, ul-indent)
57-57: Expected: 8; Actual: 16
Unordered list indentation(MD007, ul-indent)
58-58: Expected: 8; Actual: 16
Unordered list indentation(MD007, ul-indent)
59-59: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
60-60: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
61-61: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
63-63: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
64-64: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
65-65: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
66-66: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
67-67: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
68-68: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
56-56: null
Link fragments should be valid(MD051, link-fragments)
141-189
: Excellent example of creating models with Freezed.This section provides a clear and comprehensive example of how to create a Freezed class, explaining the generated properties and methods. The inclusion of JSON serialization in the example is particularly helpful.
Consider adding a brief explanation of the
@freezed
annotation at the beginning of this section. For example:The `@freezed` annotation is the core of Freezed's functionality. It tells the code generator to create an immutable data class with all the boilerplate code for you. Here's a typical example of a Freezed class:This additional context would help users understand the purpose and importance of the annotation.
Tools
Markdownlint
175-175: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
176-176: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
177-177: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
239-269
: Good explanation of collection mutability options.This section clearly explains the default immutable behavior of collections in Freezed classes and how to make them mutable using the
makeCollectionsUnmodifiable: false
option. The example effectively demonstrates the usage.Consider adding a brief note about the potential drawbacks of making collections mutable. For example:
Note: While making collections mutable can be convenient, it can also lead to unexpected behavior if not handled carefully. Mutable collections in otherwise immutable classes can potentially break the immutability contract and lead to side effects. Use this feature judiciously and consider the implications for your specific use case.This additional information would help developers make informed decisions about when to use mutable collections.
389-421
: Clear explanation of adding custom methods and getters.This section effectively explains how to add custom methods and getters to Freezed classes using a private empty constructor. The example demonstrates the necessary syntax changes.
Consider adding a more concrete example of a custom method or getter to illustrate practical usage. For example:
@freezed class Person with _$Person { const Person._(); const factory Person(String name, int age) = _Person; String get description => 'Person: $name, $age years old'; bool isAdult() => age >= 18; }This addition would help developers understand how to implement practical custom functionality in their Freezed classes.
Tools
LanguageTool
[uncategorized] ~407-~407: 「ことができる」という表現は冗長な可能性があります。
Context: ...り、次のように生成されたコードが実装する代わりに、継承やサブクラス化することができるようになります(デフォルトだと型のみを継承し、プロパティやメソッドは継承されませ...(DOUSI_KOTOGADEKIRU)
Markdownlint
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
951-1090
: Comprehensive guide on pattern matching in Freezed.This section provides a clear explanation of how to use pattern matching to read non-shared properties in union types. The examples demonstrate both Dart 3's built-in
switch
pattern matching and legacy pattern matching utilities. The warning about transitioning away from legacy utilities is important for maintaining future-proof code.Consider emphasizing more strongly the preference for using Dart 3's native pattern matching. You could add a note like:
> [!important] > If you're using Dart 3, it's strongly recommended to use the native `switch` pattern matching instead of Freezed's legacy utilities. This will make your code more idiomatic and easier to maintain in the long run.This would help guide developers towards the most current and recommended practices.
Tools
LanguageTool
[uncategorized] ~962-~962: 「ことができる」という表現は冗長な可能性があります。
Context: ...3の組み込みのswitch
を用いたパターンマッチングを使用して、次のように書くことができます。 ```dart switch (example) { Person(...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1001-~1001: 「ことができる」という表現は冗長な可能性があります。
Context: ...rorDetails; }このとき、[when]を次のように使用することができます。
dart var union = Union(42); pri...(DOUSI_KOTOGADEKIRU)
Markdownlint
971-971: null
Link fragments should be valid(MD051, link-fragments)
1164-1202
: Useful information on Freezed utilities and extensions.This section provides valuable information about IDE extensions for VSCode and IntelliJ/Android Studio, as well as a third-party tool (DartJ) for generating Freezed classes from JSON. These utilities can significantly improve developer productivity when working with Freezed.
In the IntelliJ and Android Studio section, there's an English sentence that should be translated to Japanese for consistency:
-You can get Live Templates for boiler plate code [here](https://github.com/Tinhorn/freezed_intellij_live_templates). +IntelliJやAndroid Studioでは、[こちら](https://github.com/Tinhorn/freezed_intellij_live_templates)から定型コード用のライブテンプレートを入手できます。This will maintain the document's language consistency.
1204-1217
: Appropriate acknowledgment of sponsors.Including a sponsors section is a great way to recognize the support for the project. The use of an SVG image allows for a visually appealing display of sponsors.
Consider adding alt text to the sponsors image for improved accessibility. For example:
- <img src='https://raw.githubusercontent.com/rrousselGit/freezed/master/sponsorkit/sponsors.svg'/> + <img src='https://raw.githubusercontent.com/rrousselGit/freezed/master/sponsorkit/sponsors.svg' alt='Freezed project sponsors'/>This will make the content more accessible to users relying on screen readers.
Tools
Markdownlint
1207-1207: null
Images should have alternate text (alt text)(MD045, no-alt-text)
1214-1214: null
Link fragments should be valid(MD051, link-fragments)
1212-1212: Duplicate link or image reference definition: "freezed"
Link and image reference definitions should be needed(MD053, link-image-reference-definitions)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- packages/freezed/README.md (1 hunks)
- resources/translations/ja_JP/README.md (1 hunks)
- resources/translations/ko_KR/README.md (1 hunks)
- resources/translations/zh_CN/README.md (1 hunks)
Files skipped from review due to trivial changes (1)
- resources/translations/ko_KR/README.md
Additional context used
LanguageTool
resources/translations/ja_JP/README.md
[uncategorized] ~214-~214: 「ことができる」という表現は冗長な可能性があります。
Context: ...meと
lastName`がミュータブルになりました。そのため、次のように書くことができます。 ```dart void main() { var p...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~285-~285: 「ことができる」という表現は冗長な可能性があります。
Context: ...int? age) = _Person; }このとき、次のように書くことができます。
dart void main() { var person ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~339-~339: 「ことができる」という表現は冗長な可能性があります。
Context: ...く冗長になってしまいます。 ここで、[Freezed]の「deep copy」を使用することができます。 Freezedモデルが他のFreezedモデルをプロパティとし...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~351-~351: 「ことができる」という表現は冗長な可能性があります。
Context: ...文をさらに深く掘り下げると、ディレクターの名前を変更したい場合は、次のように書くことができます。 ```dart Company company; Company ne...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~383-~383: 「ことができる」という表現は冗長な可能性があります。
Context: ...敗します。 これを修正するには、?.call
演算子を使用して次のように書くことができます。 ```dart Company? newCompany = compa...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~407-~407: 「ことができる」という表現は冗長な可能性があります。
Context: ...り、次のように生成されたコードが実装する代わりに、継承やサブクラス化することができるようになります(デフォルトだと型のみを継承し、プロパティやメソッドは継承されませ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~487-~487: 「ことができる」という表現は冗長な可能性があります。
Context: ...enderプロパティに
@deprecated`を付けたい場合は、次のよう書くことができます。 ```dart @freezed class Person with ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~521-~521: 「ことができる」という表現は冗長な可能性があります。
Context: ...クラスをデコレートしたい場合は、定義するファクトリコンストラクタをデコレートすることができます。 そのため、_Person
を非推奨にするには、次のように書くことがで...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~523-~523: 「ことができる」という表現は冗長な可能性があります。
Context: ...とができます。 そのため、_Person
を非推奨にするには、次のように書くことができます。 ```dart @freezed class Person with ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~585-~585: 「ことができる」という表現は冗長な可能性があります。
Context: ...それらをユニオン型のコンストラクタに追加することにより、インターフェース契約を満たすことができます。 インターフェイスがメソッドやゲッターを定義していて、それをクラスで実...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~816-~816: 「ことができる」という表現は冗長な可能性があります。
Context: ...生成されたプロパティにも"コピー&ペースト"されます。 したがって、次のように書くことができます。 ```dart @freezed class Example wit...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~842-~842: 「ことができる」という表現は冗長な可能性があります。
Context: ...lizableフラグを定義したい場合、build.yaml
ファイルで設定することができます。詳細は[こちら](https://pub.dev/packages/jso...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~855-~855: 「ことができる」という表現は冗長な可能性があります。
Context: ... 簡単に言うと、Freezedクラスでは、次のように複数のコンストラクタを書くことができます。 ```dart @freezed sealed class Union...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~871-~871: 「ことができる」という表現は冗長な可能性があります。
Context: ...ードが推奨されます。 これにより、私たちのモデルは相互排他的な異なる状態を持つことができるようになりました。 具体的には、このスニペットでは、Union
というモデル...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~896-~896: 「ことができる」という表現は冗長な可能性があります。
Context: ...ンストラクタを定義すると、すべてのコンストラクタに共通でないプロパティを読み取ることができなくなります。 例えば、次のように書くとします。 ```dart @free...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~908-~908: 「ことができる」という表現は冗長な可能性があります。
Context: ...ty; }すると、`age`と`population`は直接読み取ることができなくなります。
dart var example = Example.p...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~918-~918: 「ことができる」という表現は冗長な可能性があります。
Context: ...両方のコンストラクタで共通しているプロパティです。 したがって、次のように書くことができます。 ```dart var example = Example.perso...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~928-~928: 「ことができる」という表現は冗長な可能性があります。
Context: ...ストラクタ共通で定義されたプロパティでは、次のようにcopyWith
を使用することができます。 ```dart var example = Example.pers...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~962-~962: 「ことができる」という表現は冗長な可能性があります。
Context: ...3の組み込みのswitch
を用いたパターンマッチングを使用して、次のように書くことができます。 ```dart switch (example) { Person(...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1001-~1001: 「ことができる」という表現は冗長な可能性があります。
Context: ...rorDetails; }このとき、[when]を次のように使用することができます。
dart var union = Union(42); pri...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1101-~1101: 「ことができる」という表現は冗長な可能性があります。
Context: ...スに対して生成されるコードをカスタマイズしたい場合、別のアノテーションを使用することができます。 ```dart @freezed() class Person wit...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1139-~1139: 「ことができる」という表現は冗長な可能性があります。
Context: ...d`に渡すオプションと同様のオプションを設定できます(上記参照)。 次のように書くことができます。 ```yaml targets: $default: b...(DOUSI_KOTOGADEKIRU)
Markdownlint
resources/translations/ja_JP/README.md
37-37: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
38-38: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
39-39: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
40-40: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
41-41: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
42-42: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
43-43: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
44-44: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
45-45: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
46-46: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
47-47: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
48-48: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
49-49: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
50-50: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
51-51: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
53-53: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
54-54: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
55-55: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
56-56: Expected: 6; Actual: 12
Unordered list indentation(MD007, ul-indent)
57-57: Expected: 8; Actual: 16
Unordered list indentation(MD007, ul-indent)
58-58: Expected: 8; Actual: 16
Unordered list indentation(MD007, ul-indent)
59-59: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
60-60: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
61-61: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
63-63: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
64-64: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
65-65: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
66-66: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
67-67: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
68-68: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
175-175: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
176-176: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
177-177: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
367-367: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
121-121: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
1131-1131: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
7-7: null
Images should have alternate text (alt text)(MD045, no-alt-text)
1207-1207: null
Images should have alternate text (alt text)(MD045, no-alt-text)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
56-56: null
Link fragments should be valid(MD051, link-fragments)
586-586: null
Link fragments should be valid(MD051, link-fragments)
844-844: null
Link fragments should be valid(MD051, link-fragments)
971-971: null
Link fragments should be valid(MD051, link-fragments)
1214-1214: null
Link fragments should be valid(MD051, link-fragments)
1212-1212: Duplicate link or image reference definition: "freezed"
Link and image reference definitions should be needed(MD053, link-image-reference-definitions)
Additional comments not posted (18)
resources/translations/zh_CN/README.md (1)
1-1
: LGTM: Japanese translation link added correctlyThe new language link for Japanese (日本語) has been added correctly to the translation section. The link format and path are consistent with the existing language links.
resources/translations/ja_JP/README.md (16)
1-1
: Language selection looks good!The README provides easy access to different language versions, including English, Korean, Chinese, and Japanese. This is a great way to make the documentation accessible to a wider audience.
9-13
: Clear and informative introduction.The introduction succinctly explains Freezed's purpose and includes an important note about the macro-based preview. This helps users understand the current state and future direction of the project.
72-115
: Clear and comprehensive installation instructions.The installation section provides detailed steps for both Flutter and Dart projects, including the necessary commands to add dependencies. The note about potential warnings related to
invalid_annotation_target
is a helpful addition for users who might encounter this issue.
117-139
: Well-explained generator execution instructions.This section clearly outlines how to run the code generator and set up the necessary imports. The tip about importing
package:flutter/foundation.dart
for improved debugging in Flutter's devtools is particularly valuable for developers.Tools
Markdownlint
121-121: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
191-237
: Clear explanation of mutable classes with @unfreezed.This section effectively explains how to create mutable classes using the
@unfreezed
annotation. The example clearly demonstrates the differences from immutable classes, including the ability to modify properties and the limitations such as the lack of==
implementation andconst
constructor. This information is crucial for developers choosing between mutable and immutable implementations.Tools
LanguageTool
[uncategorized] ~214-~214: 「ことができる」という表現は冗長な可能性があります。
Context: ...meと
lastName`がミュータブルになりました。そのため、次のように書くことができます。 ```dart void main() { var p...(DOUSI_KOTOGADEKIRU)
271-300
: Excellent explanation of copyWith functionality.This section provides a clear and comprehensive explanation of how the
copyWith
method works in Freezed classes. The examples effectively demonstrate its usage, including how to handle null values. The note about Freezed supportingcopyWith(age: null)
is particularly valuable, as it's a common pain point in other implementations.Tools
LanguageTool
[uncategorized] ~285-~285: 「ことができる」という表現は冗長な可能性があります。
Context: ...int? age) = _Person; }このとき、次のように書くことができます。
dart void main() { var person ...(DOUSI_KOTOGADEKIRU)
302-387
: Comprehensive explanation of deep copy functionality.This section provides an excellent explanation of Freezed's deep copy feature. The examples effectively demonstrate how to use deep copy with nested Freezed objects, which is a common scenario in complex data models. The explanation of null handling in deep copy is particularly valuable and addresses an important edge case.
Tools
LanguageTool
[uncategorized] ~339-~339: 「ことができる」という表現は冗長な可能性があります。
Context: ...く冗長になってしまいます。 ここで、[Freezed]の「deep copy」を使用することができます。 Freezedモデルが他のFreezedモデルをプロパティとし...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~351-~351: 「ことができる」という表現は冗長な可能性があります。
Context: ...文をさらに深く掘り下げると、ディレクターの名前を変更したい場合は、次のように書くことができます。 ```dart Company company; Company ne...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~383-~383: 「ことができる」という表現は冗長な可能性があります。
Context: ...敗します。 これを修正するには、?.call
演算子を使用して次のように書くことができます。 ```dart Company? newCompany = compa...(DOUSI_KOTOGADEKIRU)
Markdownlint
367-367: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
423-437
: Clear explanation of assertions in Freezed classes.This section effectively explains how to add assertions to Freezed classes using the
@Assert
decorator. The example demonstrates the usage of multiple assertions, which is a valuable feature for ensuring data integrity at runtime. This information is crucial for developers who need to enforce certain conditions on their data models.
439-453
: Concise explanation of default values in Freezed classes.This section clearly explains how to specify default values for properties in Freezed classes using the
@Default
annotation. The example effectively demonstrates its usage. The note about the automatic addition of@JsonKey(defaultValue: <something>)
for serialization is a helpful detail for developers working with JSON data.
455-535
: Excellent explanation of decorators and comments in Freezed.This section provides a comprehensive guide on how to add decorators and documentation comments to properties and classes in Freezed. The examples effectively demonstrate the usage of documentation comments and the
@deprecated
decorator. The explanation of how decorators affect various generated elements (constructors, properties, copyWith) is particularly valuable, as it helps developers understand the full impact of using decorators in their Freezed classes.Tools
LanguageTool
[uncategorized] ~487-~487: 「ことができる」という表現は冗長な可能性があります。
Context: ...enderプロパティに
@deprecated`を付けたい場合は、次のよう書くことができます。 ```dart @freezed class Person with ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~521-~521: 「ことができる」という表現は冗長な可能性があります。
Context: ...クラスをデコレートしたい場合は、定義するファクトリコンストラクタをデコレートすることができます。 そのため、_Person
を非推奨にするには、次のように書くことがで...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~523-~523: 「ことができる」という表現は冗長な可能性があります。
Context: ...とができます。 そのため、_Person
を非推奨にするには、次のように書くことができます。 ```dart @freezed class Person with ...(DOUSI_KOTOGADEKIRU)
537-590
: Comprehensive guide on using mixins and interfaces with Freezed classes.This section provides an excellent explanation of how to implement interfaces and use mixins with specific types in a Freezed union. The examples clearly demonstrate the usage of
@Implements
and@With
decorators, including how to handle generic types. The notes about implementing abstract members and the limitations of using these decorators with Freezed classes are particularly valuable for developers working with complex class hierarchies.Tools
LanguageTool
[uncategorized] ~585-~585: 「ことができる」という表現は冗長な可能性があります。
Context: ...それらをユニオン型のコンストラクタに追加することにより、インターフェース契約を満たすことができます。 インターフェイスがメソッドやゲッターを定義していて、それをクラスで実...(DOUSI_KOTOGADEKIRU)
Markdownlint
586-586: null
Link fragments should be valid(MD051, link-fragments)
592-782
: Excellent guide on JSON serialization with Freezed.This section provides a comprehensive explanation of how to make Freezed classes compatible with json_serializable. The step-by-step instructions and examples clearly demonstrate how to add JSON serialization support. The information on handling multiple constructors, including the use of
runtimeType
for constructor selection, is particularly valuable. The explanation of how to handle generic classes and the use of custom converters adds depth to the guide, making it a robust resource for developers working with complex data models and JSON serialization.
846-892
: Clear introduction to union types in Freezed.This section effectively introduces the concept of union types in Freezed and demonstrates how to define them using multiple constructors. The example is clear and illustrative. The note about using the
sealed
keyword in Dart 3 is particularly important, as it helps users understand the differences between Dart 2 and Dart 3 implementations and encourages the use of native pattern matching in Dart 3.Tools
LanguageTool
[uncategorized] ~855-~855: 「ことができる」という表現は冗長な可能性があります。
Context: ... 簡単に言うと、Freezedクラスでは、次のように複数のコンストラクタを書くことができます。 ```dart @freezed sealed class Union...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~871-~871: 「ことができる」という表現は冗長な可能性があります。
Context: ...ードが推奨されます。 これにより、私たちのモデルは相互排他的な異なる状態を持つことができるようになりました。 具体的には、このスニペットでは、Union
というモデル...(DOUSI_KOTOGADEKIRU)
894-949
: Comprehensive explanation of shared properties in union types.This section provides a clear and detailed explanation of how shared properties work in Freezed union types. The examples effectively demonstrate how to access shared properties and the limitations on accessing non-shared properties. The explanation of how
copyWith
behaves with shared properties is particularly valuable, as it helps developers understand the nuances of working with union types in Freezed.Tools
LanguageTool
[uncategorized] ~896-~896: 「ことができる」という表現は冗長な可能性があります。
Context: ...ンストラクタを定義すると、すべてのコンストラクタに共通でないプロパティを読み取ることができなくなります。 例えば、次のように書くとします。 ```dart @free...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~908-~908: 「ことができる」という表現は冗長な可能性があります。
Context: ...ty; }すると、`age`と`population`は直接読み取ることができなくなります。
dart var example = Example.p...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~918-~918: 「ことができる」という表現は冗長な可能性があります。
Context: ...両方のコンストラクタで共通しているプロパティです。 したがって、次のように書くことができます。 ```dart var example = Example.perso...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~928-~928: 「ことができる」という表現は冗長な可能性があります。
Context: ...ストラクタ共通で定義されたプロパティでは、次のようにcopyWith
を使用することができます。 ```dart var example = Example.pers...(DOUSI_KOTOGADEKIRU)
1092-1162
: Excellent guide on Freezed configuration options.This section provides a comprehensive explanation of how to customize the code generated by Freezed. It clearly outlines the methods for changing behavior for specific models using the
@Freezed
annotation and for project-wide settings using thebuild.yaml
file. The examples effectively demonstrate various configuration options, making it easy for developers to understand how to tailor Freezed's behavior to their specific needs.Tools
LanguageTool
[uncategorized] ~1101-~1101: 「ことができる」という表現は冗長な可能性があります。
Context: ...スに対して生成されるコードをカスタマイズしたい場合、別のアノテーションを使用することができます。 ```dart @freezed() class Person wit...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1139-~1139: 「ことができる」という表現は冗長な可能性があります。
Context: ...d`に渡すオプションと同様のオプションを設定できます(上記参照)。 次のように書くことができます。 ```yaml targets: $default: b...(DOUSI_KOTOGADEKIRU)
Markdownlint
1131-1131: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
1-1217
: Excellent Japanese translation of the Freezed README.This translation provides a comprehensive and high-quality Japanese version of the Freezed package documentation. It covers all major aspects of using Freezed, from basic usage to advanced features, and includes valuable information about configuration, utilities, and third-party tools. The translation is clear, accurate, and maintains the technical integrity of the original document.
A few minor suggestions have been made throughout the review to further improve accessibility, consistency, and clarity. Overall, this translation will be extremely helpful for Japanese-speaking developers using the Freezed package.
Tools
LanguageTool
[uncategorized] ~214-~214: 「ことができる」という表現は冗長な可能性があります。
Context: ...meと
lastName`がミュータブルになりました。そのため、次のように書くことができます。 ```dart void main() { var p...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~285-~285: 「ことができる」という表現は冗長な可能性があります。
Context: ...int? age) = _Person; }このとき、次のように書くことができます。
dart void main() { var person ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~339-~339: 「ことができる」という表現は冗長な可能性があります。
Context: ...く冗長になってしまいます。 ここで、[Freezed]の「deep copy」を使用することができます。 Freezedモデルが他のFreezedモデルをプロパティとし...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~351-~351: 「ことができる」という表現は冗長な可能性があります。
Context: ...文をさらに深く掘り下げると、ディレクターの名前を変更したい場合は、次のように書くことができます。 ```dart Company company; Company ne...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~383-~383: 「ことができる」という表現は冗長な可能性があります。
Context: ...敗します。 これを修正するには、?.call
演算子を使用して次のように書くことができます。 ```dart Company? newCompany = compa...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~407-~407: 「ことができる」という表現は冗長な可能性があります。
Context: ...り、次のように生成されたコードが実装する代わりに、継承やサブクラス化することができるようになります(デフォルトだと型のみを継承し、プロパティやメソッドは継承されませ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~487-~487: 「ことができる」という表現は冗長な可能性があります。
Context: ...enderプロパティに
@deprecated`を付けたい場合は、次のよう書くことができます。 ```dart @freezed class Person with ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~521-~521: 「ことができる」という表現は冗長な可能性があります。
Context: ...クラスをデコレートしたい場合は、定義するファクトリコンストラクタをデコレートすることができます。 そのため、_Person
を非推奨にするには、次のように書くことがで...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~523-~523: 「ことができる」という表現は冗長な可能性があります。
Context: ...とができます。 そのため、_Person
を非推奨にするには、次のように書くことができます。 ```dart @freezed class Person with ...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~585-~585: 「ことができる」という表現は冗長な可能性があります。
Context: ...それらをユニオン型のコンストラクタに追加することにより、インターフェース契約を満たすことができます。 インターフェイスがメソッドやゲッターを定義していて、それをクラスで実...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~816-~816: 「ことができる」という表現は冗長な可能性があります。
Context: ...生成されたプロパティにも"コピー&ペースト"されます。 したがって、次のように書くことができます。 ```dart @freezed class Example wit...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~842-~842: 「ことができる」という表現は冗長な可能性があります。
Context: ...lizableフラグを定義したい場合、build.yaml
ファイルで設定することができます。詳細は[こちら](https://pub.dev/packages/jso...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~855-~855: 「ことができる」という表現は冗長な可能性があります。
Context: ... 簡単に言うと、Freezedクラスでは、次のように複数のコンストラクタを書くことができます。 ```dart @freezed sealed class Union...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~871-~871: 「ことができる」という表現は冗長な可能性があります。
Context: ...ードが推奨されます。 これにより、私たちのモデルは相互排他的な異なる状態を持つことができるようになりました。 具体的には、このスニペットでは、Union
というモデル...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~896-~896: 「ことができる」という表現は冗長な可能性があります。
Context: ...ンストラクタを定義すると、すべてのコンストラクタに共通でないプロパティを読み取ることができなくなります。 例えば、次のように書くとします。 ```dart @free...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~908-~908: 「ことができる」という表現は冗長な可能性があります。
Context: ...ty; }すると、`age`と`population`は直接読み取ることができなくなります。
dart var example = Example.p...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~918-~918: 「ことができる」という表現は冗長な可能性があります。
Context: ...両方のコンストラクタで共通しているプロパティです。 したがって、次のように書くことができます。 ```dart var example = Example.perso...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~928-~928: 「ことができる」という表現は冗長な可能性があります。
Context: ...ストラクタ共通で定義されたプロパティでは、次のようにcopyWith
を使用することができます。 ```dart var example = Example.pers...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~962-~962: 「ことができる」という表現は冗長な可能性があります。
Context: ...3の組み込みのswitch
を用いたパターンマッチングを使用して、次のように書くことができます。 ```dart switch (example) { Person(...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1001-~1001: 「ことができる」という表現は冗長な可能性があります。
Context: ...rorDetails; }このとき、[when]を次のように使用することができます。
dart var union = Union(42); pri...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1101-~1101: 「ことができる」という表現は冗長な可能性があります。
Context: ...スに対して生成されるコードをカスタマイズしたい場合、別のアノテーションを使用することができます。 ```dart @freezed() class Person wit...(DOUSI_KOTOGADEKIRU)
[uncategorized] ~1139-~1139: 「ことができる」という表現は冗長な可能性があります。
Context: ...d`に渡すオプションと同様のオプションを設定できます(上記参照)。 次のように書くことができます。 ```yaml targets: $default: b...(DOUSI_KOTOGADEKIRU)
Markdownlint
37-37: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
38-38: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
39-39: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
40-40: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
41-41: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
42-42: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
43-43: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
44-44: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
45-45: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
46-46: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
47-47: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
48-48: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
49-49: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
50-50: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
51-51: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
52-52: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
53-53: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
54-54: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
55-55: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
56-56: Expected: 6; Actual: 12
Unordered list indentation(MD007, ul-indent)
57-57: Expected: 8; Actual: 16
Unordered list indentation(MD007, ul-indent)
58-58: Expected: 8; Actual: 16
Unordered list indentation(MD007, ul-indent)
59-59: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
60-60: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
61-61: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
63-63: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
64-64: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
65-65: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
66-66: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
67-67: Expected: 4; Actual: 8
Unordered list indentation(MD007, ul-indent)
68-68: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
175-175: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
176-176: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
177-177: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
367-367: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
121-121: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
1131-1131: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
7-7: null
Images should have alternate text (alt text)(MD045, no-alt-text)
1207-1207: null
Images should have alternate text (alt text)(MD045, no-alt-text)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
407-407: Expected: underscore; Actual: asterisk
Emphasis style(MD049, emphasis-style)
56-56: null
Link fragments should be valid(MD051, link-fragments)
586-586: null
Link fragments should be valid(MD051, link-fragments)
844-844: null
Link fragments should be valid(MD051, link-fragments)
971-971: null
Link fragments should be valid(MD051, link-fragments)
1214-1214: null
Link fragments should be valid(MD051, link-fragments)
1212-1212: Duplicate link or image reference definition: "freezed"
Link and image reference definitions should be needed(MD053, link-image-reference-definitions)
packages/freezed/README.md (1)
1-1
: Great addition of Japanese translation!The inclusion of a Japanese translation link enhances the accessibility of the Freezed package documentation. The format is consistent with existing language options, and the order seems logical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
Thanks for the review! |
Freezed is also loved by many Flutter developers in Japan.
To help more people in Japan become familiar with Freezed, I have added Japanese documentation for it.