Fix missing translations, enable dutch language (#878)
* Fix missing translations, enable dutch language
This commit is contained in:
24
app/javascript/widget/mixins/agentMixin.js
Normal file
24
app/javascript/widget/mixins/agentMixin.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
methods: {
|
||||
getAvailableAgentsText(agents) {
|
||||
const count = agents.length;
|
||||
if (count === 1) {
|
||||
const [agent] = agents;
|
||||
return `${agent.name} ${this.$t('AGENT_AVAILABILITY.IS_AVAILABLE')}`;
|
||||
}
|
||||
|
||||
if (count === 2) {
|
||||
const [first, second] = agents;
|
||||
return `${first.name} ${this.$t('AGENT_AVAILABILITY.AND')} ${
|
||||
second.name
|
||||
} ${this.$t('AGENT_AVAILABILITY.ARE_AVAILABLE')}`;
|
||||
}
|
||||
|
||||
const [agent] = agents;
|
||||
const rest = agents.length - 1;
|
||||
return `${agent.name} ${this.$t(
|
||||
'AGENT_AVAILABILITY.AND'
|
||||
)} ${rest} ${this.$t('AGENT_AVAILABILITY.OTHERS_ARE_AVAILABLE')}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user