CopyPastor

Detecting plagiarism made easy.

Score: 0.8059185147285461; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2025-08-25
by Redek

Original Post

Original - Posted on 2025-08-25
by Redek



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Here's a 2025 solution to this very common problem.
Check out this lib, [TextResource](https://github.com/dkmarkell/textresource). You can build your strings in the viewmodel (without holding a context) and resolve them in the UI, which will preserve localization
Example
``` // ViewModel val title = TextResource.simple(R.string.greeting, userName) // expose via Flow or LiveData
// Compose Text(title.resolveString())
// Views textView.text = title.resolveString(context) ```
Check out this lib, [TextResource](https://github.com/dkmarkell/textresource). You can build your strings in the viewmodel (without holding a context) and resolve them in the UI, which will preserve localization
Example
``` // ViewModel val title = TextResource.simple(R.string.greeting, userName) // expose via Flow or LiveData
// Compose Text(title.resolveString())
// Views textView.text = title.resolveString(context) ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;