Skip to content

Added ability to ignore empty strings#107

Merged
Jeehut merged 4 commits intoFlineDev:stablefrom
ludvigeriksson:ignore-empty-strings
Sep 24, 2018
Merged

Added ability to ignore empty strings#107
Jeehut merged 4 commits intoFlineDev:stablefrom
ludvigeriksson:ignore-empty-strings

Conversation

@ludvigeriksson
Copy link
Copy Markdown
Contributor

This is the same as #73, but I've added tests this time.

for newTranslation in newTranslations {
// skip keys marked for ignore
guard !newTranslation.value.containsAny(of: ignores) else { continue }
if ignoreEmptyStrings && newTranslation.value.trimmingCharacters(in: .whitespaces).isEmpty { continue }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use isBlank instead of trimmingCharacters(in: .whitespaces).isEmpty. It's implemented here. Technically it's not the same, since it also removes newlines, not sure if that's works for you as well. But if it does, I'd prefer that.

@Jeehut
Copy link
Copy Markdown
Member

Jeehut commented Sep 17, 2018

Looks good overall, just added a small comment. Once that's answered it's good to merge.

@Jeehut Jeehut merged commit bf9728a into FlineDev:stable Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants