Algolia autocomplete - how to display autocomplete suggestions in English? - autocomplete

Is it possible to have Algolia's autocomplete suggestions display ONLY in English? At the moment the city, country displays in English, however, suburbs and municipalities etc (administrative) displays in native language of each country. It is really annoying.

You should call configure on your places instance once it's created:
const placesInstance = places({
appId: 'YOUR_PLACES_APP_ID',
apiKey: 'YOUR_PLACES_API_KEY',
container: document.querySelector('#demo'),
});
placesInstance.configure({
language: 'en'
});
The docs for the language option indeed mention that by default, the browser's language will be used.

Related

I want to add Share to Slack feature in my web app. Facing issue in showing the popup to select the receipients

I am adding share to slack functionality in my web app.
But I cannot find any solution by which I can show my app users to select a user/channel or team in slack to share the content with.
I have added Sharing on Teams also. In that I am able to select the users or search the particular user. Please refer the below link to see how it is looking in teams.
https://learn.microsoft.com/de-de/power-bi/collaborate-share/media/service-share-report-teams/service-teams-share-to-teams-dialog.png
I want to know, is there any way by which we can implement the sharing to particular user or channel etc on slack same as it is there in teams.
Thanks.
Once the Web app shares content, it's very much up to the receiving app to decide what it makes of the incoming data.
try {
await navigator.share({
title: 'Title',
text: 'Text',
url: 'https://example.com/',
});
console.log('Successful share'))
} catch (err) {
console.log('Error sharing', err));
}
Possible values are:
url: A string representing a URL to be shared.
text: A string representing text to be shared.
title: A string representing a title to be shared. May be ignored by the target.
See the bold part. Try populating text and title differently and see if it makes any difference.

How to launch the ViewContent facebook event in React Native?

I'm trying to trigger the ViewContent event (https://developers.facebook.com/docs/facebook-pixel/reference#events) using the version 0.10.1 of react-native-fbsdk. This should be registered in the panel you see in the image, but it still appears in red.
The only function the SDK gives me to launch events is the logEvent function. So I'm doing it this way:
const viewContentData = {
content_name: name,
content_category: type,
content_ids: id,
content_type: type,
value: amount,
currency,
};
yield call([AppEventsLogger, 'logEvent'], 'ViewContent', viewContentData);
Does anyone know how to make it work?
Thank you so much :)
Do you try to use it on Web or Mobile? I believe for react native you have to use mobile events SDK integration:
https://developers.facebook.com/docs/react-native/app-events
If you want to use it on the Web, all you have to do is initializing the pixel base code properly and then firing the event via fbq helper function:
https://developers.facebook.com/docs/facebook-pixel/advanced/

Is there any method to share text from mobile web to wechat by sharing button?

I am looking for wechat sharing function like how whatsapp does.
href="whatsapp://send?text=http://www.example.com"
Based on my research, most of them will be encoded in QR code and scan the QR code with wechat scanner. Is there a way to share the text directly to friend when click on sharing button just like how whatsapp does?
Wechat doesn't have any official deep linking URL for sending a text. However, if you can add some JavaScript Code in your mobile web, you can achieve the share functionality.
Check out Send to chat documentation on Wechat JS SDK.
From JS SDK Documentation:-
wx.onMenuShareAppMessage({
title: '', // Sharing title
desc: '', // Sharing description
link: '', // Sharing link
imgUrl: '', // Sharing image URL
type: '', // Sharing type, such as “music”, “video “ or “link”. It is “link” by default.
dataUrl: '', // The data URL should be provided for items of type “music” or “video”. It is null by default.
success: function () {
// Callback function executed after a user confirms sharing
},
cancel: function () {
// Callback function executed after a user cancels sharing
}
});
We do have some unofficial deep linking URL like you mentioned. But it may stop work anytime if Wechat decided to change it.
Here is some of them below, sadly I don't know any URL to share a text to chat.
weixin:// - to open Wechat app (if installed)
weixin://dl/chat - to open chat screen of Wechat
weixin://dl/moments - to open user moements
weixin://dl/profile - to open user profile
weixin://dl/settings - to open settings page

understanding autocomplete

What does this mean in jquery autocomplete? :
$( "#tags" ).autocomplete({
source: availableTags
});
I understand that the autocomplete choices show up in the tags div.
I am trying to apply a salesforce visualforce generated id to this script.
So in salesforce, the id is auto generated. So If I say the id = 'tags', in salesforce it becomes j0_jd1:j2_jd3:tags.
Has anyone overcome using autocomplete with visualforce ids?
Try this:
$('[id$=tags]').autocomplete({
source: availableTags
});

Set facebook application locale based on user's facebook language settings

So if i am French and browse facebook in French, is it possible for an application to change its locale or language settings based on that of the user? In other words, if i open the facebook app, i would like to see the app content in French. Similarly for any other language. How can this be done?
P.S. I am using the old REST api
Ok a couple of ways to do this:
1) Check for locale in facebook params when the app loads, in particular the "fb_sig_locale" parameter
2) Use fql on user table like so:
select locale from user where uid = '1100100101'
setup a before_filter like this (I'm assuming You're using I18n to store the current locale) :
if request_comes_from_facebook?
# e.g. "fb_sig_locale"=>"en_US" or "fb_sig_locale"=>"de_DE"
if fb_locale = params[:fb_sig_locale]
I18n.locale = fb_locale.sub('_', '-')
else
logger.info ":fb_sig_locale parameter not found in request"
end
end