grover66 / kidtimer

Script to manage computer usage by time and schedule.
18 stars 23 forks source link

Customize alert text #5

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hello, first of all I want to say that kidtimer works like charme on my kids Ubuntu 13.04 and 13.10. I was using timekpr in the past but since the developer stopped the development and incompatibility issues with latest Ubuntu versions, i was looking for a new solution, and your script works just great. My question is about customizing the logout alert text (I would like to translate it into German and Spanish). Could I just manually change the text without breaking the functionality? Please let me know your recommendations...

grover66 commented 10 years ago

Sure! You should modify the following files in /usr/local/kidtimer; send1.sh send2.sh send3.sh send4.sh send5.sh logout.sh

Just in case you are new to Linux, here is a command you can use to edit the files; sudo nano /usr/local/kidtimer/send1.sh, then use ctrl-x to save changes.

Make sure not to put any special characters in without using a "\" before it.

When I wrote this software, after trying to use timekpr, I never thought I would hear from people around the world. It is so amazing. Anyway... This motivates me to include a language option in the script. I will try to work on it over the remaining break I have till the new year.

Cheers and Happy New Year!!!

Mike Groves

Sent from my iPad

On Dec 29, 2013, at 5:35 AM, speedygonzalez1103 notifications@github.com wrote:

Hello, first of all I want to say that kidtimer works like charme on my kids Ubuntu 13.04 and 13.10. I was using timekpr in the past but since the developer stopped the development and incompatibility issues with latest Ubuntu versions, i was looking for a new solution, and your script works just great. My question is about customizing the logout alert text (I would like to translate it into German and Spanish). Could I just manually change the text without breaking the functionality? Please let me know your recommendations...

— Reply to this email directly or view it on GitHub.

ghost commented 10 years ago

Great, thanks. I am familiar with Linux, just want to ensure I change the right files. Multi language support by adding another setting in the user file would be optimal, of course, but likely somewhat complex to implement. At least a simple text file with the alert text template would be great, so you can just change the text there and it will be used in all associated scripts. But it is up to you, of course. Keep the good work going on, Mike.

Have a great start in 2014.

Guido

ghost commented 10 years ago

BTW, just found a typo. All send*.sh files contain "Name=$1" in line 2 except in send2.sh, which just contain "Name=" without the variable $1. I assume it should be the same as in the other script files.

grover66 commented 10 years ago

Thanks for your kind words and finding the typo.

Cheers!

Sent from my iPad

On Dec 29, 2013, at 7:30 AM, speedygonzalez1103 notifications@github.com wrote:

BTW, just found a typo. All send*.sh files contain "Name=$1" in line 2 except in send2.sh, which just contain "Name=" without the variable $1. I assume it should be the same as in the other script files.

— Reply to this email directly or view it on GitHub.

grover66 commented 10 years ago

Hey Speedy,

I spent some time this evening updating the script (kidtimer_2.2.deb) to handle additional languages, based on your system's locale settings. It is now setup to handle English, German & Spanish, per your request :) It will default to English if locale not found. I used Google Translate to get the German and Spanish wording. Let me know if it reads wrong or makes no sense.

Please update the software and let me know if it works.

Thanks again for your assistance,

Mike :)

PS. I included it as an attachment too.

On Sun, Dec 29, 2013 at 7:30 AM, speedygonzalez1103 < notifications@github.com> wrote:

BTW, just found a typo. All send*.sh files contain "Name=$1" in line 2 except in send2.sh, which just contain "Name=" without the variable $1. I assume it should be the same as in the other script files.

— Reply to this email directly or view it on GitHubhttps://github.com/grover66/kidtimer/issues/5#issuecomment-31316186 .

ghost commented 10 years ago

