Page 1 of 1

Localize a currency for the in-app price tag

Posted: Sun Mar 10, 2019 9:50 pm
by Jellobus
Hi guys,

How to localized in-app price tags depend of the countries? so how to find out a money currency setting used by the App Store?

For example, App should show US dollar to users registered in the US App Store, Japanese Yen to users registered in the Japanese App Store.

I checked both mobilePreferredLaguages, mobileCurrentLocale. They return language and country settings but they don’t mean anything about the money currency settings in the device. Even though it returns "US" or "JP" for country setting, the money currency can be anything depends on the App Store's country setting.

Any suggestions?

Thanks a million in advance,,

Louis

Re: Localize a currency for the in-app price tag

Posted: Mon Mar 11, 2019 11:24 am
by richmond62
All I can suggest is to "tie" currency to locale, so:

Code: Select all

switch mobileCurrentLocale() 
case "en_UK" 
  updateDisplay "english"
  put "£" into CURRENCY
  break
  case "en_US"
  update display "english"
  put "$" into CURRENCY
  break
  case "yo_NG"
  update display "yoruba"
  put "Naira" into CURRENCY
  break
  end switch
 
end if
https://docs.oracle.com/cd/E13214_01/wl ... codes.html

Re: Localize a currency for the in-app price tag

Posted: Mon Mar 11, 2019 2:25 pm
by richmond62
Sorry, instead of putting "Naira" into my sample code
I should have put "NGN":

https://www.iban.com/currency-codes

It might be better, and easier to handle if one were to use the numeric codes
for currencies.

So, for Nigeria one might use 566.
-
Nigeria_naira.jpg
-
Currently running at about 362 to the United States dollar.

Re: Localize a currency for the in-app price tag

Posted: Tue Mar 12, 2019 5:16 pm
by Jellobus
Hi richmond62

mobileCurrentLocale() returns language and country settings but it does not provide the money currency setting in App Store. Even though it returns "en-US" for country setting, the money currency can be anything depends on the App Store's country setting.

Do you know how to find out the country setting of App Store?

Re: Localize a currency for the in-app price tag

Posted: Tue Mar 12, 2019 7:08 pm
by richmond62
Even though it returns "en-US" for country setting, the money currency can be anything depends on the App Store's country setting.
I must be missing something as that sentence seems to imply that the currency is
directly linked to the country setting.
-
Screenshot 2019-03-12 at 20.07.20.png
-
I cannot find a way to change the language (to, say, Scots) independently
of the "country" setting [the UK is not a country].

Re: Localize a currency for the in-app price tag

Posted: Wed Mar 13, 2019 5:28 pm
by jacque
The App Store handles currency conversions for you, and unless they provide an API to get that info I'm not sure you can retrieve it. I think once a user has purchased in-app, the response may provide the currency (I'm guessing) but that won't help if you want to display a cost before a purchase.

Do any other apps do this?

Re: Localize a currency for the in-app price tag

Posted: Wed Mar 13, 2019 5:39 pm
by richmond62
Do any other apps do this?
All apps display a price pre-purchase:
-
Screenshot 2019-03-13 at 18.38.51.png
-
Presumably the currency is determined by the country setting of the App-Store,

Re: Localize a currency for the in-app price tag

Posted: Wed Mar 13, 2019 6:52 pm
by jacque
richmond62 wrote:
Wed Mar 13, 2019 5:39 pm
Do any other apps do this?
All apps display a price pre-purchase:
-
Screenshot 2019-03-13 at 18.38.51.png
-
Presumably the currency is determined by the country setting of the App-Store,
Right, but that's in the App Store itself. The question was how to query that currency from within the app and display it in the app without sending the user to the store to look it up.

Re: Localize a currency for the in-app price tag

Posted: Wed Mar 13, 2019 7:16 pm
by richmond62
The question was how to query that currency from within the app and display it in the app
I wish you had stated that as clearly as you did just now earlier on. 8)

Re: Localize a currency for the in-app price tag

Posted: Wed Mar 13, 2019 7:22 pm
by richmond62
Just go back to my code I offered above.

NO: it will not retrieve a state's currency, but it will retrieve the code for
the state the computer is domiciled in [and I mean "domiciled" rather than is physically present]
and then from a look-up list you can find the currency that is relevant.

Re: Localize a currency for the in-app price tag

Posted: Thu Mar 14, 2019 7:11 pm
by Jellobus
Here is my experiment with iPhone.

-Region setting: United States
-Country setting of the App Store ID(App Store): Japan <-- You can not find country setting of a user ID in the phone, You only able to choose a country when register the Apple ID.

With this settings,
1.mobileCurrentLocale() returns "en_US"
2.App Store shows Japanese yen ¥ as a default currency because country setting of App Store is Japan.

This scenario can happen when Japanese users travel to US. By using mobileCurrentLocale(), the currency of the price tag "in the app" (Not the store front) will be US dollar while the App Store's default currency is Japanese Yen. This will confuse users.

But is mobileCurrentLocale() still the best option?
I have implemented mobileCurrentLocale() but it will be great if anyone suggest a option..

Cheers,