From f3ffc290540f7df89af686ed0c42cbd8c45b0324 Mon Sep 17 00:00:00 2001 From: Andre Andrade Date: Tue, 29 Sep 2026 10:07:08 -0300 Subject: [PATCH] Add Brazilian Portuguese translations and GLPI 11 compatibility --- locales/pt_BR.mo | Bin 0 -> 7180 bytes locales/pt_BR.po | 313 ++++++++++++++++++ .../js/modules/ReservationQuestionWidget.js | 2 +- setup.php | 1 + src/Model/TicketReservationRequest.php | 2 - templates/reservation_question.html.twig | 1 + 6 files changed, 316 insertions(+), 3 deletions(-) create mode 100644 locales/pt_BR.mo create mode 100644 locales/pt_BR.po diff --git a/locales/pt_BR.mo b/locales/pt_BR.mo new file mode 100644 index 0000000000000000000000000000000000000000..134b8f508afd6943a1bcb4d34bdf7dd4625c55c4 GIT binary patch literal 7180 zcmbuDU5p)79l#HuD2t+e2!bHTwT063UX~V3SrpxNx1rc}*X_1_fQaYLoZTImJ99f9 zcUv*?pfN%qKKMm6Q7SQ{Ar%dZiZ7D;WJF&?6JsPuh)+J4$P*aj?|plC@?q27 z-^`iw@jw5s^FMvzl6QPd@#h%-uIAtK=gQmY&qME2>H=OLh7<5R@ZIo-@FMsG{3v_| zUIt%)+u*<9ZSd;zm1@B|;T7-!criQ$uZ2&+HvA)e7d)3AnSa9bQg|WnS3~})ZTwsU zr=ZNY7s~iM;RoS^P~>m%~*k^V|<*zmGs! z|1o$ad=kq1zlD?V1^6L&4oVWau7Q`rDgQnTxA1-p-VDD8-v@sRHGCF|9$tbX*SRc; z$m#<4UU)GSIj-eL*4Yka{5~lAISNIdFF;x6>rnRbGx#a^JGcX0$R@VI-B9`)DD(HB z*zqe+_V*2VJv;*$s{RBqrFs#{zWxDkfUm;saLap?nuYW5Gw_>mFMJWs$#)hJKez{q zT&Lkj;BVj^@FghrYaxWJcNb)+T7e&c1$;kz5Q=`k=lNs!HQt|vBKI9AMdlCT#5qdc z2SwhmGFZlcmmgHDo`B*vKZjHB_fYiuUnusu3g?`M^KcLR0o3p%$du|lgb+Pn3O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^ zI*yW6(`b`|Dxm?@3?4UOs`jCsG9H}DqSVDg)hxxCFMbD)4<1YL(Yh)g8!((FS4(Ng z4E!yk9>0~B3{LfJxeVCU)+K2Uaq0+Mjj4N>(zStEVYZNf%DAvgq?nWoYHQC!5JxkMx6$a>cKN{5j8uW zRXsCOYMYE&TZkpAT3enDRfn3_1f~?5yLy|QIUQHQ=7`*qC&GyRC6N^3n8LR85-V6jw(qoPsl>%Vc#qWJ#o#I2%pI{+ zC2qtg>P1b*L?==;Q$%dbd68&ss4<>n4i+l865S;^I>gqJ`3h4N{PZXWr*WDjt?Qax zTdBT9s9g6t0}y}lD`yER$cDoj{SNv_VkdpHmd50T!uW7TvDx5sU8z$Ib;lbHQk(a& z8Yh^q(%nEcLvG7LQef&!^s0G*+sv}*rx}+qADmosCA=F3PCHq&Vw@8g?zD|DuI?ad zNsv^vM-?uvFhkW*GB|^~YB@xPHkSImxrNO(NO|p|#HhoYc9ZK}ZbFGkdB{A8sj8N* zLuB|``6%W4woNMj@) zNR=-u5uF5hd(#;Pr={Mn(!H+*nCWb?a;$<31dT*`93xGrn8*K1L31Cl1?U>HjxD9V4DVZ!xxwA>0YKMpf^iVzw0 z@U~HJV@!LaR2}diQj(^dvCehj^*O!1K1fzihq(eLd<)ZZ36Wbv9m{C3S_y*=Psp~K zll&{T8dFzwY2d$5@Z5D_fILYf70X#tR|0QuHZE$zO#EhMbC-(9N!D}_cT8}$aZ!+X z7}f}GgTvsgg0UHgYPDRlq}~{m@D@wA^d4#!ps$& z\n" +"Language-Team: pt_BR\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "This slot is no longer available." +msgstr "Este horário não está mais disponível." + +msgid "Advanced forms" +msgstr "Formulários avançados" + +msgid "Pre-reservation" +msgstr "Pré-reserva" + +msgid "Select a question..." +msgstr "Selecione uma pergunta..." + +msgid "The pre-reservation could not be created: no identifiable requester." +msgstr "A pré-reserva não pôde ser criada: solicitante não identificável." + +msgid "The pre-reservation could not be created: the selected item is not allowed." +msgstr "A pré-reserva não pôde ser criada: o item selecionado não é permitido." + +msgid "No pre-reservation" +msgstr "Nenhuma pré-reserva" + +msgid "Answer from a specific question" +msgstr "Resposta de uma pergunta específica" + +msgid "Answer to last \"Material reservation\" question" +msgstr "Resposta da última pergunta de \"Reserva de Material\"" + +msgid "All valid \"Material reservation\" answers" +msgstr "Todas as respostas válidas de \"Reserva de Material\"" + +msgid "New pre-reservation request" +msgstr "Nova solicitação de pré-reserva" + +msgid "Pre-reservation request approved" +msgstr "Solicitação de pré-reserva aprovada" + +msgid "Pre-reservation request refused" +msgstr "Solicitação de pré-reserva recusada" + +msgid "Reservation slot no longer available" +msgstr "O horário de reserva não está mais disponível" + +msgid "Notification reason" +msgstr "Motivo da notificação" + +msgid "Reservation start date" +msgstr "Data de início da reserva" + +msgid "Reservation end date" +msgstr "Data de término da reserva" + +msgid "Validation comment" +msgstr "Comentário de validação" + +msgid "Ticket title" +msgstr "Título do chamado" + +msgid "Ticket URL" +msgstr "URL do chamado" + +msgid "Advanced" +msgstr "Avançado" + +msgid "Hidden" +msgstr "Oculto" + +msgid "Hidden address question type" +msgstr "Tipo de pergunta oculta" + +msgid "This question type will insert some hidden data into the form." +msgstr "Este tipo de pergunta inserirá alguns dados ocultos no formulário." + +msgid "Hostname" +msgstr "Nome do host" + +msgid "Hostname question type" +msgstr "Tipo de pergunta de Nome do host" + +msgid "This question type will automatically register the user's hostname." +msgstr "Este tipo de pergunta registrará automaticamente o nome do host do usuário." + +msgid "Ip address" +msgstr "Endereço IP" + +msgid "IP address question type" +msgstr "Tipo de pergunta de Endereço IP" + +msgid "This question type will automatically register the user's ip address." +msgstr "Este tipo de pergunta registrará automaticamente o endereço IP do usuário." + +msgid "LDAP select" +msgstr "Seleção LDAP" + +msgid "LDAP select question type" +msgstr "Tipo de pergunta de seleção LDAP" + +msgid "Select some data from a LDAP directory." +msgstr "Selecione alguns dados de um diretório LDAP." + +msgid "Material reservation" +msgstr "Reserva de material" + +msgid "Select an item to reserve" +msgstr "Selecione um item para reservar" + +msgid "Unexpected value" +msgstr "Valor inesperado" + +msgid "Please select an item and both a start and end date." +msgstr "Por favor, selecione um item e uma data de início e de término." + +msgid "The end date must be after the start date." +msgstr "A data de término deve ser após a data de início." + +msgid "The end date must be after the start date" +msgstr "A data de término deve ser após a data de início" + +msgid "Material reservation question type" +msgstr "Tipo de pergunta de Reserva de Material" + +msgid "Allow users to reserve equipment from a form." +msgstr "Permitir que os usuários reservem equipamentos de um formulário." + +msgid "the value is not valid" +msgstr "o valor não é válido" + +msgid "the value is not a number" +msgstr "o valor não é um número" + +msgid "Table" +msgstr "Tabela" + +msgid "Row %1\$s: the column \"%2\$s\" is required." +msgstr "Linha %1\$s: a coluna \"%2\$s\" é obrigatória." + +msgid "Row %1\$s: the column \"%2\$s\" is invalid: %3\$s" +msgstr "Linha %1\$s: a coluna \"%2\$s\" é inválida: %3\$s" + +msgid "Row %1\$s: the column \"%2\$s\" does not match the expected format." +msgstr "Linha %1\$s: a coluna \"%2\$s\" não corresponde ao formato esperado." + +msgid "Table question type" +msgstr "Tipo de pergunta de Tabela" + +msgid "Allow users to fill in tabular data with configurable columns." +msgstr "Permitir que os usuários preencham dados tabulares com colunas configuráveis." + +msgid "Tree Cascade Dropdown" +msgstr "Lista Suspensa em Cascata" + +msgid "Enable tree cascade dropdown question type (recursive dropdown for hierarchical data)" +msgstr "Ativar tipo de pergunta de lista suspensa em cascata" + +msgid "Advanced forms plugin configuration" +msgstr "Configuração do plugin Formulários Avançados" + +msgid "Require technician approval" +msgstr "Exigir aprovação de técnico" + +msgid "Data from LDAP directory" +msgstr "Dados do diretório LDAP" + +msgid "Allowed equipment types" +msgstr "Tipos de equipamentos permitidos" + +msgid "All reservable types" +msgstr "Todos os tipos reserváveis" + +msgid "Whether a technician must approve the reservation before it is confirmed is configured on the destination that uses this question, under" +msgstr "Se um técnico deve aprovar a reserva antes que ela seja confirmada é configurado no destino que usa esta pergunta, sob" + +msgid "Define columns below" +msgstr "Defina as colunas abaixo" + +msgid "Configure table columns" +msgstr "Configurar colunas da tabela" + +msgid "Columns" +msgstr "Colunas" + +msgid "Column name" +msgstr "Nome da coluna" + +msgid "Select a type" +msgstr "Selecione um tipo" + +msgid "Required column" +msgstr "Coluna obrigatória" + +msgid "Remove column" +msgstr "Remover coluna" + +msgid "Validation pattern" +msgstr "Padrão de validação" + +msgid "Add column" +msgstr "Adicionar coluna" + +msgid "Start date" +msgstr "Data de início" + +msgid "End date" +msgstr "Data de término" + +msgid "Please fill in all required columns." +msgstr "Por favor, preencha todas as colunas obrigatórias." + +msgid "This value does not match the expected format." +msgstr "Este valor não corresponde ao formato esperado." + +msgid "Select a value" +msgstr "Selecione um valor" + +msgid "Remove row" +msgstr "Remover linha" + +msgid "Add a row" +msgstr "Adicionar uma linha" + +msgid "Pending validation" +msgstr "Aguardando validação" + +msgid "Approved" +msgstr "Aprovado" + +msgid "Refused" +msgstr "Recusado" + +msgid "Canceled" +msgstr "Cancelado" + +msgid "Reservation confirmed automatically" +msgstr "Reserva confirmada automaticamente" + +msgid "This slot is no longer available. Please submit a new reservation request." +msgstr "Este horário não está mais disponível. Por favor, envie uma nova solicitação de reserva." + +msgid "Comment (optional)" +msgstr "Comentário (opcional)" + +msgid "Approve" +msgstr "Aprovar" + +msgid "Refuse" +msgstr "Recusar" + +msgid "This slot is no longer available." +msgstr "Este horário não está mais disponível." + +msgid "Pre-reservation" +msgstr "Pré-reserva" + +msgid "The pre-reservation could not be created: no identifiable requester." +msgstr "Não foi possível criar a pré-reserva: não foi possível identificar o solicitante." + +msgid "The pre-reservation could not be created: the selected item is not allowed." +msgstr "Não foi possível criar a pré-reserva: o item selecionado não é permitido." + +msgid "No pre-reservation" +msgstr "Sem pré-reserva" + +msgid "Answer from a specific question" +msgstr "Resposta de uma pergunta específica" + +msgid "Answer to last \"Material reservation\" question" +msgstr "Resposta à última pergunta de \"Reserva de material\"" + +msgid "All valid \"Material reservation\" answers" +msgstr "Todas as respostas válidas de \"Reserva de material\"" + +msgid "New pre-reservation request" +msgstr "Nova solicitação de pré-reserva" + +msgid "Pre-reservation request approved" +msgstr "Solicitação de pré-reserva aprovada" + +msgid "Pre-reservation request refused" +msgstr "Solicitação de pré-reserva recusada" + +msgid "Reservation slot no longer available" +msgstr "O horário da reserva não está mais disponível" + +msgid "Could not check availability, please try again" +msgstr "Não foi possível verificar a disponibilidade. Tente novamente" + +msgid "Existing reservations for this item" +msgstr "Reservas existentes para este item" + +msgid "This slot is available" +msgstr "Este horário está disponível" + +msgid "An error occurred" +msgstr "Ocorreu um erro" + +msgid "Row %1$s: the column \"%2$s\" is required." +msgstr "Linha %1$s: a coluna \"%2$s\" é obrigatória." + +msgid "Row %1$s: the column \"%2$s\" is invalid: %3$s" +msgstr "Linha %1$s: a coluna \"%2$s\" é inválida: %3$s" + +msgid "Row %1$s: the column \"%2$s\" does not match the expected format." +msgstr "Linha %1$s: a coluna \"%2$s\" não corresponde ao formato esperado." diff --git a/public/js/modules/ReservationQuestionWidget.js b/public/js/modules/ReservationQuestionWidget.js index 8ff5e92..e6ad8e0 100644 --- a/public/js/modules/ReservationQuestionWidget.js +++ b/public/js/modules/ReservationQuestionWidget.js @@ -74,7 +74,7 @@ export class ReservationQuestionWidget { $select.select2({ width: '100%', allowClear: true, - placeholder: __('Select an item to reserve', 'advancedforms'), + placeholder: this.#root.dataset.itemPlaceholder || __('Select an item to reserve', 'advancedforms'), ajax: { url: `${this.#endpoint_url}/ReservableItems`, type: 'POST', diff --git a/setup.php b/setup.php index 8e4bb84..84ea9a2 100644 --- a/setup.php +++ b/setup.php @@ -64,6 +64,7 @@ function plugin_init_advancedforms(): void ImportMapGenerator::getInstance()->registerModulesPath('advancedforms', '/public/js/modules'); + \GlpiPlugin\Advancedforms\Model\TicketReservationRequest::$rightname = 'ticket'; InitManager::getInstance()->init(); } diff --git a/src/Model/TicketReservationRequest.php b/src/Model/TicketReservationRequest.php index 462f600..01e9461 100644 --- a/src/Model/TicketReservationRequest.php +++ b/src/Model/TicketReservationRequest.php @@ -51,8 +51,6 @@ final class TicketReservationRequest extends CommonDBChild public static $items_id = 'tickets_id'; - public static $rightname = 'ticket'; - public const STATUS_WAITING = 1; public const STATUS_ACCEPTED = 2; diff --git a/templates/reservation_question.html.twig b/templates/reservation_question.html.twig index d322e64..bdac3c5 100644 --- a/templates/reservation_question.html.twig +++ b/templates/reservation_question.html.twig @@ -35,6 +35,7 @@ data-reservation-question-widget data-input-name="{{ input_name }}" data-allowed-itemtypes="{{ allowed_itemtypes|json_encode }}" + data-item-placeholder="{{ __('Select an item to reserve', 'advancedforms')|e('html_attr') }}" >