refactor: replace dynamic string composition with explicit string resources#845
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. |
Hey @swakwork, I see Twitter is getting some updates again in recent releases. Since this is active, could we look into merging this refactor soon? I want to get it synced before the new changes create major conflicts. Let me know if anything specific needs to be adapted on my end regarding the Crowdin migration you mentioned earlier. |
Will plan to include on the next Twitter release.
I'm don't know much about Crowdin. Do we need to include the new base keys to the project or will the translators themselves be adding them. |
From what I can see, this repo uses the exact same script as Morphe (Crowdin push/pull). So if there's a change in the strings, the push workflow replaces the source files, and the strings update automatically. Someone correct me if I'm wrong. |
Then, could you merge this right now? So the new strings will be reflected in Crowdin automatically, and we can get started on the translation. Also, it would be helpful if you could make a brief announcement in the Telegram group Updates section.
|
Well, by Twitter release I meant Piko update
I dont mind merging it, now but the thing is I'm occupied, so I may not be able to support or do emergency release if needed. Anyways let me merge it, I personally have not tested it, so if something goes wrong.... may god be with us 😌🙏 |
Thanks! No need to worry, this PR only changes strings and I've already personally tested it, so nothing should break. |
Big thanks for the PR and so sorry for the delay |
## [3.5.0-dev.2](v3.5.0-dev.1...v3.5.0-dev.2) (2026-05-27) ### 🔧 Improvements * **Twitter:** replace dynamic string composition with explicit string resources ([#845](#845)) ([49a7c01](49a7c01))
|
Oh wait, did you run release workflow seriously? |
|
Well, what's done is done
Anyway, I'm sorry for involving you in this troublesome matter when your time is occupied 😥 |






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.