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 resources #1073

Open
Taz03 opened this issue Mar 23, 2024 · 2 comments
Open

String resources #1073

Taz03 opened this issue Mar 23, 2024 · 2 comments
Labels
discussion enhancement New feature or request

Comments

@Taz03
Copy link
Member

Taz03 commented Mar 23, 2024

Issue

We have a lot of strings embedded into the code which is hard to manage. And it will only get worse with time.

To update a string we have to know which class to look into and find the exact line the string is created in. This is a hard task, especially for a non-programmer person.

Solution

Make an android-like R.java class that will read the strings/string templates from the XML resource file and use it in the code. Also, add a guide on how to find and update text in the wiki.

@Taz03 Taz03 added enhancement New feature or request discussion labels Mar 23, 2024
@christolis
Copy link
Member

Do we really need this though? It will definitely help non-programmers with changing string values across the code without delving into it but I don't know if it's going to be a good investment. I thought that usually mostly people do this for i18n purposes but I'd love to hear other's opinions about this as well. :)

@SimonVerhoeven
Copy link
Contributor

I think there's something to be said for both sides. A lot of inline text can be more challenging to support, on the other hand the filename does also serve as a certain reassurance that they're in the right spot.

Out of curiousity, why an XML file, and not just https://docs.oracle.com/en%2Fjava%2Fjavase%2F22%2Fdocs%2Fapi%2F%2F/java.base/java/util/ResourceBundle.html + a properties file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants