First page Back Continue Last page Graphics
Translation File Format
- The Translation Files use the JSON format. The contents are loaded into the $scope.translations object of the root DOM element and is accessible from all the element's $scope variables via inheritance. Therefore, the format of the file is up to you as you will be referencing the translations in your HTML file as follows.
- data-ng-bind="translations.LEADER+': '+data.Car.LEADER.Lap.Current.ValueFormatted"
- The most simple JSON format is a key/value pair as follows.
- {
"LEADER": "Leader",
"KEY": "value"
}
- To translate the file to a different language, simply copy the "text-en.json" file to the target language (i.e. "text-{language}.json") and translate the value side of the contents.
- You could also create a country specific file if needed. It's worthy to point out, all of the contents do not have to be translated, only the ones you need to because the contents are merged. An example is "en" verses "uk", where most words are spelled the same, but some are not. You only need to put the differences in the "text-uk.json" version of the file.