mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-18 21:03:39 +00:00
i18n alignment for mobile-presense
This commit is contained in:
@@ -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
|
||||||
@@ -28,4 +29,4 @@
|
|||||||
'''{{ linkText }} has left'''.ko={{ linkText }}님이 나갔습니다
|
'''{{ linkText }} has left'''.ko={{ linkText }}님이 나갔습니다
|
||||||
'''{{ linkText }} has arrived'''.ko={{ linkText }}님이 도착했습니다
|
'''{{ linkText }} has arrived'''.ko={{ linkText }}님이 도착했습니다
|
||||||
'''present'''.ko=집안
|
'''present'''.ko=집안
|
||||||
'''not present'''.ko=부재중
|
'''not present'''.ko=부재중
|
||||||
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,4 +97,4 @@ private getState(String value) {
|
|||||||
case "not present": return "left"
|
case "not present": return "left"
|
||||||
default: return value
|
default: return value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user