Closed byrnedo closed 7 years ago
Hi,
When you use that plugin you can just set the attributes and it would work as expected? Like in the following example:
<label> <strong>{{t "settings.location-address.company-name"}}</strong> {{place-autocomplete-field value=businessName handlerController=this types="establishment" setValueWithProperty="name" placeholder=(t "settings.location-address.company-name-placeholder") placeChangedCallback="placeChanged"}} </label>
Hi, thanks for the reply, I meant more the language that will be used in the calls to the google api. It's a bit tricky since it's in the url for the script. I got around it by having a service fetch the script for a language and notify when it was downloaded.
Hey @byrnedo,
Thanks for taking the time to report this, and sorry for the late response. But @yratanov did it some time ago: https://github.com/dmuneras/ember-place-autocomplete/commit/a01bc9ac12adb79ec08c3fb5152b0c8f780f5d8e
You just have to pass the options in the environment configuration: config/environment
and the region and language are going to be added to the script tag to request google places autocomplete.
let ENV = {
modulePrefix: 'dummy',
environment,
rootURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
},
'place-autocomplete' : {
language: 'en',
region: 'GB'
}
APP: {
// Here you can pass flags/options to your application instance
// when it is created
}
};
Best regards, Daniel.
@byrnedo I am going to close this question but feel free to reopen if needed.
I'm using i18n and would like to get the language changed here when it is changed in i18n (https://github.com/jamesarosen/ember-i18n).
You think that's possible?