Skip to content

String annotations ignored #78

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

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

String annotations ignored #78

Rares23 opened this issue Mar 7, 2025 · 4 comments
Labels
accepted bug Something isn't working

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

@mbeelal
Copy link

mbeelal commented Apr 7, 2025

theSoenke any update on this? also could you please provide an ETA?

@forelabs
Copy link
Member

Hi @mbeelal, I am sorry for the delay. The android developers are currently looking into the issue, though sadly I can not give an ETA on this. I will sync with the team and check on their findings.

@forelabs forelabs added bug Something isn't working accepted labels Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants