Closed ruthoferroman closed 1 year ago
Hi @ruthoferroman
Not sure I understand this request, displayName
is already a localizable string. Can you elaborate?
Hi @rido-min
What i want to do is to define a custom property "myProperty..." in my model which is a localizable string.
@ruthoferroman what property elements do you want to localize in the example below?
{
"@context" : "dtmi:dtdl:context;2",
"@type": "Interface",
"@id": "dtmi:sample:property;1",
"contents": [
{
"@type": "Property",
"name": "myProperty",
"schema": "string"
}
]
}
@rido-min I'd like to define a property in a model like:
{
"@id": "dtmi:AutomationApps:Devices:Blinds:Blind;1",
"@type": "Interface",
"@context": "dtmi:dtdl:context;2",
"displayName": "Blind",
"contents": [
{
"@type": "Property",
"name": "LocProperty",
"schema": "LOCALIZABLESTRING"
},
...
so that i can use it in twins somehow like
"LocProperty": {
"de": "keine Verbindung zum Gerät",
"en": "No Connection to Device!",
"es": "¡Sin conexión con el dispositivo!"
}
hope this makes it a little more clear
You can do this:
{
"@context": "dtmi:dtdl:context;2",
"@id": "dtmi:AutomationApps:Devices:Blinds:Blind;1",
"@type": "Interface",
"displayName": "Blind",
"schemas": [
{
"@id": "dtmi:AutomationApps:schema:localizableString;1",
"@type": "Map",
"mapKey": {
"name": "languageCode",
"schema": "string"
},
"mapValue": {
"name": "localizedString",
"schema": "string"
}
}
],
"contents": [
{
"@type": "Property",
"name": "LocProperty",
"schema": "dtmi:AutomationApps:schema:localizableString;1"
}
]
}
@jrdouceur That's what I was looking for
Thx!
Is there a way to declare a property as a localizeable string like the models 'displayName'?