Skip to content

Commit ae52ac0

Browse files
committed
Add %% examples
1 parent b9b874e commit ae52ac0

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

Examples/ResourceApp/ResourceApp/Strings/Generic.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
"precision2" = "two - %12.2f";
1313
"precision3" = "three - %12.4f";
1414
"precision4" = "four - %.2f";
15+
"discount10" = "Today, 10%% off!";
16+
"discountX" = "Today, %d%% off!";
17+
"url" = "http%%3A%%2F%%2Fwww.abc.xyz";

Examples/ResourceApp/ResourceApp/Strings/en.lproj/Localizable.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ one = One;
1111
two = 2;
1212

1313
"quote" = "There are %d lights!";
14+
"discount10" = "Today, 10%% off!";
15+
"discountX" = "Today, %d%% off!";

Examples/ResourceApp/ResourceApp/Strings/es.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
one = Uno;
1111
two = 2;
1212

13-
"quote" = "Hay %d luces!";
13+
"quote" = "Hay %d luces!";
14+
"discount10" = "Today, 10%% off!";
15+
"discountX" = "Today, %d%% off!";

Examples/ResourceApp/ResourceApp/Strings/ja.lproj/Localizable.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ one = "一つ";
1111
two = 2;
1212

1313
"quote" = "%dつの光があります!";
14+
"discount10" = "Today, 10%% off!";
15+
"discountX" = "Today, %d%% off!";
1416
"japanese only" = "Not translated in other languages, and there is no Base";

Examples/ResourceApp/ResourceAppTests/StringsTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ class StringsTests: XCTestCase {
5050
XCTAssertEqual(stringsFR.generic.precision3(12345.678), "three - 12\u{202F}345,6780")
5151
XCTAssertEqual(stringsFR.generic.precision4(12345.678), "four - 12\u{202F}345,68")
5252

53+
XCTAssertEqual(R.string.generic.discount10(), "Today, 10% off!")
54+
XCTAssertEqual(R.string.generic.discountX(20), "Today, 20% off!")
55+
XCTAssertEqual(R.string.localizable.discount10(), "Today, 10% off!")
56+
XCTAssertEqual(R.string.localizable.discountX(20), "Today, 20% off!")
57+
XCTAssertEqual(R.string.generic.url(), "http%3A%2F%2Fwww.abc.xyz")
58+
5359
XCTAssertEqual(
5460
R.string.settings.multilineKeyWeird(),
5561
NSLocalizedString("Multiline\t\\key/\n\"weird\"?!", tableName: "Settings", comment: ""))

0 commit comments

Comments
 (0)