Skip to content

Commit a7c68f8

Browse files
committed
Localize disclaimer confirmation phrase
Use the localized disclaimer placeholder as the expected confirmation phrase instead of the hardcoded English string. Updates pt-BR translation to use "Eu Entendo", and changes luatools.js to derive expectedPhrase via t('disclaimer.inputPlaceholder', 'I Understand') (trimmed/lowercased) for input validation and confirmation click, improving localization and consistency while keeping a fallback.
1 parent c67f20b commit a7c68f8

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

backend/locales/pt-BR.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@
181181
"disclaimer.line1": "O LuaTools não é afiliado de forma alguma ao Millennium",
182182
"disclaimer.line2": "O Millennium NÃO oferecerá suporte para este plugin no servidor do Discord deles",
183183
"disclaimer.line3": "Você será BANIDO dos servidores LuaTools e Millennium se buscar ajuda no Discord deles",
184-
"disclaimer.inputLabel": "digite \"I Understand\" na caixa abaixo para continuar",
185-
"disclaimer.inputPlaceholder": "I Understand",
184+
"disclaimer.inputLabel": "digite \"Eu Entendo\" na caixa abaixo para continuar",
185+
"disclaimer.inputPlaceholder": "Eu Entendo",
186186
"DLC Detected": "DLC Detectada",
187187
"DLCs are added together with the base game. To add fixes for this DLC, please go to the base game page: <br><br><b>{gameName}</b>": "DLCs são adicionadas junto com o jogo base. Para adicionar correções para esta DLC, por favor vá para a página do jogo base: <br><br><b>{gameName}</b>",
188188
"Go to Base Game": "Ir para o Jogo Base",

public/luatools.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4438,8 +4438,9 @@
44384438
confirmBtn.style.opacity = '0.5';
44394439
confirmBtn.style.pointerEvents = 'none';
44404440

4441+
var expectedPhrase = t('disclaimer.inputPlaceholder', 'I Understand').trim().toLowerCase();
44414442
input.oninput = function() {
4442-
if (this.value.trim().toLowerCase() === 'i understand') {
4443+
if (this.value.trim().toLowerCase() === expectedPhrase) {
44434444
confirmBtn.style.opacity = '1';
44444445
confirmBtn.style.pointerEvents = 'auto';
44454446
confirmBtn.style.boxShadow = '0 0 15px rgba(102,192,244,0.4)';
@@ -4452,7 +4453,7 @@
44524453

44534454
confirmBtn.onclick = function(e) {
44544455
e.preventDefault();
4455-
if (input.value.trim().toLowerCase() === 'i understand') {
4456+
if (input.value.trim().toLowerCase() === expectedPhrase) {
44564457
localStorage.setItem('luatools millennium disclaimer accepted', '1');
44574458
overlay.remove();
44584459
}

0 commit comments

Comments
 (0)