Device Variations
Sometimes "Tap to continue" should be "Click to continue" on Mac. Device variations let you provide platform-specific text within a single string key.
Supported Devices#
| Device | Key | Example |
|---|---|---|
| Mac | mac | "Click to continue" |
| iPhone | iphone | "Tap to continue" |
| iPad | ipad | "Tap or click to continue" |
| Apple TV | appletv | "Press to continue" |
| Apple Watch | applewatch | "Tap to continue" |
| Vision Pro | applevision | "Look and tap to continue" |
| Default | other | Fallback for unspecified devices |
How It Works#
{
"continue_action": {
"variations": {
"device": {
"mac": {
"stringUnit": { "value": "Click to continue" }
},
"other": {
"stringUnit": { "value": "Tap to continue" }
}
}
}
}
}The other category is required and serves as the fallback for any device not
explicitly listed.
When to Use#
Good candidates for device variations:
- Interaction verbs: tap, click, press, swipe
- Input references: keyboard, trackpad, touch
- Screen references: "on this screen" vs "in this window"
- Hardware features: Touch Bar, Digital Crown
When NOT to Use#
Skip device variations for:
- Generic actions like "Save" or "Cancel"
- Marketing copy and feature descriptions
- Text that doesn't reference user interaction
Each device variation needs to be translated separately. 6 device variations × 10 languages = 60 translations for one string. Use them sparingly.
Combined with Plurals#
You can nest device variations inside plurals:
{
"plural": {
"one": {
"variations": {
"device": {
"mac": { "value": "Click to see %lld photo" },
"other": { "value": "Tap to see %lld photo" }
}
}
},
"other": {
"variations": {
"device": {
"mac": { "value": "Click to see %lld photos" },
"other": { "value": "Tap to see %lld photos" }
}
}
}
}
}This multiplies complexity quickly, so only combine when necessary.