BartyCrouch icon indicating copy to clipboard operation
BartyCrouch copied to clipboard

[Feat] Extract localizable Strings from SwiftUI Text

Open guidev opened this issue 2 years ago • 1 comments

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

guidev avatar Feb 15 '23 14:02 guidev

@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: https://github.com/FlineDev/BartyCrouch/issues/194

Jeehut avatar Feb 15 '23 14:02 Jeehut