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

Need an interface to feed in a localized string to title/subtitle #90

Open
koromiko opened this issue Mar 7, 2024 · 0 comments
Open

Comments

@koromiko
Copy link

koromiko commented Mar 7, 2024

Is your feature request related to a problem? Please describe.

At this moment, the title/subtitle of an AlertToast is a String, and it will be wrapped with a LocalizedString to get a translation.

This causes an issue where we need to parameterize the translation (e.g, (10) drinks, (4) people)) but the string will be wrapped by a LocalizedString again and treated as a localization key.

Describe the solution you'd like

It would be nice to have two interfaces with different types of input parameters. One is the plain string that is supposed to be translated. To support existing usage, add another parameter that is typed LocalizedKey.

Describe alternatives you've considered

Support parameterized localization under the hood, such as providing args for injecting numbers to the localized string.

But I don't think this is a good encapsulation.

Additional context

Hope the description is clear. Thank you!

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

1 participant