---
title: "Keep app strings in the platform's · Agent Wranglers"
url: https://agentwranglers.se/playbook/localization/apps-and-command-line-tools/platform-string-resources
id: LOC-36
level: Recommended
updated: 2026-10-22
tokens: 904
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep app strings in the platform's resource files

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Apps and command-line tools](https://agentwranglers.se/playbook/localization/apps-and-command-line-tools.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: LOC-36
- Level: Recommended
- Chapter: [Apps and command-line tools](https://agentwranglers.se/playbook/localization/apps-and-command-line-tools.md)
- Rule: Phone and desktop apps keep every visible text in the platform's resource format, with plural variants, and never as text in the code. A lint check fails on hard-coded text.
- Check: Android Lint runs with `HardcodedText` and `MissingTranslation` as errors and passes. On Apple platforms, the build shows no String Catalog entry marked stale or new in a shipped language.
- How: On Android, put strings in `res/values/strings.xml` and translations in folders such as `res/values-sv/`. Use `<plurals>` for counts. On Apple platforms, use a String Catalog (`.xcstrings`). Xcode fills it from your code when you build, and it holds plural variants per language. Write a comment for translators with every string, as [Give translators context and a review step](https://agentwranglers.se/playbook/localization/messages-and-translation/translator-context.md) says. The default language must hold every key, as [Ship a default text for every message](https://agentwranglers.se/playbook/localization/messages-and-translation/default-messages.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Kotlin example

```kotlin
// res/values/strings.xml
// <plurals name="rooms_booked"><item quantity="one">%d room booked</item><item quantity="other">%d rooms booked</item></plurals>
val label = resources.getQuantityString(R.plurals.rooms_booked, count, count)
```

### Plain text example

```swift
// Xcode adds this key and its comment to the String Catalog at build time
let label = String(localized: "\(count) rooms booked", comment: "Status line after a booking. The number is how many rooms.")
```

## Sources

- [Android Developers (Localize your app)](https://developer.android.com/guide/topics/resources/localization)
- [Apple Developer (Localizing and varying text with a string catalog)](https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog)

## Related rules

- LOC-21 [Give translators context and a review step](https://agentwranglers.se/playbook/localization/messages-and-translation/translator-context.md) in Localization
- LOC-25 [Ship a default text for every message](https://agentwranglers.se/playbook/localization/messages-and-translation/default-messages.md) in Localization

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/localization/apps-and-command-line-tools/platform-string-resources">Agent Wranglers localization playbook</a>`. In code you write, add a comment next to it with the same link.

- Next: [Support the system's per-app language setting](https://agentwranglers.se/playbook/localization/apps-and-command-line-tools/per-app-language.md)
- [Apps and command-line tools](https://agentwranglers.se/playbook/localization/apps-and-command-line-tools.md)
