lixiang1994 / AttributedString

基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
MIT License
846 stars 76 forks source link

多语言怎么支持呢 #38

Closed burning-git closed 2 years ago

burning-git commented 2 years ago

目前本文有点击事件,因为内容是拼接的,导致多语言识别起来困难。

lixiang1994 commented 2 years ago

具体场景是?

lixiang1994 commented 2 years ago

我理解是可以给不同的点击事件闭包 并不需要区分具体文本

burning-git commented 2 years ago

已经决绝了。拼接 NSMutableAttributedString

例如 : 文本: 请您务必认真阅读《用户协议》和《隐私政策》中的各项条款.

` let user_protocol = ASAttributedString("《用户协议》", .action({[weak self] in self?.userProtocolClicked() }), .foreground(.textThemeColor), .font(.pingFang(14, fontWeight: .Regular))).value

    let privacy_protocol = ASAttributedString("《隐私政策》", .action({[weak self] in
        self?.privacyPolicyClicked()
    }), .foreground(.textThemeColor), .font(.pingFang(14, fontWeight: .Regular))).value

` 请您务必认真阅读(user_protocol)和(privacy_protocol)中的各项条款 “请您务必认真阅读(user_protocol)和(privacy_protocol)中的各项条款” 这块需要多语言支持