Hello Mike, thanks for the update. I installed v2.2 and did some testings. The timer still works, so the user will be logged out when time expires, but the alerts are not sent. I re-installed v2.1 and alerts are working well with it. I am not very good in debugging scripts, but I saw that in v2.2, the send*.sh files don't use the variable "$Name" anymore at the end of the display command. It appears that the alerts are not being sent to the users session, but I am not the expert, it is just my assumption.

Secondly, I would slightly change the translation in German and Spanish:

German: Deine Zeit am Computer endet in 1 Minute. Deine Zeit am Computer endet in 2 Minuten. Deine Zeit am Computer endet in 3 Minuten. Deine Zeit am Computer endet in 4 Minuten. Deine Zeit am Computer endet in 5 Minuten.

Spanish: Tu tiempo en el ordenador se termina en 1 minuto. Tu tiempo en el ordenador se termina en 2 minutos. Tu tiempo en el ordenador se termina en 3 minutos. Tu tiempo en el ordenador se termina en 4 minutos. Tu tiempo en el ordenador se termina en 5 minutos.

Best regards,

Guido

grover66 commented 10 years ago

Thanks,

Will work on it tonight.

Mike :)

Sent from my iPad

On Dec 30, 2013, at 4:51 AM, speedygonzalez1103 notifications@github.com wrote:

Hello Mike, thanks for the update. I installed v2.2 and did some testings. The timer still works, so the user will be logged out when time expires, but the alerts are not sent. I re-installed v2.1 and alerts are working well with it. I am not very good in debugging scripts, but I saw that in v2.2, the send*.sh files don't use the variable "$Name" anymore at the end of the display command. It appears that the alerts are not being sent to the users session, but I am not the expert, it is just my assumption.

Secondly, I would slightly change the translation in German and Spanish:

German: Deine Zeit am Computer endet in 1 Minute. Deine Zeit am Computer endet in 2 Minuten. Deine Zeit am Computer endet in 3 Minuten. Deine Zeit am Computer endet in 4 Minuten. Deine Zeit am Computer endet in 5 Minuten.

Spanish: Tu tiempo en el ordenador se termina en 1 minuto. Tu tiempo en el ordenador se termina en 2 minutos. Tu tiempo en el ordenador se termina en 3 minutos. Tu tiempo en el ordenador se termina en 4 minutos. Tu tiempo en el ordenador se termina en 5 minutos.

Best regards,

Guido

— Reply to this email directly or view it on GitHub.

grover66 commented 10 years ago

Hello again...

New version should fix the notification issue you were having;

Please let me know if you run into anymore issues.

Thanks again for the help,

Mike :)

On Mon, Dec 30, 2013 at 4:51 AM, speedygonzalez1103 < notifications@github.com> wrote:

Hello Mike, thanks for the update. I installed v2.2 and did some testings. The timer still works, so the user will be logged out when time expires, but the alerts are not sent. I re-installed v2.1 and alerts are working well with it. I am not very good in debugging scripts, but I saw that in v2.2, the send*.sh files don't use the variable "$Name" anymore at the end of the display command. It appears that the alerts are not being sent to the users session, but I am not the expert, it is just my assumption.

Secondly, I would slightly change the translation in German and Spanish:

German: Deine Zeit am Computer endet in 1 Minute. Deine Zeit am Computer endet in 2 Minuten. Deine Zeit am Computer endet in 3 Minuten. Deine Zeit am Computer endet in 4 Minuten. Deine Zeit am Computer endet in 5 Minuten.

Spanish: Tu tiempo en el ordenador se termina en 1 minuto. Tu tiempo en el ordenador se termina en 2 minutos. Tu tiempo en el ordenador se termina en 3 minutos. Tu tiempo en el ordenador se termina en 4 minutos. Tu tiempo en el ordenador se termina en 5 minutos.

Best regards,

Guido

— Reply to this email directly or view it on GitHubhttps://github.com/grover66/kidtimer/issues/5#issuecomment-31339198 .

ghost commented 10 years ago

Hello Mike, thanks for the update, which works well.

I wish you and your family all the best and a good start in 2014.

-Guido