Skip to content

Output is broken if you have a NSLocalizedString with an empty string. #11

@Olof-IL

Description

@Olof-IL

Description:
It seems Localized.strings must never contain a row like this:

"" = "";

If it does, the localization tables will mess up, and the application will complain it does not find strings in Foundation framework.

App warning looks like this:
Localizable string "(A Document Being Saved By %@)" not found in strings table "Document" of bundle CFBundle 0x12e508f60 </System/Library/Frameworks/Foundation.framework>
(need to have -NSShowNonLocalizedStrings YES as startup argument to enable the warning)

The original genstrings tool will not include empty strings, but output a warning.
DTLocalizableStringScanner unfortunately does include the empty string, and thus, the output is broken.

Proposed fix:
Make sure empty strings are never included in the output.

This can be done by adding:
if([key compare:@""""] == NSOrderedSame) {
continue;
}

in the for-loop in [DTLocalizableStringTable stringRepresentationWithEncoding], but there are probably better ways to do it :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions