fitContributions dataLabel

Former Member
Former Member
The dataLabel key is used to render the label of the data field in the Activity Summary section of the Activity Details page.
But in my generated Fit file and on GC the field_name is used for the label.

<resources>
<fitContributions>
<fitField id="0" displayInActivitySummary="true" sortOrder = "0" precision="1"
dataLabel="@Strings.fitDataLabel"
unitLabel="@Strings.fitUnitsLabel" />
</fitContributions>

<strings>
<string id="fitFieldName">weight</string>
<string id="fitDataLabel">Weight</string>
<string id="fitUnitsLabel">kg</string>
</strings>
</resources>


session = Rec.createSession({:sport=>Rec.SPORT_GENERIC, :name=>Ui.loadResource(Rez.Strings.sessionName)});
session.start();
fitField = session.createField(Ui.loadResource(Rez.Strings.fitFieldName), 0, Fit.DATA_TYPE_FLOAT, { :mesgType=>Fit.MESG_TYPE_SESSION, :units=>Ui.loadResource(Rez.Strings.fitUnitsLabel)});


I want to use the fitDataLabel for multilanguage support, whats wrong here?
  • I don't know the answer, but I'll give you something else to consider.

    Using English, you have units (unitLabel) set to Kg. What happens for folks in the US, where "lbs" is used? The "<fitContributions>" is set when you put the app in the store, and same for all users in english.

    Might it make sense to store the weight as a sting, with the units included, so if the watch is set to Statute and not Metric, the user sees "123 lbs" and not 55.8 kg?

    The conversion of standard .fit fields is done in GC for things like this, and something to consider..
  • Former Member
    Former Member
    English units are on the todo list for the next version.
    Depending on DeviceSettings.weightUnits the correct unit/value is displayed on the watch already.

    I can include the unit into the weight data, but the dataLabel for GC does not honor the language specific
    strings in fitContributions (verified with monkeygraph).

    Is this a know limitation?
  • Hi, I am just wondering how to correctly add multilanguges support for a ciq field name.

    Same code sometimes properly localized and sometimes not. So weird.

    My code is just like

    fitField = session.createField(“JumpCountField”, 0, Fit.DATA_TYPE_FLOAT, { :mesgType=>Fit.MESG_TYPE_SESSION, :units=>Ui.loadResource(Rez.Strings.fitUnitsLabel)});

    <resources>
    <fitContributions>
    <fitField id="0" displayInActivitySummary="true" sortOrder = "0" precision="1"
    dataLabel="@Strings.fitDataLabel"
    unitLabel="@Strings.fitUnitsLabel" />
    </fitContributions>

    Is it ciq's bug?