mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
improvement: add translation to new components
This commit is contained in:
@@ -7,6 +7,7 @@ import Select from "@material-ui/core/Select";
|
||||
import Chip from "@material-ui/core/Chip";
|
||||
import toastError from "../../errors/toastError";
|
||||
import api from "../../services/api";
|
||||
import { i18n } from "../../translate/i18n";
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
chips: {
|
||||
@@ -33,17 +34,17 @@ const QueueSelect = ({ selectedQueueIds, onChange }) => {
|
||||
})();
|
||||
}, []);
|
||||
|
||||
const handleChange = event => {
|
||||
onChange(event.target.value);
|
||||
const handleChange = e => {
|
||||
onChange(e.target.value);
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ marginTop: 6 }}>
|
||||
<FormControl fullWidth margin="dense" variant="outlined">
|
||||
<InputLabel>Filas</InputLabel>
|
||||
<InputLabel>{i18n.t("queueSelect.inputLabel")}</InputLabel>
|
||||
<Select
|
||||
multiple
|
||||
labelWidth={40}
|
||||
labelWidth={60}
|
||||
value={selectedQueueIds}
|
||||
onChange={handleChange}
|
||||
MenuProps={{
|
||||
|
||||
@@ -175,7 +175,7 @@ const TicketsManager = () => {
|
||||
color="primary"
|
||||
onClick={() => setNewTicketModalOpen(true)}
|
||||
>
|
||||
Novo
|
||||
{i18n.t("ticketsManager.buttons.newTicket")}
|
||||
</Button>
|
||||
<Can
|
||||
role={user.profile}
|
||||
|
||||
@@ -4,6 +4,7 @@ import MenuItem from "@material-ui/core/MenuItem";
|
||||
import FormControl from "@material-ui/core/FormControl";
|
||||
import Select from "@material-ui/core/Select";
|
||||
import { Checkbox, ListItemText } from "@material-ui/core";
|
||||
import { i18n } from "../../translate/i18n";
|
||||
|
||||
const TicketsQueueSelect = ({
|
||||
userQueues,
|
||||
@@ -34,7 +35,7 @@ const TicketsQueueSelect = ({
|
||||
},
|
||||
getContentAnchorEl: null,
|
||||
}}
|
||||
renderValue={() => "Filas"}
|
||||
renderValue={() => i18n.t("ticketsQueueSelect.placeholder")}
|
||||
>
|
||||
{userQueues?.length > 0 &&
|
||||
userQueues.map(queue => (
|
||||
|
||||
@@ -190,6 +190,14 @@ const messages = {
|
||||
chat: {
|
||||
noTicketMessage: "Select a ticket to start chatting.",
|
||||
},
|
||||
ticketsManager: {
|
||||
buttons: {
|
||||
newTicket: "New",
|
||||
},
|
||||
},
|
||||
ticketsQueueSelect: {
|
||||
placeholder: "Queues",
|
||||
},
|
||||
tickets: {
|
||||
toasts: {
|
||||
deleted: "The ticket you were on has been deleted.",
|
||||
@@ -274,6 +282,9 @@ const messages = {
|
||||
"Are you sure? It cannot be reverted! Tickets in this queue will still exist, but will not have any queues assigned.",
|
||||
},
|
||||
},
|
||||
queueSelect: {
|
||||
inputLabel: "Queues",
|
||||
},
|
||||
users: {
|
||||
title: "Users",
|
||||
table: {
|
||||
|
||||
@@ -193,6 +193,14 @@ const messages = {
|
||||
chat: {
|
||||
noTicketMessage: "Selecciona un ticket para empezar a chatear.",
|
||||
},
|
||||
ticketsManager: {
|
||||
buttons: {
|
||||
newTicket: "Nuevo",
|
||||
},
|
||||
},
|
||||
ticketsQueueSelect: {
|
||||
placeholder: "Linhas",
|
||||
},
|
||||
tickets: {
|
||||
toasts: {
|
||||
deleted: "El ticket en el que estabas ha sido borrado.",
|
||||
@@ -278,6 +286,9 @@ const messages = {
|
||||
"¿Estás seguro? ¡Esta acción no se puede revertir! Los tickets en esa cola seguirán existiendo, pero ya no tendrán ninguna cola asignada.",
|
||||
},
|
||||
},
|
||||
queueSelect: {
|
||||
inputLabel: "Linhas",
|
||||
},
|
||||
users: {
|
||||
title: "Usuarios",
|
||||
table: {
|
||||
@@ -395,6 +406,10 @@ const messages = {
|
||||
ERR_CREATING_TICKET: "Error al crear el ticket en la base de datos.",
|
||||
ERR_FETCH_WAPP_MSG:
|
||||
"Error al obtener el mensaje en WhtasApp, tal vez sea demasiado antiguo.",
|
||||
ERR_QUEUE_COLOR_ALREADY_EXISTS:
|
||||
"Este color ya está en uso, elija otro.",
|
||||
ERR_WAPP_GREETING_REQUIRED:
|
||||
"El mensaje de saludo es obligatorio cuando hay más de una cola.",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -191,6 +191,14 @@ const messages = {
|
||||
chat: {
|
||||
noTicketMessage: "Selecione um ticket para começar a conversar.",
|
||||
},
|
||||
ticketsManager: {
|
||||
buttons: {
|
||||
newTicket: "Novo",
|
||||
},
|
||||
},
|
||||
ticketsQueueSelect: {
|
||||
placeholder: "Filas",
|
||||
},
|
||||
tickets: {
|
||||
toasts: {
|
||||
deleted: "O ticket que você estava foi deletado.",
|
||||
@@ -276,6 +284,9 @@ const messages = {
|
||||
"Você tem certeza? Essa ação não pode ser revertida! Os tickets dessa fila continuarão existindo, mas não terão mais nenhuma fila atribuída.",
|
||||
},
|
||||
},
|
||||
queueSelect: {
|
||||
inputLabel: "Filas",
|
||||
},
|
||||
users: {
|
||||
title: "Usuários",
|
||||
table: {
|
||||
@@ -391,6 +402,10 @@ const messages = {
|
||||
ERR_CREATING_TICKET: "Erro ao criar tíquete no banco de dados.",
|
||||
ERR_FETCH_WAPP_MSG:
|
||||
"Erro ao buscar a mensagem no WhtasApp, talvez ela seja muito antiga.",
|
||||
ERR_QUEUE_COLOR_ALREADY_EXISTS:
|
||||
"Esta cor já está em uso, escolha outra.",
|
||||
ERR_WAPP_GREETING_REQUIRED:
|
||||
"A mensagem de saudação é obrigatório quando há mais de uma fila.",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user