Translate variable output - Birthday command

Hi, i have a countdown command for my birthday date, and i want it to be in spanish, this is what i have: $(countdown Nov 14 2020 00:01:00 AM EST). First of all, i don’t know how to change the timezone, i live in Argentina. Second, i know that its possible to translate the responses to spanish, i saw it in another command before but i can’t find it. I appreciate the help.

This is how someone translated the command, how can i integrate this to my countdown command?

Hey @Jota!

To change the timezone, you have the full list in the documentation:

Now for the translation, it’s simple:

!addcom !cumpleaños $(eval d=`$(countdown 11 14 2020 00:00:00 AM America/Argentina/Buenos_Aires)`; d.replace(`years`,`años`).replace(`year`,`año`).replace(`months`,`meses`).replace(`month`,`mes`).replace(`days`,`dias`).replace(`day`,`día`).replace(`hours`,`horas`).replace(`hour`,`hora`).replace(`minutes`,`minutos`).replace(`minute`,`minuto`).replace(`seconds`,`segundos`).replace(`second`,`segunda`);)

For a more advanced command, if you want to never have to update the year, here’s what to do:

!addcom !cumpleaños -a=_cumpleaños $(eval y=$(time America/Argentina/Buenos_Aires "YYYY"); t=$(time America/Argentina/Buenos_Aires "MMDD"); if(t<1114){y}else if(t==1114){`hoy`}else{y+1})

!addcom _cumpleaños $(eval d=`$(countdown 11 14 $(query) 00:00:00 AM America/Argentina/Buenos_Aires)`; `$(query)`==`hoy`?`¡Hoy es mi cumpleaños!`:`Mi cumpleaños es en ${d.replace(`year`,`año`).replace(`months`,`meses`).replace(`month`,`mes`).replace(`days`,`dias`).replace(`day`,`día`).replace(`hours`,`horas`).replace(`hour`,`hora`).replace(`minutes`,`minutos`).replace(`minute`,`minuto`).replace(`seconds`,`segundos`).replace(`second`,`segunda`)}`;)

i just saw this, thanks a lot emily, i appreciate your time

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.