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

[Feat] Extract localizable Strings from SwiftUI Text #276

Open
guidev opened this issue Feb 15, 2023 · 1 comment
Open

[Feat] Extract localizable Strings from SwiftUI Text #276

guidev opened this issue Feb 15, 2023 · 1 comment

Comments

@guidev
Copy link

guidev commented Feb 15, 2023

Steps to Reproduce:

In SwiftUI Text() and Button() are automatically localisable.

For instance using

Text("Title"), automatically looks for localisations with the key "Title"

Unfortunately when running bartycrouch, if there's a "Title" entry in the localizable.strings it gets deleted.

Expected Behavior:

Bartycrouch should treat Text("Title") or Button("Title") the same ways it does with NSLocalizedString("Title")

Current Behavior:

Doesn't recognise that it's a localisable string.

Environment

Show environment details
@Jeehut
Copy link
Member

Jeehut commented Feb 15, 2023

@guidev Thank you for reporting this.

I am aware of this downside of BartyCrouch and actually, it's a downside of an Apple tool that ships with Xcode which BartyCrouch uses internally to extract Strings from Swift files. Also, I wouldn't call it a "bug" as BartyCrouch never intended to extract localization Strings for SwiftUI, where Apple changed things significantly.

I have no plans to write a manual parser to find all localizable Strings to BartyCrouch, in fact BartyCrouch is more of a community project now. So if someone provided support for this, I'd be happy to review. But my focus is on the successor of BartyCrouch now where the workflow is a bit different, but it fully supports SwiftUI: RemafoX

See also this thread where a similar discussion happened: #194

@Jeehut Jeehut changed the title [Bug] SwiftUI Text not working correctly [Feat] Extract localizable Strings from SwiftUI Text Feb 15, 2023
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