From f31c3bf5eef3fafaacdce8be2347a4018fe28fcc Mon Sep 17 00:00:00 2001 From: twack Date: Sun, 6 Mar 2016 05:35:09 -0800 Subject: [PATCH] i18n alignment for mobile-presense --- .../i18n/messages.properties | 3 +- .../mobile-presence.groovy | 33 +++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/devicetypes/smartthings/mobile-presence.src/i18n/messages.properties b/devicetypes/smartthings/mobile-presence.src/i18n/messages.properties index bfe484e..75313a5 100644 --- a/devicetypes/smartthings/mobile-presence.src/i18n/messages.properties +++ b/devicetypes/smartthings/mobile-presence.src/i18n/messages.properties @@ -19,6 +19,7 @@ # # Change History: # 1. 20160205 TW Initial release with informal Korean translation. +# 2. 20160224 TW Updated with formal Korean translation. #============================================================================== # Korean (ko) # Device Preferences @@ -28,4 +29,4 @@ '''{{ linkText }} has left'''.ko={{ linkText }}님이 나갔습니다 '''{{ linkText }} has arrived'''.ko={{ linkText }}님이 도착했습니다 '''present'''.ko=집안 -'''not present'''.ko=부재중 +'''not present'''.ko=부재중 \ No newline at end of file diff --git a/devicetypes/smartthings/mobile-presence.src/mobile-presence.groovy b/devicetypes/smartthings/mobile-presence.src/mobile-presence.groovy index 34bb78a..b0fa346 100644 --- a/devicetypes/smartthings/mobile-presence.src/mobile-presence.groovy +++ b/devicetypes/smartthings/mobile-presence.src/mobile-presence.groovy @@ -1,16 +1,28 @@ -/** - * Copyright 2015 SmartThings +/* +=============================================================================== + * Copyright 2016 SmartThings * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at: + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License - * for the specific language governing permissions and limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. +=============================================================================== + * Purpose: Mobile Presence DTH File * + * Filename: mobile-presence.src/mobile-presence.groovy + * + * Change History: + * 1. 20160205 TW - Update/Edit to support i18n translations +=============================================================================== */ + metadata { definition (name: "Mobile Presence", namespace: "smartthings", author: "SmartThings") { capability "Presence Sensor" @@ -41,6 +53,7 @@ def parse(String description) { def isStateChange = isStateChange(device, name, value) def results = [ + translatable: true, name: name, value: value, unit: null, @@ -72,8 +85,8 @@ private String parseValue(String description) { private parseDescriptionText(String linkText, String value, String description) { switch(value) { - case "present": return "$linkText has arrived" - case "not present": return "$linkText has left" + case "present": return "{{ linkText }} has arrived" + case "not present": return "{{ linkText }} has left" default: return value } } @@ -84,4 +97,4 @@ private getState(String value) { case "not present": return "left" default: return value } -} +} \ No newline at end of file