Languages

Menu
Sites
Language
[FEEDBACK] Tizen::Locales missing preferred measurement type (imperial vs. metric).

Hi,

I do not find any way to discover the preferred/designated measurement type (imperial vs. metric) for a device/Locale/Time Zone. Any suggestions?

Gary

Edited by: Gary V on 03 Oct, 2013

Responses

6 Replies
hgw7
I think UTC is the primary standard used for timezones. https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.appprogramming%2Fhtml%2Fguide%2Flocales%2Ftime_zone.htm
Gary V
A timezone (UTC, EST) is a time offset, a measurement type (imperial, metric) is the usage of kilometers (Europe) vs. miles (U.S.). Gary
hgw7
Saw timezone and thought you had asked about that, sorry. The Metric system is used. In help contents of 'Tizen::Locations' Namespace, check 'LocationAccuracy' enumerator, or the parameters in api's like 'LocationProvider::StartLocationUpdatesByDistance()', 'Coordinates::GetDistanceTo()' etc.
Gary V
Sorry, perhaps I wasn't clear. Regardless of how Tizen API represents a distance of, say, 25 meters ("from here to your restaurant"), an application has to PRESENT that distance to the user in his or her preferred measurement style. For a U.S. person, "go 25 meters and turn right [to your restaurant]" will be meaningless and will have to be translated as "go 82 feet and turn right". My question concerns how to query Tizen for the preferred measurement style (imperial vs. metric) to use for PRESENTATION (not CALCULATION). The preferred measurement style might be set on locale basis (the measurement style for a country, set in device Settings >> Language and keyboard, Region), on time zone basis (the measurement style for a user on an international trip, set in device Settings >> Date and time, Time zone), or on individual basis (the measurement style chosen explicitly by a U.S. person who has just moved to France and still does not "feel" meters and kilometers). There seems to be no Tizen API such as Locale::GetSystemLocale() + Locale::GetMeasurementStyle() (a measurement style for a device system locale), analogous to Locale::GetCountryCodeString() (a country code string for a device system locale). That's what I meant. Appreciate the offer to help, though! Gary
Gary V

FYI, a workaround:

        using namespace Tizen::Base;
	using namespace Tizen::Locales;
	
	LocaleManager* pLocaleManager = new (std::nothrow) LocaleManager();
	pLocaleManager->Construct();
	
	Locale systemLocale = pLocaleManager->GetSystemLocale();
	CountryCode code = systemLocale.GetCountryCode();

	delete pLocaleManager, pLocaleManager = null;

	if (code == COUNTRY_US ||
		code == COUNTRY_GB ||
		code == /* Liberia */ COUNTRY_LR ||
		code == /* Burma */ COUNTRY_MM)
	{
		// imperial
	}
	else
	{
		// metric
	}

Gary

Pushpa G

AFAIK, there is no API to get the imperial and metric of Locales in Tizen, However you can write your own logic to achieve this

Check this link http://stackoverflow.com/questions/4898237/using-locale-settings-to-detect-wheter-to-use-imperial-units