FlineDev / BartyCrouch

Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feat] Extract localizable Strings from SwiftUI Text

guidev opened this issue · 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 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