ip-to-lang
Documentation / interface/ip-to-lang
countryToLanguage​
const countryToLanguage: object[];
Defined in: interface/ip-to-lang.js:36
Type declaration​
Name | Type | Default value | Defined in |
---|---|---|---|
|
|
| interface/ip-to-lang.js:37 |
|
|
| interface/ip-to-lang.js:37 |
|
|
| interface/ip-to-lang.js:37 |
getLanguageFromIP()​
function getLanguageFromIP(ip: string): Promise<any>;
Defined in: interface/ip-to-lang.js:19
Retrieves language information for a given IP address using a remote API. Rate limit 45 req/min
You should first use Accept-Language header or navigator.language in front-end for user-set language https://stackoverflow.com/questions/673905/how-can-i-determine-a-users-locale-within-the-browser/31135571#31135571
Parameters​
Parameter | Type | Description |
---|---|---|
|
| The IP address to look up. |
Returns​
Promise
<any
>
A promise that resolves to an object containing country and language information, or undefined if not found.