|
| 1 | +/* A comment */ |
| 2 | +"key" = "localized translation here"; |
| 3 | +/* A value with escaped characters */ |
| 4 | +"key.key" = "Hello \"World\"!"; |
| 5 | +/* Keys with escaped characters */ |
| 6 | +"it's a \" = " = "trap"; |
| 7 | +"it's another \\" = "trap"; |
| 8 | +/* A multi-line value */ |
| 9 | +"error.message" = "One line. |
| 10 | +Another line."; |
| 11 | +/* A multi-line |
| 12 | + comment |
| 13 | +*/ |
| 14 | +"comment" = "comment"; |
| 15 | +/* Below are two keys with leading spaces to test against malformatted files */ |
| 16 | + "space" = "localized translation here"; |
| 17 | + "more.space" = "localized translation here"; |
| 18 | +/* Below are some entries with unusual spaces between key and value to test against malformed files */ |
| 19 | +"nospace"="localized translation here"; |
| 20 | +"space.nospace" ="localized translation here"; |
| 21 | +"nospace.space"= "localized translation here"; |
| 22 | +"lots of spaces" = "localized translation here"; |
| 23 | +/* Special case: \"%@\" can be tricky to detect */ |
| 24 | +"Key escaped parameter \"%@\"" = "localized translation here"; |
| 25 | +"Something \"something\" something \"else\"" = "localized translation here"; |
| 26 | +/* |
| 27 | + * Duplicated keys |
| 28 | + */ |
| 29 | +/* Consecutive duplicated keys */ |
| 30 | +"dup1" = "localized translation here"; |
| 31 | +"dup1" = "localized translation here"; |
| 32 | +/* Duplicated keys with other entries in between */ |
| 33 | +"dup2" = "localized translation here"; |
| 34 | +"not dup" = "localized translation here"; |
| 35 | +"dup2" = "localized translation here"; |
| 36 | +"dup3" = "localized translation here"; |
| 37 | +"not dup 2" = "localized translation here"; |
| 38 | +"not dup 3" = "localized translation here"; |
| 39 | +"dup3" = "localized translation here"; |
| 40 | +/* Duplicated keys with different translations are still duplicated */ |
| 41 | +"dup4" = "a translation"; |
| 42 | +"dup4" = "a different translation"; |
| 43 | +/* Duplicated comments should be ignored */ |
| 44 | +"key with dup comment" = "localized translation here"; |
| 45 | +/* Duplicated comments should be ignored */ |
| 46 | +"different key with dup comment" = "localized translation here"; |
| 47 | +/* Unicode codepoint escape — see https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html#//apple_ref/doc/uid/10000051i-CH6-SW13 */ |
| 48 | +/* Consecutive... */ |
| 49 | +"\U0025 key" = "\U0025 is the % symbol"; |
| 50 | +"\U0025 key" = "\U0025 is the % symbol"; |
| 51 | +/* ...and not consecutive */ |
| 52 | +"\U0026 key" = "\U0025 is the & symbol"; |
| 53 | +"unicode\U0020key" = "\U0020 is the space character"; |
| 54 | +"\U0026 key" = "\U0025 is the & symbol"; |
| 55 | +/* Special case: \"%@\" can be tricky to detect */ |
| 56 | +"The Google account \"%@\" doesn't match any account on WordPress.com" = "localized translation here"; |
| 57 | +/* A red herring that might be seen as duplicate to the previous one if our RegExp does not correctly account for escaped quotes */ |
| 58 | +"The Google account \"%@\" is invalid" = "localized translation here"; |
| 59 | +/* Duplicated keys that include escaped quotes */ |
| 60 | +"key with \"%@\" character" = "localized translation here"; |
| 61 | +"key with \"%@\" character" = "localized translation here"; |
| 62 | +/* Red herring: duplicated keys which include quotes and equal sign in their translations, making the RegExp mismatch all the preceding portion as being all part of the key */ |
| 63 | +"key with \"%@\" but diff translations" = "localized translation 1 for \"%@\" = 1"; |
| 64 | +"key with \"%@\" but diff translations" = "localized translation 2 for \"%@\" = 2"; |
| 65 | +/* Duplicated keys that include escaped quotes, interleaved */ |
| 66 | +"key with multiple \"%@\" escapes \":)\" in it" = "localized translation here"; |
| 67 | +"Login to a \"%@\" account" = "Login to a \"%@\" account"; // Here %@ = the service name, like Google |
| 68 | +"key with multiple \"%@\" escapes \":)\" in it" = "localized translation here"; |
| 69 | +"Login to a \"%@\" account" = "Login to a \"%@\" account"; // Here %@ = the service name, like Google |
| 70 | +/* Duplicated keys with escaped quotes and equals */ |
| 71 | +"key with \"%@\" and = character" = "localized translation here"; |
| 72 | +"key with \"%@\" and = character" = "localized translation here"; |
| 73 | +"key with \"%@\" character and equal in translation" = "localized = translation here"; |
| 74 | +"key with \"%@\" character and equal in translation" = "localized = translation here"; |
| 75 | +/* Duplicated keys with trailing spaces */ |
| 76 | +"key with trailing spaces " = "localized translation here"; |
| 77 | +"key with trailing spaces " = "localized translation here"; |
| 78 | +/* What happens if a key is repeated more than twice? */ |
| 79 | +"key repeated more than twice" = "a translation"; |
| 80 | +"key repeated more than twice" = "a translation"; |
| 81 | +"key repeated more than twice" = "a translation"; |
0 commit comments