0Pricing
Kotlin Multiplatform Academy · Lesson

Localize Shared UI Text

Serve translated strings from shared resources.

Localize Shared UI Text is a free Kotlin Multiplatform Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Kotlin Multiplatform Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

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. 🌐

Frequently asked questions

Is the “Localize Shared UI Text” lesson free?

Yes — the full text of “Localize Shared UI Text” is free to read here on the web, and the Kotlin Multiplatform Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Kotlin Multiplatform Academy course, upgrade to CoddyKit PRO.

What will I learn in “Localize Shared UI Text”?

Serve translated strings from shared resources. You practise Kotlin Multiplatform Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Kotlin Multiplatform Academy?

No prior experience is required. Kotlin Multiplatform Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Localize Shared UI Text” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Kotlin Multiplatform Academy lesson?

Yes. Every Kotlin Multiplatform Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Navigate Between Shared Screens
  2. Pass Arguments & Deep Links
  3. Shared Images, Fonts & Strings
  4. Localize Shared UI Text
← Back to Kotlin Multiplatform Academy