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

String annotations ignored #78

Open
Rares23 opened this issue Mar 7, 2025 · 2 comments
Open

String annotations ignored #78

Rares23 opened this issue Mar 7, 2025 · 2 comments

Comments

@Rares23
Copy link

Rares23 commented Mar 7, 2025

Hello there! I want to mention an issue that I encounter when using strings with annotations in compose, for example:
<string name="string_name">Hello <annotation clickable="learnMore" color="primary" style="body">World</annotation></string>.

The phrase setup is done properly, and the theme is wrapped in Phrase composable.

MainClass:

Phrase.setup(
            this,
            BuildConfig.PHRASE_DISTRIBUTION_ID,
            BuildConfig.PHRASE_ENV_TOKEN,
            getPreferredLang(this).code
        )
        Phrase.updateTranslations()

the issue is here
val spannableString = context.getText(stringRes) as? SpannedString

If I disable Phrase this works fine. When enabled, this returns null.

@Rares23
Copy link
Author

Rares23 commented Mar 7, 2025

I'm using the latest phrase version: com.phrase.android:ota-sdk-compose - 3.10.2

@theSoenke
Copy link
Contributor

Hi @Rares23, thanks for reporting this. That does not seem right when it behaves different when the SDK is enabled and looking into this. I'll keep you updated here

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