Skip to content

Commit

Permalink
[openuv] Add all default translations to properties file (openhab#11435)
Browse files Browse the repository at this point in the history
Allows translating the openuv binding strings with Crowdin.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored and Nemer_Daud committed Jan 28, 2022
1 parent eea1524 commit 2799a1f
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void initialize() {
BridgeConfiguration config = getConfigAs(BridgeConfiguration.class);
if (config.apikey.isEmpty()) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"Parameter 'apikey' must be configured.");
"@text/offline.config-error-unknown-apikey");
return;
}
header.put("x-access-token", config.apikey);
Expand Down Expand Up @@ -127,9 +127,8 @@ private void initiateConnexion() {
LocalDate tomorrow = today.plusDays(1);
LocalDateTime tomorrowMidnight = tomorrow.atStartOfDay().plusMinutes(2);

String message = "Quota Exceeded, going OFFLINE for today, will retry at : "
+ tomorrowMidnight.toString();
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, message);
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, String
.format("@text/offline.comm-error-quota-exceeded [ \"%s\" ]", tomorrowMidnight.toString()));

reconnectJob = scheduler.schedule(this::initiateConnexion,
Duration.between(LocalDateTime.now(), tomorrowMidnight).toMinutes(), TimeUnit.MINUTES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public void initialize() {

if (config.refresh < 3) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"Parameter 'refresh' must be higher than 3 minutes to stay in free API plan");
"@text/offline.config-error-invalid-refresh");
} else {
Bridge bridge = getBridge();
if (bridge == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Invalid bridge");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED);
} else {
bridgeHandler = (OpenUVBridgeHandler) bridge.getHandler();
updateStatus(ThingStatus.UNKNOWN);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# binding

binding.openuv.name = OpenUV Binding
binding.openuv.description = Global Real-Time UV Index Forecast API

# thing types

thing-type.openuv.openuvapi.label = Open UV API
thing-type.openuv.openuvapi.description = Bridge to the OpenUV Project API. In order to receive the data, you must register an account on https://www.openuv.io/auth/google and get your API token.
thing-type.openuv.uvreport.label = UV Report
thing-type.openuv.uvreport.description = Provides various UV data from the OpenUV Project for a given location.

# thing types config

thing-type.config.openuv.openuvapi.apikey.label = API Key
thing-type.config.openuv.openuvapi.apikey.description = Data-platform token to access the OpenUV API service
thing-type.config.openuv.uvreport.location.label = Location
thing-type.config.openuv.uvreport.location.description = Your geo coordinates separated with comma (e.g. "37.8,-122.4,177").
thing-type.config.openuv.uvreport.refresh.label = Refresh Interval
thing-type.config.openuv.uvreport.refresh.description = Specifies the refresh interval in minutes.

# channel types

channel-type.openuv.Alert.label = UV Alert
channel-type.openuv.Alert.state.option.0 = Low
channel-type.openuv.Alert.state.option.1 = Medium
channel-type.openuv.Alert.state.option.2 = High
channel-type.openuv.Alert.state.option.3 = Very high
channel-type.openuv.Alert.state.option.4 = Extreme
channel-type.openuv.Ozone.label = Ozone
channel-type.openuv.Ozone.description = Ozone level from OMI data
channel-type.openuv.SafeExposure.label = Safe Exposure
channel-type.openuv.SafeExposure.description = Safe exposure duration for Fitzpatrick Skin Types.
channel-type.openuv.UVColor.label = Alert Color
channel-type.openuv.UVColor.description = Color associated to given UV Index alert level.
channel-type.openuv.UVIndex.label = UV Index
channel-type.openuv.UVIndex.description = UV Index
channel-type.openuv.UVMax.label = UV Max
channel-type.openuv.UVMax.description = Max UV Index for the day (at solar noon)
channel-type.openuv.UVMaxEvent.label = UV Max Event
channel-type.openuv.UVMaxEvent.description = Triggers when current UV Index reaches maximum of the day
channel-type.openuv.elevation.label = Elevation
channel-type.openuv.elevation.description = The elevation of the sun (should FOLLOW appropriate item).
channel-type.openuv.timestamp.label = Timestamp
channel-type.openuv.timestamp.state.pattern = %1$tF %1$tR

# channel types config

channel-type.config.openuv.SafeExposure.index.label = Skin Type
channel-type.config.openuv.SafeExposure.index.description = Fitzpatrick Skin Type.
channel-type.config.openuv.SafeExposure.index.option.I = Pale
channel-type.config.openuv.SafeExposure.index.option.II = White
channel-type.config.openuv.SafeExposure.index.option.III = Light brown
channel-type.config.openuv.SafeExposure.index.option.IV = Moderate brown
channel-type.config.openuv.SafeExposure.index.option.V = Dark brown
channel-type.config.openuv.SafeExposure.index.option.VI = Black

# Thing status descriptions

offline.config-error-unknown-apikey = Parameter 'apikey' must be configured.
offline.config-error-invalid-refresh = Parameter 'refresh' must be higher than 3 minutes to stay in free API plan.
offline.comm-error-quota-exceeded = Quota Exceeded, going OFFLINE for today, will retry at : {0}

# Discovery result

discovery.openuv.uvreport.local.label = Local UV Report
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# binding

binding.openuv.name = Extension OpenUV
binding.openuv.description = Service de prévision globale de l'indice UV en temps réel.

# thing types

thing-type.openuv.openuvapi.label = Bridge OpenUV
thing-type.openuv.openuvapi.description = Passerelle vers le service du projet OpenUV. Pour recevoir des données vous devez créer votre compte à l'adresse https://www.openuv.io/auth/google et obtenir votre clef API.

thing-type.openuv.uvreport.label = Rapport UV
thing-type.openuv.uvreport.description = Fournit diverses information pour un emplacement donnée.

0 comments on commit 2799a1f

Please sign in to comment.