Open Graph Beta: Adding units to actions or objects for publish_action?
I've been reviewing the Open Graph Beta docs, and I'm interested in how to add measurement units to action or object properties. The classic example is "User Ran a Route". Is there a way I can say that Route is '5 km' and '3.1 miles'? Further, 开发者_如何学GoI'd like to choose the right property to aggregate as one big number for the user. User A may work in 'miles' and User B may work in 'km'.
Ideas?
We don't have locale aware units for the Open Graph. Even on Facebook we don't change status updates from "I ran 5km" to "I ran 3mi".
The best I can recommend is to attach two properties onto your Object. Distance and Distance (in miles). Then build 2 aggregations, one for the Distance and one for the Distance in miles.
Then when a user runs a route, you only have to publish one property based on their locale and only 1 aggregation will show up.
You have to be careful to be consistent for the same user otherwise they'll end up with 2 aggregations fracturing their distance.
maybe you can use this system:
if locale US:
<meta property="CANVASNAME:distance" content="3.0" />
<meta property="CANVASNAME:distance:units" content="miles" />
if locale DE, FR, ...:
<meta property="CANVASNAME:distance" content="5.0" />
<meta property="CANVASNAME:distance:units" content="km" />
精彩评论