Repository navigation
example アプリを slang で多言語化(ドキュメントと同じ6言語) - #44
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
ドキュメントサイトと同じ en / ja / zh-Hans / de / fr / ko の6言語に example アプリを対応。言語は端末の設定に従い、対応外の言語では英語で表示。アプリ内の言語切り替えは設けていない。
変更内容
slang/slang_flutter/flutter_localizationsを example に追加し、example/lib/main.dartの文言をすべてexample/lib/i18n/*.i18n.jsonに移動build_runner(slang_build_runner)で行い、生成物はexample/.gitignoreで git 管理外にした(対象はexample/lib/i18n/*.g.dartのみ。ライブラリ本体には影響なし)。設定はexample/build.yamlci.yaml)の変更dart run build_runner buildを実行dart run slang analyze --fullの結果に未翻訳・未使用のキーがあれば失敗させるexample/build.yamlの変更でも package ジョブが動くよう paths-filter に追加Exception:の接頭辞を除去Info.plistにCFBundleLocalizationsを追加example/README.mdを Flutter の雛形から、生成手順と対応言語の説明に差し替え確認
dart pub publish --dry-run:警告 0 件。生成前のdart analyzeは失敗し、build_runner build後は format・analyze・flutter test(8件)がすべて成功example/lib/main.dartのソースを表示するだけで、生成物は不要補足
dart run build_runner buildが必要(README と import 行のコメントに記載)