Browse Source

MSPB-104: Update German translation (#210)

* Update German translation

* Refactor key actions generation

* Refactor key entries structure

While key entries is provided as an object where the key corresponds to
the entrie's number, this complexity does not have to make it to the
template.

We already fill up empty entries by generating an array of key entries
length, hence no need to switch back to an object structure.

* Render combo keys count by section title
4.3
Joris Tirado 6 years ago
committed by GitHub
parent
commit
ccff21c9b5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 99 additions and 76 deletions
  1. +12
    -6
      i18n/de-DE.json
  2. +5
    -2
      i18n/en-US.json
  3. +1
    -1
      i18n/ru-RU.json
  4. +58
    -35
      submodules/devices/devices.js
  5. +23
    -32
      submodules/devices/views/devices-sip_device.html

+ 12
- 6
i18n/de-DE.json View File

@ -290,19 +290,25 @@
"__version": "v3.20_s4",
"keys": {
"alert": {
"message": "In der Standardeinstellung wird diese Taste als Leitungstaste verwendet. Wir empfehlen, dies nicht zu ändern."
"message": "In der Standardeinstellung wird diese Taste als Leitungstaste verwendet. Wir empfehlen, dies nicht zu ändern.",
"title": "Taste 1 im Standart"
},
"featureKeys": {
"title": "Funktionstasten",
"menuTitle": "Funktionstasten",
"sectionTitle": "Funktionstasten",
"label": "Funktionstaste"
},
"comboKeys": {
"title": "Kombitasten",
"label": "Kombitaste"
"menuTitle": "Funktionstaste",
"sectionTitle": "Funktionstaste {{range}}",
"range": "{{min}} - {{max}}",
"label": "Funktionstaste"
},
"labels": {
"deviceLabel": "Beschriftung",
"function": "Aktion",
"parkingSpot": "Halteposition",
"user": "Benutzer",
"user": "Aktionsdaten",
"value": "Wert"
},
"info": {
@ -320,7 +326,7 @@
"typeTitle": "{{variable}}: "
},
"types": {
"line": "Zeile",
"line": "Leitung",
"none": "Keine",
"presence": "Anwesenheit",
"parking": "Parken",


+ 5
- 2
i18n/en-US.json View File

@ -300,11 +300,14 @@
"title": "Key 1 Default"
},
"featureKeys": {
"title": "Feature Keys",
"menuTitle": "Feature Keys",
"sectionTitle": "Feature Keys",
"label": "Feature key"
},
"comboKeys": {
"title": "Combo Keys",
"menuTitle": "Combo Keys",
"sectionTitle": "Combo Keys {{range}}",
"range": "{{min}} - {{max}}",
"label": "Combo key"
},
"labels": {


+ 1
- 1
i18n/ru-RU.json View File

@ -616,7 +616,7 @@
"6": "Управляете возможностями пользователей. Вы можете включить, выключить или настроить различные дополнительные возможности."
}
},
"confirmMobileUnAssignment": "Вы собираетесь открепить мобильное устройство. Для информации, номер телефона ассоциированный с устройством ({{variable}}) также будет откреплен от данного пользователя. Вы уверены?",
"confirmMobileUnAssignment": "Вы собираетесь открепить мобильное устройство. Для информации, номер телефона ассоциированный с устройством ({{variable}}) также будет откреплен от данного пользователя. Вы уверены?"
},
"strategy": {


+ 58
- 35
submodules/devices/devices.js View File

@ -1008,8 +1008,7 @@ define(function(require) {
.chain(data.template)
.get([type, 'iterate'], 0)
.range()
.keyBy()
.mapValues(function(index) {
.map(function(index) {
return _.get(data.device, ['provision', type, index], {
type: 'none'
});
@ -1049,51 +1048,75 @@ define(function(require) {
};
}),
provision: {
keyActions: _.map([
'none',
'presence',
'parking',
'personal_parking',
'speed_dial'
], function(action) {
var i18n = self.i18n.active().devices.popupSettings.keys;
return {
id: action,
info: _.get(i18n, ['info', 'types', action]),
text: _.get(i18n, ['types', action])
};
}),
keys: _
.chain(data.template)
.thru(self.getKeyTypes)
.map(function(type) {
var camelCasedType = _.camelCase(type),
i18n = _.get(self.i18n.active().devices.popupSettings.keys, camelCasedType);
i18n = _.get(self.i18n.active().devices.popupSettings.keys, camelCasedType),
entries = _.get(mergedDevice, ['provision', type], []),
entriesCount = _.size(entries);
return _.merge({
id: type,
type: camelCasedType,
data: _
.chain(mergedDevice)
.get(['provision', type], {})
.mapValues(function(metadata) {
var value = _.get(metadata, 'value', {});
return _.merge({}, metadata, _.isPlainObject(value)
? {}
: {
value: {
value: _.toString(value)
}
}
);
actions: _
.chain([
'none',
'presence',
'parking',
'personal_parking',
'speed_dial'
])
.concat(
type === 'combo_keys' ? ['line'] : []
)
.map(function(action) {
var i18n = self.i18n.active().devices.popupSettings.keys;
return {
id: action,
info: _.get(i18n, ['info', 'types', action]),
label: _.get(i18n, ['types', action])
};
})
// Sort alphabetically while keeping `none` as first item
.sort(function(a, b) {
return a.id === 'none' ? -1
: b.id === 'none' ? 1
: a.label.localeCompare(b.label, monster.config.whitelabel.language);
})
.value()
.value(),
data: _.map(entries, function(metadata) {
var value = _.get(metadata, 'value', {});
return _.merge({}, metadata, _.isPlainObject(value)
? {}
: {
value: {
value: _.toString(value)
}
}
);
})
}, _.pick(i18n, [
'title',
'menuTitle',
'sectionTitle',
'label'
]));
]), _.has(i18n, 'range') ? {
sectionTitle: self.getTemplate({
name: '!' + i18n.sectionTitle,
data: {
range: entriesCount > 1 ? self.getTemplate({
name: '!' + i18n.range,
data: {
min: 1,
max: entriesCount
}
}) : ''
}
})
} : {});
})
.value(),
parkingSpots: _.range(1, 11)


+ 23
- 32
submodules/devices/views/devices-sip_device.html View File

@ -73,7 +73,7 @@
<li>
<a class="tabs-selector change-section" data-section="{{type}}" href="javascript:void(0);">
<i class="fa fa-lightbulb-o"></i>
{{title}}
{{menuTitle}}
</a>
</li>
{{/each}}
@ -323,7 +323,7 @@
<div class="tabs-section clearfix keys" data-section="{{type}}">
<div class="section-header">
<div class="title">
{{{title}}}
{{{sectionTitle}}}
</div>
<div class="type-info helper">
<a href="javascript:void(0);" data-toggle="collapse" data-target="#info_content_{{type}}">
@ -333,33 +333,25 @@
{{telicon 'question--circle'}}
</a>
<div id="info_content_{{type}}" class="collapse">
{{#each @root.extra.provision.keyActions}}
{{#each actions}}
{{#if info}}
<p>
<strong>
{{replaceVar @root.i18n.devices.popupSettings.keys.info.typeTitle text}}
{{replaceVar @root.i18n.devices.popupSettings.keys.info.typeTitle label}}
</strong>
{{info}}
</p>
{{/if}}
{{/each}}
{{#compare id '===' 'combo_keys'}}
<p>
<strong>
{{replaceVar @root.i18n.devices.popupSettings.keys.info.typeTitle @root.i18n.devices.popupSettings.keys.types.line}}
</strong>
{{@root.i18n.devices.popupSettings.keys.info.types.line}}
</p>
{{/compare}}
</div>
</div>
</div>
<div class="section-content">
{{#each data}}
<div class="control-group{{#compare ../id '===' 'combo_keys'}}{{#if @first}} warning{{/if}}{{/compare}}" data-id="{{@key}}">
<label for="provision.keys.{{../id}}[{{@key}}].type" class="control-label">
<div class="control-group{{#compare ../id '===' 'combo_keys'}}{{#if @first}} warning{{/if}}{{/compare}}" data-id="{{@index}}">
<label for="provision.keys.{{../id}}[{{@index}}].type" class="control-label">
{{telicon 'drag-handle' class='drag-handle-icon'}}
<span>{{ ../label }}</span> <span class="feature-key-index">{{@key}}</span>
<span>{{ ../label }}</span> <span class="feature-key-index">{{@index}}</span>
</label>
{{#compare ../id '===' 'combo_keys'}}
{{#monsterPanelText @root.i18n.devices.popupSettings.keys.alert.title 'warning' 'fill-width'}}
@ -369,22 +361,21 @@
<div class="controls">
<div class="feature-key-value active">
{{#compare ../id '===' 'combo_keys'}}
<label for="provision.keys.{{../id}}[{{@key}}].type">{{ @root.i18n.devices.popupSettings.keys.labels.function }}</label>
<label for="provision.keys.{{../id}}[{{@index}}].type">{{ @root.i18n.devices.popupSettings.keys.labels.function }}</label>
{{/compare}}
<select name="provision.keys.{{../id}}[{{@key}}].type" class="feature-key-type span2">
<select name="provision.keys.{{../id}}[{{@index}}].type" class="feature-key-type span2">
{{#select type}}
{{#each @root.extra.provision.keyActions}}
<option value="{{id}}">{{text}}</option>
{{#each ../actions}}
<option value="{{id}}">
{{label}}
</option>
{{/each}}
{{#compare ../id '===' 'combo_keys'}}
<option value="line">{{@root.i18n.devices.popupSettings.keys.types.line}}</option>
{{/compare}}
{{/select}}
</select>
</div>
<div class="feature-key-value" data-type="presence">
<label for="provision.keys.{{../id}}[{{@key}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.user }}</label>
<select name="provision.keys.{{../id}}[{{@key}}].value.value" class="chosen-feature-key-user">
<label for="provision.keys.{{../id}}[{{@index}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.user }}</label>
<select name="provision.keys.{{../id}}[{{@index}}].value.value" class="chosen-feature-key-user">
{{#each @root.extra.users}}
<option value="{{id}}">
{{getUserFullName this}}
@ -393,16 +384,16 @@
</select>
</div>
<div class="feature-key-value" data-type="parking">
<label for="provision.keys.{{../id}}[{{@key}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.parkingSpot }}</label>
<select class="span1" name="provision.keys.{{../id}}[{{@key}}].value.value">
<label for="provision.keys.{{../id}}[{{@index}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.parkingSpot }}</label>
<select class="span1" name="provision.keys.{{../id}}[{{@index}}].value.value">
{{#each @root.extra.provision.parkingSpots}}
<option value="{{this}}">{{this}}</option>
{{/each}}
</select>
</div>
<div class="feature-key-value" data-type="personal_parking">
<label for="provision.keys.{{../id}}[{{@key}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.user }}</label>
<select name="provision.keys.{{../id}}[{{@key}}].value.value" class="chosen-feature-key-user">
<label for="provision.keys.{{../id}}[{{@index}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.user }}</label>
<select name="provision.keys.{{../id}}[{{@index}}].value.value" class="chosen-feature-key-user">
{{#each @root.extra.users}}
<option value="{{id}}">
{{getUserFullName this}}
@ -411,13 +402,13 @@
</select>
</div>
<div class="feature-key-value" data-type="speed_dial">
<label for="provision.keys.{{../id}}[{{@key}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.value }}</label>
<input type="text" value="" name="provision.keys.{{../id}}[{{@key}}].value.value">
<label for="provision.keys.{{../id}}[{{@index}}].value.value">{{ @root.i18n.devices.popupSettings.keys.labels.value }}</label>
<input type="text" value="" name="provision.keys.{{../id}}[{{@index}}].value.value">
</div>
{{#compare ../id '===' 'combo_keys'}}
<div class="feature-key-value" data-type="presence personal_parking speed_dial parking">
<label for="provision.keys.{{../id}}[{{@key}}].value.label">{{ @root.i18n.devices.popupSettings.keys.labels.deviceLabel }}</label>
<input type="text" value="" name="provision.keys.{{../id}}[{{@key}}].value.label">
<label for="provision.keys.{{../id}}[{{@index}}].value.label">{{ @root.i18n.devices.popupSettings.keys.labels.deviceLabel }}</label>
<input type="text" value="" name="provision.keys.{{../id}}[{{@index}}].value.label">
</div>
{{/compare}}
</div>


Loading…
Cancel
Save