Skip to content

Commit 4a2af9a

Browse files
committed
Updated documentation
1 parent 5dbdfaa commit 4a2af9a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: Documentation/Examples.md

+8
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ There are some points to keep in mind when using Color palettes, see [About Colo
7878
let welcomeMessage = NSLocalizedString("welcome.message", comment: "")
7979
let settingsTitle = NSLocalizedString("title", tableName: "Settings", comment: "")
8080

81+
// Formatted strings
8182
let welcomeName = String(format: NSLocalizedString("welcome.withName", comment: ""), locale: NSLocale.currentLocale(), "Alice")
83+
84+
// Stringsdict files
85+
let progress = String(format: NSLocalizedString("copy.progress", comment: ""), locale: NSLocale.currentLocale(), 4, 23)
8286
```
8387

8488
*With R.swift*
@@ -87,7 +91,11 @@ let welcomeName = String(format: NSLocalizedString("welcome.withName", comment:
8791
let welcomeMessage = R.string.localizable.welcomeMessage()
8892
let settingsTitle = R.string.settings.title()
8993

94+
// Functions with parameters are generated for format strings
9095
let welcomeName = R.string.localizable.welcomeWithName("Alice")
96+
97+
// Functions with named argument labels are generated for stringsdict keys
98+
let progress = R.string.localizable.copyProgress(completed: 4, total: 23)
9199
```
92100

93101
## Storyboards

0 commit comments

Comments
 (0)