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

enter_message_hint is never used #268

Closed
ghost opened this issue Apr 20, 2022 · 4 comments · Fixed by #269
Closed

enter_message_hint is never used #268

ghost opened this issue Apr 20, 2022 · 4 comments · Fixed by #269
Assignees

Comments

@ghost
Copy link

ghost commented Apr 20, 2022

Hello,

I am integrating the Kommunicate Flutter SDK and I'm currently having a problem with the localization on the Android side. I'm successfully translating most of the resources to French and it seems to me that we are not able to use a customized string for the hint "Write a Message.." used at the bottom of this screen.

Screenshot_20220420-111822

The string resource that seems to mean to be edited is enter_message_hint in mobicom_strings.xml but it is never used.

I think that this part of the code is the problem :

messageEditText.setHint(!TextUtils.isEmpty(alCustomizationSettings.getEditTextHintText()) ? alCustomizationSettings.getEditTextHintText() : getString(R.string.enter_message_hint));

as alCustomizationSettings.getEditTextHintText() is never Empty and contains "Write a Message.."

@amntoppo
Copy link
Contributor

amntoppo commented Apr 25, 2022

Hello,
Please follow these steps to change the editText Hint text in Android:
https://docs.kommunicate.io/docs/flutter-customization#android

In applozic-settings.json, there exists a "editTextHintText". Change it's value to your desired language and you should be able to do it.
This will override the default value of alCustomizationSettings.getEditTextHintText()

@Sathyan-Elangovan
Copy link
Contributor

Hi @remisan Can you confirm whether the given solution is worked or not?

@ghost
Copy link
Author

ghost commented Apr 29, 2022

Hi, I just tested using the file @amntoppo mentioned and it worked, I put an empty string for editTextHintText in applozic-settings.json so that

TextUtils.isEmpty(alCustomizationSettings.getEditTextHintText())

was true and it uses

getString(R.string.enter_message_hint)

I couldn't just "change the value to your desired language" in applozic-settings.json as you recommended because it would just use one value, but I need it to change depending on the device language.
I feel like it's kind of a "hack", I don't know if it was intended to be used that way but still, it works. Thanks :)

@amntoppo amntoppo linked a pull request May 2, 2022 that will close this issue
@amntoppo
Copy link
Contributor

amntoppo commented May 2, 2022

Thanks for pointing out the issue, @remisan
We have added a fix for this. Now you will be able to set the hint text from both applozic-settings.json and localizable strings, whichever fits your requirement.

@amntoppo amntoppo self-assigned this May 2, 2022
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 a pull request may close this issue.

2 participants