Skip to content

how to add some .strings files to project? #92

Open

Description

@Z-figaro

i create fiolder and files ,but i can't add it to my project.can u give some demo ?

Activity

  1. jasperblues commented on Apr 22, 2019

    @jasperblues
    Member

    Did you try something like this?

    XCSourceFileDefinition* header = [[XCSourceFileDefinition alloc]
        initWithName:@"SomeHeader.h" text:<your header text> LocalizableStrings];
    
    [group addSourceFile:header];
    [project save];
    
  2. Z-figaro commented on Apr 23, 2019

    @Z-figaro
    Author

    Did you try something like this?

    XCSourceFileDefinition* header = [[XCSourceFileDefinition alloc]
        initWithName:@"SomeHeader.h" text:<your header text> LocalizableStrings];
    
    [group addSourceFile:header];
    [project save];
    

    The Localizable.strings files is speacial.when u add some more other language.like this:
    屏幕快照 2019-04-23 上午9 15 24

    IN xcode:
    屏幕快照 2019-04-23 上午9 16 11
    when i add some more languages to project,i found the location is en.lproj/Localizable.strings.
    All language's parent group is common group。 not en.lproj folder.

    How can i add the more languages?

  3. Z-figaro commented on Apr 23, 2019

    @Z-figaro
    Author
    • (void)makeGroupMemberWithName:(NSString *)name contents:(id)contents type:(XcodeSourceFileType)type
      fileOperationStyle:(XCFileOperationType)fileOperationStyle;
      can i use this method to create a file for localizated.strings?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions