Skip to content

Commit

Permalink
logger: Better message structure in langs
Browse files Browse the repository at this point in the history
  • Loading branch information
flamewave000 committed Jan 4, 2022
1 parent 2c7a7c6 commit 0570e27
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 143 deletions.
1 change: 1 addition & 0 deletions df-logger/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# DF User Logger

## Release 1.6.6 (2022-01-04)
- **NEW::** Better default message management for any number of localized messages.
- **FIX #281:** Sounds folder was missing for previous release.

## Release 1.6.5 (2022-01-02)
Expand Down
86 changes: 43 additions & 43 deletions df-logger/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,48 +43,48 @@
"Save": "Save Messages"
}
},
"LoginMsg": {
"0": "{{username}} just joined the server - glhf!",
"1": "{{username}} just joined. Everyone, look busy!",
"2": "{{username}} just joined. Can I get a heal?",
"3": "{{username}} joined your party.",
"4": "{{username}} joined. You must construct additional pylons.",
"5": "Ermagherd. {{username}} is here.",
"6": "Welcome, {{username}}. Stay awhile and listen.",
"7": "Welcome, {{username}}. ( ͡° ͜ʖ ͡°) We were expecting you",
"8": "Welcome, {{username}}. We hope you brought pizza.",
"9": "Welcome {{username}}. Leave your weapons by the door.",
"10": "A wild {{username}} appeared.",
"11": "Swoooosh. {{username}} just landed.",
"12": "Brace yourselves. {{username}} just joined the server.",
"13": "{{username}} just joined. Hide your bananas.",
"14": "{{username}} just arrived. Seems OP - please nerf.",
"15": "{{username}} just slid into the server.",
"16": "A {{username}} has spawned in the server.",
"17": "Big {{username}} showed up!",
"18": "Where's {{username}}? In the server!",
"19": "{{username}} hopped into the server. Kangaroo!!",
"20": "{{username}} just showed up. Hold my beer.",
"21": "Challenger approaching - {{username}} has appeared!",
"22": "It's a bird! It's a plane! Nevermind, it's just {{username}}.",
"23": "It's {{username}}! Praise the sun!\n\\\\[T]/",
"24": "Never gonna give {{username}} up. Never gonna let {{username}} down.",
"25": "Ha! {{username}} has joined! You activated my trap card!",
"26": "Cheers, love! {{username}}'s here!",
"27": "Hey! Listen! {{username}} has joined!",
"28": "We've been expecting you {{username}}",
"29": "It's dangerous to go alone, take {{username}}!",
"30": "{{username}} has joined the server! It's super effective!",
"31": "Cheers, love! {{username}} is here!",
"32": "{{username}} is here, as the prophecy foretold.",
"33": "{{username}} has arrived. Party's over.",
"34": "Ready player {{username}}",
"35": "{{username}} is here to kick butt and chew bubblegum. And {{username}} is all out of gum.",
"36": "Hello. Is it {{username}} you're looking for?",
"37": "Roses are red, violets are blue, {{username}} joined this server with you"
},
"LogoutMsg": {
"0": "{{username}} has left the building!"
}
"LoginMsg": [
"{{username}} just joined the server - glhf!",
"{{username}} just joined. Everyone, look busy!",
"{{username}} just joined. Can I get a heal?",
"{{username}} joined your party.",
"{{username}} joined. You must construct additional pylons.",
"Ermagherd. {{username}} is here.",
"Welcome, {{username}}. Stay awhile and listen.",
"Welcome, {{username}}. ( ͡° ͜ʖ ͡°) We were expecting you",
"Welcome, {{username}}. We hope you brought pizza.",
"Welcome {{username}}. Leave your weapons by the door.",
"A wild {{username}} appeared.",
"Swoooosh. {{username}} just landed.",
"Brace yourselves. {{username}} just joined the server.",
"{{username}} just joined. Hide your bananas.",
"{{username}} just arrived. Seems OP - please nerf.",
"{{username}} just slid into the server.",
"A {{username}} has spawned in the server.",
"Big {{username}} showed up!",
"Where's {{username}}? In the server!",
"{{username}} hopped into the server. Kangaroo!!",
"{{username}} just showed up. Hold my beer.",
"Challenger approaching - {{username}} has appeared!",
"It's a bird! It's a plane! Nevermind, it's just {{username}}.",
"It's {{username}}! Praise the sun!\n\\[T]/",
"Never gonna give {{username}} up. Never gonna let {{username}} down.",
"Ha! {{username}} has joined! You activated my trap card!",
"Cheers, love! {{username}}'s here!",
"Hey! Listen! {{username}} has joined!",
"We've been expecting you {{username}}",
"It's dangerous to go alone, take {{username}}!",
"{{username}} has joined the server! It's super effective!",
"Cheers, love! {{username}} is here!",
"{{username}} is here, as the prophecy foretold.",
"{{username}} has arrived. Party's over.",
"Ready player {{username}}",
"{{username}} is here to kick butt and chew bubblegum. And {{username}} is all out of gum.",
"Hello. Is it {{username}} you're looking for?",
"Roses are red, violets are blue, {{username}} joined this server with you"
],
"LogoutMsg": [
"{{username}} has left the building!"
]
}
}
86 changes: 43 additions & 43 deletions df-logger/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,48 +45,48 @@
"Save": "Guardar mensajes"
}
},
"LoginMsg": {
"0": "{{username}} acaba de unirse al servidor. ¡buenas noches y buena suerte!",
"1": "{{username}} acaba de unirse. ¡haced como que estáis ocupados!",
"2": "{{username}} acaba de unirse. ¿alguien podría curarme?",
"3": "¡Oh, no! {{username}} se une al grupo",
"4": "{{username}} se ha unido. Deberéis encargar otra caja de madera de pino",
"5": "¡Oh, diomío!. {{username}} está aquí.",
"6": "Bienvenido, {{username}}. Calla y escucha",
"7": "Bienvenido, {{username}}. ( ͡° ͜ʖ ͡°) Te estábamos esperando",
"8": "Bienvenido, {{username}}. Esperamos que al menos hayas traido pizzas",
"9": "Bienvenido {{username}}. Deja tus armas en la entrada",
"10": "Ha aparecido un {{username}} salvaje",
"11": "Swoooosh. {{username}} acaba de aterrizar.",
"12": "Preparaos. {{username}} acaba de unirse al servidor.",
"13": "{{username}} acaba de unirse. Esconder los relojes",
"14": "{{username}} acaba de llegar. Parece chetado, que alguien le nerfee",
"15": "{{username}} se desliza ágilmente en el servidor",
"16": "Un {{username}} se ha regenerado en el servidor",
"17": "¡El gran {{username}} ha aparecido!",
"18": "¿Dónde está {{username}}? ¡En el servidor!",
"19": "{{username}} ha saltado al servidor. ¡Como un canguro!",
"20": "{{username}} se deja ver por aquí. Agárrame la cerveza",
"21": "Se acerca el Challenger - ¡{{username}} ha aparecido!",
"22": "¿Es un pájaro? ¿Es un avión? Nah, olvídalo, solo es {{username}}.",
"23": "¡Es {{username}}! ¡Alabado sea el Sol!\n\\\\[T]/",
"24": "Buenas noches, bienvenidos\nHijos del rock and roll\nLos saludan los aliados de {{username}}",
"25": "¡Ja! ¡{{username}} se ha unido! ¡Activaste la trampa!",
"26": "¡Ánimo, cariño! ¡Un {{username}} ha llegado!",
"27": "¡Eh, escucha! ¡{{username}} se ha unido!",
"28": "Te estábamos esperando, {{username}}",
"29": "Es peligroso seguir solos, llevad con vosotros un {{username}}!",
"30": "¡{{username}} se acaba de unir al servidor! ¡Efectividad asegurada!",
"31": "¡Ánimo, cariño! ¡{{username}} está aquí!",
"32": "{{username}} está aquí, se cumple las profecía",
"33": "{{username}} ha llegado. Se acabó la fiesta",
"34": "Jugador preparado: {{username}}",
"35": "{{username}} ha venido a patear culos o a mascar chicle... y ya se le han acabado los chicles",
"36": "Hola. ¿Es este el {{username}} que estábais buscando?",
"37": "Las rosas son rojas, azules las violetas, y a {{username}} le aparece la jeta"
},
"LogoutMsg": {
"0": "¡{{username}} dejó el garito!"
}
"LoginMsg": [
"{{username}} acaba de unirse al servidor. ¡buenas noches y buena suerte!",
"{{username}} acaba de unirse. ¡haced como que estáis ocupados!",
"{{username}} acaba de unirse. ¿alguien podría curarme?",
"¡Oh, no! {{username}} se une al grupo",
"{{username}} se ha unido. Deberéis encargar otra caja de madera de pino",
"¡Oh, diomío!. {{username}} está aquí.",
"Bienvenido, {{username}}. Calla y escucha",
"Bienvenido, {{username}}. ( ͡° ͜ʖ ͡°) Te estábamos esperando",
"Bienvenido, {{username}}. Esperamos que al menos hayas traido pizzas",
"Bienvenido {{username}}. Deja tus armas en la entrada",
"Ha aparecido un {{username}} salvaje",
"Swoooosh. {{username}} acaba de aterrizar.",
"Preparaos. {{username}} acaba de unirse al servidor.",
"{{username}} acaba de unirse. Esconder los relojes",
"{{username}} acaba de llegar. Parece chetado, que alguien le nerfee",
"{{username}} se desliza ágilmente en el servidor",
"Un {{username}} se ha regenerado en el servidor",
"¡El gran {{username}} ha aparecido!",
"¿Dónde está {{username}}? ¡En el servidor!",
"{{username}} ha saltado al servidor. ¡Como un canguro!",
"{{username}} se deja ver por aquí. Agárrame la cerveza",
"Se acerca el Challenger - ¡{{username}} ha aparecido!",
"¿Es un pájaro? ¿Es un avión? Nah, olvídalo, solo es {{username}}.",
"¡Es {{username}}! ¡Alabado sea el Sol!\n\\[T]/",
"Buenas noches, bienvenidos\nHijos del rock and roll\nLos saludan los aliados de {{username}}",
"¡Ja! ¡{{username}} se ha unido! ¡Activaste la trampa!",
"¡Ánimo, cariño! ¡Un {{username}} ha llegado!",
"¡Eh, escucha! ¡{{username}} se ha unido!",
"Te estábamos esperando, {{username}}",
"Es peligroso seguir solos, llevad con vosotros un {{username}}!",
"¡{{username}} se acaba de unir al servidor! ¡Efectividad asegurada!",
"¡Ánimo, cariño! ¡{{username}} está aquí!",
"{{username}} está aquí, se cumple las profecía",
"{{username}} ha llegado. Se acabó la fiesta",
"Jugador preparado: {{username}}",
"{{username}} ha venido a patear culos o a mascar chicle... y ya se le han acabado los chicles",
"Hola. ¿Es este el {{username}} que estábais buscando?",
"Las rosas son rojas, azules las violetas, y a {{username}} le aparece la jeta"
],
"LogoutMsg": [
"¡{{username}} dejó el garito!"
]
}
}
88 changes: 44 additions & 44 deletions df-logger/lang/ja.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Localization Provided By": "Brother Sharp",
"Localization Provided By": "Brother Sharp",
"DF-LOGGER": {
"Settings": {
"ManageMessages": "メッセージ管理",
Expand Down Expand Up @@ -44,48 +44,48 @@
"Save": "保存"
}
},
"LoginMsg": {
"0": "{{username}} just joined the server - glhf!",
"1": "{{username}} just joined. Everyone, look busy!",
"2": "{{username}} just joined. Can I get a heal?",
"3": "{{username}} joined your party.",
"4": "{{username}} joined. You must construct additional pylons.",
"5": "Ermagherd. {{username}} is here.",
"6": "Welcome, {{username}}. Stay awhile and listen.",
"7": "Welcome, {{username}}. ( ͡° ͜ʖ ͡°) We were expecting you",
"8": "Welcome, {{username}}. We hope you brought pizza.",
"9": "Welcome {{username}}. Leave your weapons by the door.",
"10": "A wild {{username}} appeared.",
"11": "Swoooosh. {{username}} just landed.",
"12": "Brace yourselves. {{username}} just joined the server.",
"13": "{{username}} just joined. Hide your bananas.",
"14": "{{username}} just arrived. Seems OP - please nerf.",
"15": "{{username}} just slid into the server.",
"16": "A {{username}} has spawned in the server.",
"17": "Big {{username}} showed up!",
"18": "Where's {{username}}? In the server!",
"19": "{{username}} hopped into the server. Kangaroo!!",
"20": "{{username}} just showed up. Hold my beer.",
"21": "Challenger approaching - {{username}} has appeared!",
"22": "It's a bird! It's a plane! Nevermind, it's just {{username}}.",
"23": "It's {{username}}! Praise the sun!\n\\\\[T]/",
"24": "Never gonna give {{username}} up. Never gonna let {{username}} down.",
"25": "Ha! {{username}} has joined! You activated my trap card!",
"26": "Cheers, love! {{username}}'s here!",
"27": "Hey! Listen! {{username}} has joined!",
"28": "We've been expecting you {{username}}",
"29": "It's dangerous to go alone, take {{username}}!",
"30": "{{username}} has joined the server! It's super effective!",
"31": "Cheers, love! {{username}} is here!",
"32": "{{username}} is here, as the prophecy foretold.",
"33": "{{username}} has arrived. Party's over.",
"34": "Ready player {{username}}",
"35": "{{username}} is here to kick butt and chew bubblegum. And {{username}} is all out of gum.",
"36": "Hello. Is it {{username}} you're looking for?",
"37": "Roses are red, violets are blue, {{username}} joined this server with you"
},
"LogoutMsg": {
"0": "{{username}} has left the building!"
}
"LoginMsg": [
"{{username}} just joined the server - glhf!",
"{{username}} just joined. Everyone, look busy!",
"{{username}} just joined. Can I get a heal?",
"{{username}} joined your party.",
"{{username}} joined. You must construct additional pylons.",
"Ermagherd. {{username}} is here.",
"Welcome, {{username}}. Stay awhile and listen.",
"Welcome, {{username}}. ( ͡° ͜ʖ ͡°) We were expecting you",
"Welcome, {{username}}. We hope you brought pizza.",
"Welcome {{username}}. Leave your weapons by the door.",
"A wild {{username}} appeared.",
"Swoooosh. {{username}} just landed.",
"Brace yourselves. {{username}} just joined the server.",
"{{username}} just joined. Hide your bananas.",
"{{username}} just arrived. Seems OP - please nerf.",
"{{username}} just slid into the server.",
"A {{username}} has spawned in the server.",
"Big {{username}} showed up!",
"Where's {{username}}? In the server!",
"{{username}} hopped into the server. Kangaroo!!",
"{{username}} just showed up. Hold my beer.",
"Challenger approaching - {{username}} has appeared!",
"It's a bird! It's a plane! Nevermind, it's just {{username}}.",
"It's {{username}}! Praise the sun!\n\\[T]/",
"Never gonna give {{username}} up. Never gonna let {{username}} down.",
"Ha! {{username}} has joined! You activated my trap card!",
"Cheers, love! {{username}}'s here!",
"Hey! Listen! {{username}} has joined!",
"We've been expecting you {{username}}",
"It's dangerous to go alone, take {{username}}!",
"{{username}} has joined the server! It's super effective!",
"Cheers, love! {{username}} is here!",
"{{username}} is here, as the prophecy foretold.",
"{{username}} has arrived. Party's over.",
"Ready player {{username}}",
"{{username}} is here to kick butt and chew bubblegum. And {{username}} is all out of gum.",
"Hello. Is it {{username}} you're looking for?",
"Roses are red, violets are blue, {{username}} joined this server with you"
],
"LogoutMsg": [
"{{username}} has left the building!"
]
}
}
6 changes: 3 additions & 3 deletions df-logger/src/DFLoggerMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class DFLoggerMenu extends FormApplication {
closeOnSubmit: true,
width: 600,
height: 500,
title: 'DF-LOGGER.ManageMenu.Title',
title: 'DF-LOGGER.ManageMenu.Title'.localize(),
tabs: [{ navSelector: ".tabs", contentSelector: "main", initial: "login" }],
template: 'modules/df-logger/templates/message-manage.hbs'
});
Expand Down Expand Up @@ -56,8 +56,8 @@ export default class DFLoggerMenu extends FormApplication {
});
html.find('button[name="reset"]').on('click', async () => {
Dialog.confirm({
title: 'DF-LOGGER.ManageMenu.Confirm.Title',
content: 'DF-LOGGER.ManageMenu.Confirm.Content',
title: 'DF-LOGGER.ManageMenu.Confirm.Title'.localize(),
content: 'DF-LOGGER.ManageMenu.Confirm.Content'.localize(),
defaultYes: false,
yes: async () => {
MessageProcessor.loginMessages = [];
Expand Down
15 changes: 5 additions & 10 deletions df-logger/src/MessageProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,12 @@ export class MessageProcessor {
}

static async initializeMessages() {
for (let c = 0; c < 38; c++) {
this.loginMessages.push({
tog: true,
msg: game.i18n.localize(`DF-LOGGER.LoginMsg.${c}`)
});
const i18n: { LoginMsg: string[], LogoutMsg: string[] } = <any>game.i18n.translations['DF-LOGGER'];
for (const msg of i18n.LoginMsg) {
this.loginMessages.push({ tog: true, msg });
}
for (let c = 0; c < 1; c++) {
this.logoutMessages.push({
tog: true,
msg: game.i18n.localize(`DF-LOGGER.LogoutMsg.${c}`)
});
for (const msg of i18n.LogoutMsg) {
this.logoutMessages.push({ tog: true, msg });
}
}
}

0 comments on commit 0570e27

Please sign in to comment.