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

mylife: smoother list translation (fixes #4401) #4426

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kuljeet1998
Copy link
Contributor

@Kuljeet1998 Kuljeet1998 commented Sep 17, 2024

Fixes: #4401

pending: dashboard -> myLife -> cards

image
image
image

@Kuljeet1998 Kuljeet1998 linked an issue Sep 17, 2024 that may be closed by this pull request
@Kuljeet1998 Kuljeet1998 marked this pull request as ready for review September 18, 2024 18:55
@Kuljeet1998
Copy link
Contributor Author

image
image

@Okuro3499 Okuro3499 changed the title myLife: translate tabs (fixes: #4401) myLife: translate tabs (fixes #4401) Sep 18, 2024
@dogi dogi changed the title myLife: translate tabs (fixes #4401) myLife: smoother translations (fixes #4401) Sep 18, 2024
@dogi dogi changed the title myLife: smoother translations (fixes #4401) mylife: smoother translations (fixes #4401) Sep 18, 2024
@dogi dogi changed the title mylife: smoother translations (fixes #4401) mylife: smoother list translation (fixes #4401) Sep 18, 2024
@AdhamElAsfar99
Copy link
Member

@Kuljeet1998 I don't know why but "Mylife" translation in the dashboard doesn't work when I login with my username; however, it works when I login with okuro's username as shown in the video below:

translation.webm

@Kuljeet1998
Copy link
Contributor Author

@Kuljeet1998 I don't know why but "Mylife" translation in the dashboard doesn't work when I login with my username; however, it works when I login with okuro's username as shown in the video below:

translation.webm

I believe its because the language when you login would have been set to arabic but the language when okuro's account was used must have been english at the start and then changed to arabic. This is an edge case which I discussed w @Okuro3499 and trying to come up w a solution.

Comment on lines +239 to +257
fun getStringIdentifier(name: String?): Int {
if (name == "mymessages" || name == "myachievements"){
val modifiedString = name.substring(2)
return context.resources.getIdentifier(modifiedString, "string", context.packageName)
}
else if (name == "mysurvey"){
return context.resources.getIdentifier("my_survey", "string", context.packageName)
}
else if (name == "mysubmissions"){
return context.resources.getIdentifier("submission", "string", context.packageName)
}
else if (name == "help wanted"){
return context.resources.getIdentifier("help_wanted", "string", context.packageName)
}
else {
return context.resources.getIdentifier(name, "string", context.packageName)
}

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mylife items are sourced from the database, and in this implementation, you're passing the title directly to this function for translation. However, this approach may not work if there's an item that isn't hardcoded into this function. We need a more dynamic solution to handle such cases

@deeppp15 deeppp15 self-requested a review September 19, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

translate pending myLife tab
4 participants