| name | moko-strings-guide |
| description | Moko Resources string management for Mangala Wallet - XML string format, i18n parameterization, resource file locations, localization best practices. Auto-applies when editing string resources or user-facing text. |
| user-invocable | false |
Moko Resources String Guide
Mangala Wallet uses Moko Resources (SharedMR) for shared string resources across platforms.
File Locations
common/mokoresources/src/commonMain/moko-resources/
├── base/
│ └── strings.xml # English (default)
├── vi/
│ └── strings.xml # Vietnamese
└── files/
└── mangalawallet.db # Prepopulated SQLite database
String Format
<string name="screen_title">Send</string>
<string name="balance_display">%1$s %2$s</string>
<string name="insufficient_funds">Not enough %1$s. Available: %2$s %1$s</string>
<plurals name="token_count">
<item quantity="one">%d token</item>
<item quantity="other">%d tokens</item>
</plurals>
Naming Convention
<feature>_<screen>_<element>_<qualifier>
Examples:
<string name="send_title">Send</string>
<string name="send_address_label">Recipient address</string>
<string name="send_address_error_invalid">Invalid address format</string>
<string name="send_amount_placeholder">0.00</string>
<string name="send_confirm_button">Confirm and send</string>
<string name="common_cancel">Cancel</string>
<string name="common_retry">Try again</string>
<string name="common_loading">Loading...</string>
<string name="error_network">Could not connect. Check your connection and try again.</string>
Code Usage
import com.mangala.wallet.SharedMR
Text(text = stringResource(SharedMR.strings.send_title))
Text(text = stringResource(SharedMR.strings.balance_display, amount, symbol))
i18n Rules
- Never concatenate strings: Use parameterized strings (
%1$s) instead of "Hello " + name
- Never hardcode user-facing text: All visible text must come from
strings.xml
- No embedded numbers/currencies: Use parameters for dynamic values
- Keep strings short: Some languages expand 30-50% (German, Finnish)
- Avoid idioms: Phrases like "piece of cake" don't translate well
- Escape apostrophes: Use
\' in XML strings (<string name="x">can\'t</string>)
- Use sentence case: "Send transaction" not "Send Transaction" (title case varies by language)