Zendesk Android SDK localization issue - android

I have a problem with localizing Zendesk to french. You can see in the below screenshot the word Contacteznous which is not the correct one.
This is not the only word that is incorrect, there are some english words which are not translated at all.
I think that based on the language, the appropriate words should be taken from values-fr file in Zendesk library package. The correct word sits there but is not used as you can see from the screenshot.
The code I use for setting up Zendesk is:
public void initZenDesk() {
ZendeskConfig.INSTANCE.setDeviceLocale(Locale.FRANCE);
ZendeskConfig.INSTANCE.init(getActivity(), Constant.ZenDesk_Support_Site, Constant.ZenDesk_ApplicationId, Constant.ZenDesk_Auth_CLientId,
new ZendeskCallback<String>() {
#Override
public void onSuccess(String s) {
Identity identity = new AnonymousIdentity.Builder()
.withNameIdentifier(globals.getUserDetails().get(Constant.MM_UserName))
.withEmailIdentifier(globals.getUserDetails().get(Constant.MM_Email))
.withExternalIdentifier(globals.getUserDetails().get(Constant.MM_UserId))
.build();
ZendeskConfig.INSTANCE.setIdentity(identity);
ZendeskConfig.INSTANCE.setContactConfiguration(new BaseZendeskFeedbackConfiguration() {
#Override
public String getRequestSubject() {
return "Support request";
}
});
new SupportActivity.Builder().show(getActivity());
}
#Override
public void onError(ErrorResponse errorResponse) {
Toast.makeText(getActivity(), errorResponse.getReason() + errorResponse.getResponseBody(), Toast.LENGTH_SHORT).show();
}
});
}
I cannot understand what I am doing wrong, I followed the steps from the official Zendesk webpage. Everything is properly set in the admin back office as well. What am I missing guys?

The missing hyphen is a subtle bug in our translation file, thanks for pointing it out! It will be fixed in our next release.
The hyphen you see in the strings.xml file is a soft hyphen, U+00AD (see https://en.wikipedia.org/wiki/Soft_hyphen), instead of a regular hyphen, U+2010. As such, it is not displaying in this case, because the text is not being broken over multiple lines.
As a workaround in the meantime, you can override the contact_fragment_title in your app, making sure to use a real hyphen character (or a space, or whatever you prefer).

I think you have a ticket open with us at the moment. We'll be looking at the issue tomorrow and we'll get back to you on that channel. We can post the result back here too.
Thanks,
Barry.

Related

Google map black lines

I noticed that Google Maps has added some black lines to the view on Google Maps. I'd like to know what they are supposed to indicate and how to turn off these black lines. see below image for reference how can I remove these black lines.
They are the MRT lines of Singapore. Apparently they appeared in other cities as well but in the right colors, I guess the MRT lines will get colored as well at some point.
Edit: They used to be colored, I just never noticed them. Seems to be a bug.
seems like a bug to me, because these lines were in colors for years before yesterday, and it is not caused by whatever Bicycling layer either, because all of my friends encounter the same started at the same time.
It's funny that non of the users who replied this thread are living in Singapore, but still trying to answer this query, apparently those replies before mine are not true.
There are reports sent to Google Singapore for further investigation, so no worries, these MRT lines will be back to be colored accordingly in the near future.
I see this in Singapore zone in google maps app, but if you want to remove it, use custom styles for your app like:
#Override
public void onMapReady(GoogleMap googleMap) {
try {
boolean success = mMap.setMapStyle(
MapStyleOptions.loadRawResourceStyle(this, R.raw.mystyles));
if (!success) {
Log.e("TAG", "Style parsing failed.");
}
} catch (Resources.NotFoundException e) {
Log.e("TAG", "Can't find style. Error: ", e);
}
}

play-games-plugin-for-unity - show specific Leaderboard

I'm trying to integrate the google play Leaderboard with help of the play-games-plugin-for-unity plugin into my game.
It works fine, committing to Leaderboard an all, only one thing is not working. When I call the Leaderboard
//LEADERBOARD
if (GUI.Button(leaderboardButton, "Leaderboard"))
{
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(Constants.LEADERBOARDID);
// Social.ShowLeaderboardUI();
}
it opens the window where I see all leaderboards. But I'm giving a specific id. This would be the behaviour I expect from the line Social.ShowLeaderboardUI(); which is commented out. The overload with a given Id (hid behind Constants.LEADERBOARDID) should start the specific Leaderboard UI according to the doc. Someone knows if this is an issue (haven't seen any report on GitHub) and how to solve it? It isn't that that big of an issue, but one click is better than two.
I tried something interesting. I changed the Id to some wrong value. Still the same behavior (opening the window with all leaderboards). Of course committing the score doesn't work anymore.
Okay, i found the error in the sourcecode of the Plugin, fixed it and resolved the problem. So here I present the fix if someone needs it. It's in the LeaderboardManager class.
This is how ShowUI is called:
internal void ShowUI(string leaderboardId, Action callback) {
Misc.CheckNotNull(callback);
C.LeaderboardManager_ShowAllUI(mServices.AsHandle(), Callbacks.InternalShowUICallback,
Callbacks.ToIntPtr(callback));
}
This should be the correct version
internal void ShowUI(string leaderboardId, Action callback) {
Misc.CheckNotNull(callback);
C.LeaderboardManager_ShowUI(mServices.AsHandle(),leaderboardId, Callbacks.InternalShowUICallback,
Callbacks.ToIntPtr(callback));
}
}
See the difference? C.LeaderboardManager_ShowAllUI instead of C.LeaderboardManager_ShowUI is called.

