共有UIテキストをローカライズする
共有リソースから翻訳済み文字列を提供します
「共有UIテキストをローカライズする」はCoddyKit上の無料Kotlin Multiplatform Academyレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはKotlin Multiplatform Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Speak Every Language
To reach the world, your UI text must adapt to each user. Localization serves the right language from your shared resources. 🌍
Start From Shared Strings
Localization builds on the shared strings you already defined. You keep the same keys but add translations for each language.
Folders per Language
You add a values folder tagged with a language code, like values-es for Spanish. Each holds the same keys, translated.
Same Key, Different Text
The key welcome exists in every folder. Only the value changes, so your code never has to know the language.
<string name="welcome">Bienvenido de nuevo!</string>The Default Folder
The plain values folder is your fallback. If a translation is missing, Compose shows this default text instead of crashing.
Code Stays Unchanged
Your screen still calls stringResource with the same key. The right language is picked automatically at runtime.
Text(stringResource(Res.string.welcome))Compose Reads the Locale
Compose checks the device locale and selects the matching folder. Spanish devices get values-es, others get the default.
Plurals Need Care
One item versus many needs different wording. A plural resource lets each language choose the correct form for a count.
Text(pluralStringResource(Res.plurals.items, count, count))Format With Arguments
Word order differs by language. Use placeholders so each translation arranges values naturally for its grammar.
<string name="greeting">Hola, %1$s!</string>Test in Multiple Languages
Switch the device or emulator language and rerun. Seeing real translations early catches layout and length surprises. ✅
One Codebase, Many Locales
Because translations live in shared resources, both apps localize from the same files. Add a language once, ship it everywhere. 🙂
Quick Check
How do you provide Spanish text for an existing string key?
Recap: Worldwide From Shared Code
You added locale folders, kept the same keys, and let Compose pick the language automatically. One codebase, many locales. 🌐
よくある質問
「共有UIテキストをローカライズする」レッスンは無料ですか?
はい。「共有UIテキストをローカライズする」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Kotlin Multiplatform Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Kotlin Multiplatform Academyコースには全4レッスンが含まれています。
「共有UIテキストをローカライズする」で何を学びますか?
共有リソースから翻訳済み文字列を提供します ブラウザで直接実行するハンズオンコードでKotlin Multiplatform Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Kotlin Multiplatform Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのKotlin Multiplatform Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「共有UIテキストをローカライズする」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このKotlin Multiplatform Academyレッスンでコードを書いて実行できますか?
はい。すべてのKotlin Multiplatform Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- 共有画面間を移動する
- ArgumentsとDeep Linksを渡す
- 共有Images、Fonts、Strings
- 共有UIテキストをローカライズする