-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersmulti-assigneesCan be assigned to multiple contributers at the same time.Can be assigned to multiple contributers at the same time.
Description
Description
Currently, some of the app's UI strings are hardcoded directly into Kotlin (.kt) files. To enhance the app's localization capabilities and make it easier to manage translations, we need to migrate all hardcoded strings into the strings.xml file. This will allow us to support multiple languages without changing the codebase and improve the maintainability of the application.
Tasks:
- Identify all hardcoded strings in the Kotlin files (
.kt). - Move those strings to the
strings.xmlresource file under the appropriate<string>tags. - Replace the hardcoded strings in the Kotlin files with references to the corresponding string resources.
- Ensure that the application works correctly after the migration and all strings are properly localized.
Example
This is in Mess.kt line : 217 - 226
Before:
// Hardcoded string in Kotlin file
if (!yearSelected) {
toast("Please Select a year")
} else if (!genderSelected) {
toast("Please Select gender")
} else if (!batchSelected) {
toast("Please Select a batch")
} else {
onResult(target)
dialog.dismiss()
}
After:
- Add strings to
res/values/strings.xml:
<resources>
<string name="select_year">Please Select a year</string>
<string name="select_gender">Please Select gender</string>
<string name="select_batch">Please Select a batch</string>
</resources>- Modify Kotlin code to reference the string resources:
// Using string resource from strings.xml
if (!yearSelected) {
toast(getString(R.string.select_year))
} else if (!genderSelected) {
toast(getString(R.string.select_gender)
} else if (!batchSelected) {
toast(getString(R.string.select_batch)
} else {
onResult(target)
dialog.dismiss()
}Expected Outcome
- All hardcoded strings in
.ktfiles are moved tostrings.xml. - The app continues to work seamlessly with localized strings.
- The code is cleaner and easier to maintain.
Create single PR per file.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersmulti-assigneesCan be assigned to multiple contributers at the same time.Can be assigned to multiple contributers at the same time.