snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.09k stars 3.18k forks source link

Welcome page show incorrect name ( %name%!) #12215

Closed decioesilva closed 1 year ago

decioesilva commented 1 year ago

Debug mode

Describe the bug

After creating a new user the welcome page has an incorrect name label (translations)

Reproduction steps

  1. Create a new user as requester permission only
  2. Login.
  3. The the welcome page has an incorrect name label (translations) ...

Expected behavior

Show name, not %name%!

Screenshots

image

Snipe-IT Version

6

Operating System

Ubuntu

Web Server

Apache

PHP Version

7.4

Operating System

Any

Browser

Any

Version

Any

Device

Any

Operating System

Any

Browser

Any

Version

Any

Error messages

No error code.

Additional context

File -> view-assets.blade.php

quoted codes:

              @extends('layouts/default')

              {{-- Page title --}}
              @section('title')
              {{ trans('general.hello_name', array('name' => $user->present()->fullName())) }}

              @parent
              @stop
snipe commented 1 year ago

We don't use percent symbols anywhere in our code as variable placeholders, so I could not possibly tell you why you're seeing that. Are you sure you're using our version of this and not a modified version?

https://github.com/snipe/snipe-it/blob/97731cd7c812a16a8ccaab5b4ca33d6aed59c3b7/resources/views/account/view-assets.blade.php#L4-L7

snipe commented 1 year ago

(Percent symbols as variable markers tends to be more of a cold fusion/ASP thing, it's not really a thing in PHP)

decioesilva commented 1 year ago

Possibly there is some problem in obtaining the variable before loading the page “/account/view-assets”

Interestingly, I verified that the name variable appears correctly in the loaded table, which is theoretically the same information.

I use the version https://github.com/snipe/snipe-it

@.***

De: snipe @.> Enviada em: quarta-feira, 7 de dezembro de 2022 17:12 Para: snipe/snipe-it @.> Cc: Decio E. Silva @.>; Author @.> Assunto: Re: [snipe/snipe-it] Welcome page show incorrect name ( %name%!) (Issue #12215)

We don't use precent symbols anywhere in our code as variable placeholders, so I could not possibly tell you why you're seeing that. Are you sure you're using our version of this and not a modified version?

https://github.com/snipe/snipe-it/blob/97731cd7c812a16a8ccaab5b4ca33d6aed59c3b7/resources/views/account/view-assets.blade.php#L4-L7

— Reply to this email directly, view it on GitHubhttps://github.com/snipe/snipe-it/issues/12215#issuecomment-1341532827, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMK6INPYDMDRPP5KMIA2GFLWMDVR3ANCNFSM6AAAAAASW3JYZY. You are receiving this because you authored the thread.Message ID: @.**@.>>


ATENÇÃO: Este e-mail foi recebido de um domínio externo. Abra hyperlinks e anexos com cuidado.


"O emitente desta mensagem é responsável por seu conteúdo e endereçamento. Cabe ao destinatário cuidar quanto ao tratamento adequado. Sem a devida autorização, a divulgação, a reprodução, a distribuição ou qualquer outra ação em desconformidade com as leis brasileiras são proibidas e passíveis de sanção disciplinar, cível e criminal."

"The sender of this message is responsible for its content and addressing. The receiver shall take proper care of it. Without due authorization, the publication, reproduction, distribution, or the performance of any other action not conforming with Brazilian law is forbidden and liable to disciplinary, civil or criminal sanctions."

"El emisor de este mensaje es responsable por su contenido y direccionamiento. Cabe al destinatario darle el tratamiento adecuado. Sin la debida autorización, su divulgación, reproducción, distribución o cualquier otra acción no conforme con la legislación brasileña están prohibidas y serán pasibles de sanción disciplinaria, civil y penal."

decioesilva commented 1 year ago

(Percent symbols as variable markers tends to be more of a cold fusion/ASP thing, it's not really a thing in PHP)

I'm using a Azure VM Ubuntu with PHP/Apache

snipe commented 1 year ago

Possibly there is some problem in obtaining the variable before loading the page “/account/view-assets”

If that were true, I'd expect a lot more issues about this. I am unable to reproduce this at all and cannot trigger this behavior on the demo either. Do you see it if you switch languages?

Screenshot 2022-12-08 at 5 00 29 PM
snipe commented 1 year ago

I found it - whoever did the pt-BR translation substituted :name for %name% and I hadn't noticed while approving the translations. I'll have a fix for you shortly.

snipe commented 1 year ago

If you pull from master, you should be all set. Sorry for that mess-up. While my Portuguese isn't bad, we have a lot of strings. I think whoever translated that one thought they had to convert :name into something else.

decioesilva commented 1 year ago

Great! Congrats!