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

[BUG] String resources are not namespaced #6395

Closed
mcungl opened this issue Mar 20, 2023 · 4 comments · Fixed by #6608
Closed

[BUG] String resources are not namespaced #6395

mcungl opened this issue Mar 20, 2023 · 4 comments · Fixed by #6608
Assignees
Labels

Comments

@mcungl
Copy link

mcungl commented Mar 20, 2023

Summary

Resources are not namespaced to avoid colliding with custom resources.

We noticed this when our app's R.string.done was overridden and translated. We only support english, but because the same resource is declared and translated in the Stripe SDK, it also translates this string in our buttons. Despite us not having any translations.

To fix this, I'd recommend adding a stripe prefix to all string resources.

Code to reproduce

Create an app with text resource <string name="done">Done</string>
Create a TextView with android:text="@string/done"
Import the Stripe SDK.
Change system language to german (or any other language supported by Stripe).
TextView text will will be overridden and translated by the Stripe SDK.

Android version

All supported versions

Impacted devices

All devices

Installation method

Gradle

Dependency Versions

20.19.2

Other information

Similar issue: #1656

@mcungl mcungl added the bug label Mar 20, 2023
@tillh-stripe tillh-stripe self-assigned this Mar 20, 2023
@tillh-stripe
Copy link
Collaborator

Hi @mcungl 👋 Thanks for sending this in. I’ll have a look at how we can fix this.

@mauv0809
Copy link

mauv0809 commented Apr 18, 2023

Hi.
I am using: version 20.23.1 and that is also affected by this.
Is there any timeline for this issue to be fixed?

@tillh-stripe
Copy link
Collaborator

I’ll be working on the issue this week, but I don’t have a timeline yet for when we’ll have a fix ready. Will keep you updated here though.

@tillh-stripe
Copy link
Collaborator

I just merged a change where we now prefix our strings with stripe_. In a follow-up, I’ll add the same for other resources and add enforcement to avoid any regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants