Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Z-figaro opened this issue Apr 22, 2019 · 3 comments
Open

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

Z-figaro opened this issue Apr 22, 2019 · 3 comments

Comments

@Z-figaro
Copy link

Z-figaro commented Apr 22, 2019

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

@jasperblues
Copy link
Member

jasperblues commented Apr 22, 2019

Did you try something like this?

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

[group addSourceFile:header];
[project save];

@Z-figaro
Copy link
Author

Z-figaro commented Apr 23, 2019

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?

@Z-figaro
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants