https://google-developers.appspot.com/maps/documentation/javascript/examples/places-autocomplete
I have a similar page with above google places demo. Notice that the location input field has a hint of "Enter a location". How do i change the language of this hint?
And how do i change the language of the results return?
I guess both of them goes to the same setting?
As per the documentation:
"The API detects the browser settings of the user and set the language appropriately. It is possible to override the language in the
APIs."
The input field placeholder will change automatically depending on the users browser agent language setting.
You can also override the automatic language detection by setting the language parameter in your bootstrap request to a supported language.
E.G.
<script src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=ja"></script>
Related
what is the best way to have langage specific start pages dependent on the browser settings of the user?
The way I found out was to specify a "DefaultPage" as my start page that only contains a "Redirector" Module. This module checks the browser's language settings and redirects to "Startseite" if the browser language is "de-DE", else to "Home".
Because in the mean time I get problems on this way I am looking for a better solution:
1.) How can I obtain the real URL the user enters before DNN maps it to the start page?
2.) or is there a DNN-specific way that does what I want?
I have DNN Version 7.3.3.118.
I hope this will help you, what I understand is that you want site to display the page in language what browser is having.
There are language packages in DNN,install them these can help you.
the system checks preferred bowser language(s) of the user and tries to match with installed languages in your website. If there is a match, best match is used, otherwise site default language is presented.
https://www.dnnsoftware.com/answers/set-default-language-based-on-user-login-country-in-dnn
Surely language is an individual thing, and better set based on the user's browser settings or an explicit setting that they've selected and saved (via session/cookie).
If I'm sending a page I've just read to my french-speaking friend it would be better without any language code in the URL, so it opens in French for him based on his browser setting or on an earlier visit to the site.
This seems very obvious to me... but a LOT of major sites put the language in the URL. So I feel I must be missing something... What?
The only advantage I can see if for indexation purpose. If your web site needs to be indexed (e-commerce products for instance) then the language become very important for regional search engines.
For instance here is an extract from Google doc :
Google uses the content of the page to determine its language, but the
URL itself provides human users with useful clues about the page’s
content. For example, the following .ca URLs use fr as a subdomain or
subdirectory to clearly indicate French content:
http://example.ca/fr/vélo-de-montagne.html and
http://fr.example.ca/vélo-de-montagne.html.
How can I change the browser language preference setting programmatically?
In the scenario at hand, I want to start the webapp in different languages. The app delivers the language as requested in the browser's language preferences, so I want to reconfigure the browser to English, perform some steps, then reconfigure the browser to a different language, and repeat those steps.
For automation, I'd use VBScript (using some COM server?) or QTP (which basically is just a VBScript client in this context), but I don't think this should matter.
If Ansgar does not disagree, I post the final result of researching this topic:
It seems there is no better way than updating HKCU\Software\Microsoft\Internet Explorer\International\AcceptLanguage, and (at least) broadcasting a WM_SETTINGCHANGE message via SendMessage so every process in the current session sees this change immediately.
See http://www.codeproject.com/Articles/20756/Change-Internet-Explorer-Proxy-Setting-without-R for good examples how to do that.
do what google does (rather used to do)....
add a language parameter to your query string from your app...
eg. google.com/?ln=id&from=myApp
on the sessionstart event handler.... determine the ln parameter of the request and redirect the request to the appropriate web page versions, provide an English fallback if their system language is not supported by your site.
or
Add a translation widget to your website (bing.com/translate)... to allow visitors to use machine/human generated translations.
Currently Joomla is using mootools datepicker as it default datepicker, but my client don't like it and ask me to change it to another set.
However I can't find any settings in the administrator tool for me to change that.. or did I overlook it?
Anyone has any idea whether this can be done via settings or i need to change coding at the Joomla backend to achieve this?
Thanx
It's not in the admin or a parameter to change. If you want to modify the type of calendar the component is using you'll have to re-code it.
The function that calls the calendar is in the com_fabrik/views/form/form.js
From their it's calling the libs/jscalendar/calendar.js which handles the object instantiation and contains the core calendar functions.
It would take time to replace it with something like jQuery UI's calendar (one of my personal favorites) and it's probably not worth it. (At this point tell the "client" it'll cost a ton of money to do and they'll change their tune)
If they just don't like the look of it try modding the .css file libs/jscalendar/calendar-system.js
i heard about many ways that depend of files like csv or database
but i think uploading an extra database on my site to do that is not good idea
i feel good about the external providers
is useing externial site that give your the country by the ip is good way
or its not good because the server will wait the response of the external provider and this will slow down the site?
Look at this: http://www.rubyquiz.com/quiz139.html
It's actually not a great idea to base the language choice on the IP address anyway. What if I'm an American browsing from Germany, and I don't speak German very well? Your most standards-compliant way (I think) would be to parse the Accept-Language header of the web request, and use that to set a user's default, but always provide them a way to override the default and pick their language (which you'd then store in their session or user prefs)
I would use PHP variable $_SERVER['HTTP_ACCEPT_LANGUAGE'] which, in my case, holds this value sk,cs;q=0.8,en-us;q=0.5,en;q=0.3. That means, my browsers language is 'Slovak'.
I think, this option is better. Just imagine, that you are English, but you are on vacation somewhere.You use your notebook over there... Your IP address would tell your server, that you are in Croatia and you'd like to get content in their language... But you browser still says you are english speaking person... There is the difference ;)
I wouldn't use GeoIP for this - there are too many scenarios when it fails or produces the wrong results.
As #Paul says the HTTP Accept-Language header specifies the user's language preferences as defined in the browser. You can view what your browser is set to by visiting Browser Language Detection.
For a real worked example see Parse Accept-Language to detect a user's language.
Also remember that crawlers don't use Accept-Language so it is important to ensure that you have a strategy for making this available (e.g URLs for each language content) and include in sitemap.
Also see Apache Module mod_negotiation for content selection.