-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #61 : Fix performance issue and add warnings
For each key, we looped through all the keys already read. This was very unefficient. Now we use a hash table to store the previous keys. Results: - 5 minutes export before optimization - less than 5 seconds after optimization What's more, we added some warnings along the way when we see duplicates, or singular / plural mismatch.
- Loading branch information
Showing
10 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
test/fixtures/exports_reference_duplicates/en.lproj/Localizable.strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"duplicate" = "Duplicate"; | ||
"singular_before_plural" = "Singular before Plural"; |
21 changes: 21 additions & 0 deletions
21
test/fixtures/exports_reference_duplicates/en.lproj/Localizable.stringsdict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist> | ||
<dict> | ||
<key>plural_before_singular</key> | ||
<dict> | ||
<key>NSStringLocalizedFormatKey</key> | ||
<string>%#@key@</string> | ||
<key>key</key> | ||
<dict> | ||
<key>NSStringFormatSpecTypeKey</key> | ||
<string>NSStringPluralRuleType</string> | ||
<key>NSStringFormatValueTypeKey</key> | ||
<string>d</string> | ||
<key>one</key> | ||
<string>Plural before Singular</string> | ||
<key>other</key> | ||
<string>Plural before Singular</string> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
2 changes: 2 additions & 0 deletions
2
test/fixtures/exports_reference_duplicates/fr.lproj/Localizable.strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"duplicate" = "Duplicate"; | ||
"singular_before_plural" = "Singular before Plural"; |
21 changes: 21 additions & 0 deletions
21
test/fixtures/exports_reference_duplicates/fr.lproj/Localizable.stringsdict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist> | ||
<dict> | ||
<key>plural_before_singular</key> | ||
<dict> | ||
<key>NSStringLocalizedFormatKey</key> | ||
<string>%#@key@</string> | ||
<key>key</key> | ||
<dict> | ||
<key>NSStringFormatSpecTypeKey</key> | ||
<string>NSStringPluralRuleType</string> | ||
<key>NSStringFormatValueTypeKey</key> | ||
<string>d</string> | ||
<key>one</key> | ||
<string>Plural before Singular</string> | ||
<key>other</key> | ||
<string>Plural before Singular</string> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
,key,fr,comment fr,en,comment en | ||
#Generic actions,,,,, | ||
,duplicate,Duplicate,,Duplicate, | ||
,duplicate,Erreur,,Error, | ||
#Plurals,,,,, | ||
,plural_before_singular##{one},Plural before Singular,,Plural before Singular, | ||
,plural_before_singular##{one},Plural before Singular,,Plural before Singular, | ||
,plural_before_singular##{other},Plural before Singular,,Plural before Singular, | ||
,plural_before_singular,Erreur,,Error,, | ||
,singular_before_plural,Singular before Plural,,Singular before Plural,, | ||
,singular_before_plural##{one},Erreur,,Error,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters