Class: Appwrite::Locale

Inherits:
Service show all
Defined in:
lib/appwrite/services/locale.rb

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Appwrite::Service

Instance Method Details

#getLocale

Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.

([IP Geolocation by DB-IP](db-ip.com))

Returns:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/appwrite/services/locale.rb', line 16

def get()
    path = '/locale'

    params = {
    }

    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: params,
        response_type: Models::Locale
    )
end

#get_continentsContinentList

List of all continents. You can use the locale header to get the data in a supported language.

Returns:

  • (ContinentList)


40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/appwrite/services/locale.rb', line 40

def get_continents()
    path = '/locale/continents'

    params = {
    }

    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: params,
        response_type: Models::ContinentList
    )
end

#get_countriesCountryList

List of all countries. You can use the locale header to get the data in a supported language.

Returns:

  • (CountryList)


64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/appwrite/services/locale.rb', line 64

def get_countries()
    path = '/locale/countries'

    params = {
    }

    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: params,
        response_type: Models::CountryList
    )
end

#get_countries_euCountryList

List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.

Returns:

  • (CountryList)


88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/appwrite/services/locale.rb', line 88

def get_countries_eu()
    path = '/locale/countries/eu'

    params = {
    }

    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: params,
        response_type: Models::CountryList
    )
end

#get_countries_phonesPhoneList

List of all countries phone codes. You can use the locale header to get the data in a supported language.

Returns:

  • (PhoneList)


112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/appwrite/services/locale.rb', line 112

def get_countries_phones()
    path = '/locale/countries/phones'

    params = {
    }

    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: params,
        response_type: Models::PhoneList
    )
end

#get_currenciesCurrencyList

List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.

Returns:

  • (CurrencyList)


137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/appwrite/services/locale.rb', line 137

def get_currencies()
    path = '/locale/currencies'

    params = {
    }

    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: params,
        response_type: Models::CurrencyList
    )
end

#get_languagesLanguageList

List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.

Returns:

  • (LanguageList)


161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/appwrite/services/locale.rb', line 161

def get_languages()
    path = '/locale/languages'

    params = {
    }

    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: params,
        response_type: Models::LanguageList
    )
end