Android java.lang.NoSuchFieldError

In some case, when accessing an activity field from an anonymous class, I get NoSuchFieldError at runtime: java.lang.NoSuchFieldError: MyActivity.myField
EDIT: I'm now sure that it's an Android issue, because everything compiles correctly but resolved incorrectly at runtime. When changing to MyActivity.this.myField instead of plain myField, everything works perfect.
BTW, I rechecked and I don't have any other myField anywhere else, Also, when opening declaration in Eclipse, it goes to the intended field (myField).
The only problem is that I couldn't reproduce this in a sample project. I'm left only to state that it's a specific problem in my project, but I'm reluctant doing so and I can't publish this project.
I'll keep this open in case someone stumbles upon something similar.
Here's the code that I can publish that crashes my project but not the sample one:
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new Runnable() {
#Override
public void run() {
Toast.makeText(MyActivity.this, myField.getName(), Toast.LENGTH_SHORT).show();
}
}.run();
}
It seems that accessing the field with the class' prefix solves it: MyActivity.this.myField
Strange. I guess it's something with Android's field resolution in runtime.

Spaces being converted to %20 in Android output

We have this Android code that is sending text to a collector:
public void sendHello() {
s.link = "None";
s.track("App Home Page - Hello all");
}
The output, though, contains %20 instead of spaces so we are ending up with something like this:
App%20Home%20Page%20-%20Helloall
Does anyone know how to prevent the spaces being converted or what is causing it?
As others have said, it'd be nice to know the type of s. But, as a shot in the dark, you could use URLDecoder's decode method.

Selecting text on TextView (android 2.2)

How to implement selecting text capability on Android 2.2? I searched Google but can't find a solution.
This is the only way I've found (from google) to support it for android 1.6+, it works but it's not ideal, I think in stock android you can't hold down a webview to highlight until v2.3, but I may be mistaken..
By the way this is for a webview, it might also work on textview, but I haven't tried it
(Note: this is currently what my shipped app is using, so it works with all the phones I've had it tested on, but the only reason I found this question was because I was searching and hoping that someone had come up with a better way by now)
I've just got a menu item called "Select text" which calls the function "selectnCopy()"
#Override
public boolean onOptionsItemSelected(MenuItem item) {
//..
switch (item.getItemId()) {
case R.id.menu_select:
selectnCopy();
return true;
//..
}
}
Which looks like this:
public void selectnCopy() {
Toast.makeText(WebClass.this,getString(R.string.select_help),Toast.LENGTH_SHORT).show();
try {
KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
shiftPressEvent.dispatch(wv);
} catch (Exception e) {
throw new AssertionError(e);
}
}
Notice I've put the select_help string there as a toast, that's just because it's not immediately clear to the user how it's supposed to work
<string name="select_help">Touch and drag to copy text.</string>
The Link #Stefan Hållén provided only worked after API Level 11.
And Android 2.2 is API Lv.8, that's the reason why you cannot get a resource identifier.
Have you set the text to be selectable? like this:
android:textIsSelectable="false" //OR true
See the Documentation for further reference.
After a long and time consuming search, I can't find a component that can select text in textview for android API level <=11. I have written this component that may be of help to you :
new Selectable TextView in android 3 (API <=11) component
An interesting workaround:
You could try displaying your text in a webview.
You just have to write the HTML tags and all of that into your string to display, and it should be selectable using the WebKit browser.
This should be fairly lightweight and transparent to the user, and I think it would solve your problem.
Let me know if you need a code example, it should be fairly simple. Just check out the WebView docs on http://developer.android.com/resources/tutorials/views/hello-webview.html
Best of luck!

Categories

Resources