i18n alignment for mobile-presense

This commit is contained in:
twack
2016-03-06 05:35:09 -08:00
parent c1422438ac
commit f31c3bf5ee
2 changed files with 25 additions and 11 deletions

View File

@@ -19,6 +19,7 @@
# #
# Change History: # Change History:
# 1. 20160205 TW Initial release with informal Korean translation. # 1. 20160205 TW Initial release with informal Korean translation.
# 2. 20160224 TW Updated with formal Korean translation.
#============================================================================== #==============================================================================
# Korean (ko) # Korean (ko)
# Device Preferences # Device Preferences

View File

@@ -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 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
* in compliance with the License. You may obtain a copy of the License at: * 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 * 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 * Unless required by applicable law or agreed to in writing, software
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* for the specific language governing permissions and limitations under the License. * 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 { metadata {
definition (name: "Mobile Presence", namespace: "smartthings", author: "SmartThings") { definition (name: "Mobile Presence", namespace: "smartthings", author: "SmartThings") {
capability "Presence Sensor" capability "Presence Sensor"
@@ -41,6 +53,7 @@ def parse(String description) {
def isStateChange = isStateChange(device, name, value) def isStateChange = isStateChange(device, name, value)
def results = [ def results = [
translatable: true,
name: name, name: name,
value: value, value: value,
unit: null, unit: null,
@@ -72,8 +85,8 @@ private String parseValue(String description) {
private parseDescriptionText(String linkText, String value, String description) { private parseDescriptionText(String linkText, String value, String description) {
switch(value) { switch(value) {
case "present": return "$linkText has arrived" case "present": return "{{ linkText }} has arrived"
case "not present": return "$linkText has left" case "not present": return "{{ linkText }} has left"
default: return value default: return value
} }
} }