Skip to content

Commit 3f4d441

Browse files
committed
Don't trim \ and " from keys
1 parent 0dd3713 commit 3f4d441

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

Example/Source/SPExample.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ - (void)doSomething
3737

3838
NSLog(@"%@", SPLocalizedString(@"Hello world!", @"First hello world"));
3939
NSLog(@"%@", SPLocalizedString(@"Hello world!", @"Second hello world"));
40+
NSLog(@"%@", SPLocalizedString(@"Hello \"%@\"", @"Hello world with name"), @"Sergio");
4041
NSLog(@"%@", SPLocalizedStringFromTable(@"Hello world!", @"Another text from another table", @"OtherTable"));
4142
NSLog(@"%@", SPLocalizedStringFromTable(variableTable, @"Another variable text from another table", @"OtherTable"));
4243
NSLog(@"%@", SPLocalizedString(variable, @"Context for variable string"));
43-
44+
4445
for (NSUInteger count = 1; count < 5; count ++)
4546
{
4647
NSString *formatString = SPLocalizedStringPlural(@"%d people is following you", @"Followers label description", count);
-423 Bytes
Binary file not shown.
-147 Bytes
Binary file not shown.

spgenstrings/Core/Source/DTLocalizableStringEntry.m

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ - (void) setRawKey:(NSString *)rawKey {
9999
- (NSString *)key
100100
{
101101
if (_context && _useRawKey == NO) {
102-
NSString *trimmedKey = [_rawKey stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\""]];
103-
return [NSString stringWithFormat:@"(%@)%@", _context, trimmedKey];
102+
return [NSString stringWithFormat:@"(%@)%@", _context, _rawKey];
104103
} else {
105104
return _rawKey;
106105
}

0 commit comments

Comments
 (0)