refactor: replace dynamic string composition with explicit string resources#845
refactor: replace dynamic string composition with explicit string resources#845krvstek wants to merge 1 commit intocrimera:devfrom
Conversation
67dbc9d to
8dae7d0
Compare
|
Have you checked "Delete entries from database" screen? |
I didn't touch the database string or the array itself, so it shouldn't be affected. I actually can't build and check it locally on my end right now though, could you verify if it looks fine on your side? |
I completely agree. After reconsidering, I realized that since there are only nine strings, it wouldn't be a burden to make it dedicated strings. I also realized that dynamically compositing these strings results in a grammatical problem. So as you said, it's better to add a dedicated string for the "delete entries from database" items. |
|
In arrays.xml, with the addition of Also, is it possible to include fixes of some typo in string key in this pull request?
This originates from an old typo. Since changing string keys later can be a bit cumbersome, I think it's best to do it in conjunction with this major refactoring. |
Done. @crimera @swakwork Two quick questions while I'm at it:
|
|
My new commit was merged today, but it relies on an old dynamic string. Please change this to
SettingsAboutFragment.java is not from Re*anced, it's genuinely from piko settings screen. - if ( (key.equals(strRes("piko_pref_app_version"))) || (key.equals(strRes("piko_title_piko_patches"))) || (key.equals(strRes("piko_title_piko_integrations"))) ) {
+ if ( (key.equals(strRes("piko_pref_app_version"))) || (key.equals(strRes("piko_title_piko_patches"))) ) {This fix is fine.
I'm not a maintainer, but I think so too. Also, since repeatedly using "StringRef" will increase the number of characters, it would be better to static import |
No worries at all. If there's anything else I missed, just let me know.
I meant specifically the term
Good idea, but let's not clutter this PR. I'll open a separate one if a maintainer gives the green light. |






This PR refactors
SettingsAboutFragmentby replacing thestrEnableResandstrRemoveResmethods with directstrRescalls.Previously, the code dynamically composed strings (e.g., adding
Enable...orRemove...prefixes to feature names). This approach caused significant localization issues due to varying grammar rules, genders, and word orders across different languages. By using explicit string resources, the translation process becomes much easier and the UI will look cleaner across all supported languages.