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. |
|
Hey @swakwork, just a quick ping since this PR has been hanging around for a few months. Could you take a look and let me know if the code looks good to you? |
|
idk, for now I'm planning not to touch anything related to Twitter. Moreover, strings now come from Crowdln, so we might need to update there as well. So far now I'm not gonna pause it. |
Makes total sense, especially with the recent changes making things so unpredictable. Just a quick note regarding Crowdin, though: as far as I know, any string modifications pushed here should automatically sync with Crowdin via the GitHub workflow, so it shouldn't require any manual updating on our end. |
|
One thing to be aware of when merging this pull request is that after it is merged, the strings will be incomplete in that language until the translation is updated. Therefore, I propose the following merge strategy:
This gives translators time to update their strings before Swak releases v3.4.0-dev.1. Furthermore, because stable versions are released less frequently, there is ample time before the next stable version (v3.4.0) is released. This reduces the likelihood of stable users encountering incomplete strings. |
That's a very good strategy ^^ |






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.