Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": "Launch Program",
"program": "${workspaceFolder}/weatherClock.py",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${file}"
}
]
}
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 KeepThisTicket - WeatherClock

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Terminal=true

File 2: wClock.sh
With the contents like this (script must be executable sh file):
Or please use the script in the main folder

```
cd /home/plotn/github/weatherClock/
Expand Down
79 changes: 79 additions & 0 deletions Translate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#! /bin/bash

#Get current path
#full_path=$(realpath $0)
#dir_path=$(dirname $full_path)
dir_path=$PWD
echo $dir_path

#Search gettext
pushd ~
dir_gettext=$(find -name "pygettext.py" -type f | head -n 1) #./home/pi/Python-3.10.0/Tools/i18n/pygettext.py
#echo $dir_gettext
dir_gettext="$(dirname "$dir_gettext")" #remove filename
echo $dir_gettext
if [[ 0 != $? ]] || [[ -z $dir_gettext ]] ; then
echo "No gettext library found."
echo "Program Translate ends."
exit 5
fi
#popd #cd $dir_path

# make *.pot file
$dir_gettext/pygettext.py -a -p $dir_path/locales/ $dir_path/weatherClock.py
echo "pot file generated"
sleep 1s

languages=("en_US" "en_GB" "nl_NL" "de_DE")

# make or update foreach pot file a translate po file.
cd $dir_path/locales
for f in *.pot
do
fn="$(basename -s .pot $f)"
echo "Filename is: $f"
for lang in "${languages[@]}"
do
# Generate or upgrade po file
if [[ -f "./$lang/LC_MESSAGES/$fn.po" ]]; then
# it exist, so update po file
pybabel update -i $fn.pot -d $dir_path/locales/ -l $lang
#echo "po file updated" #above command already gives a message
else
# not available, so "generate" po file
if [[ ! -e "./$lang/" ]]; then
# make the directories
mkdir $lang
mkdir $lang/LC_MESSAGES
echo "Language dir: $lang generated"
fi
# copy the pot file as po file in right dir
cp -v "$f" ./$lang/LC_MESSAGES/$fn.po
echo "Made po file"
fi
done
done

# Wait until user has updated the po files.
echo "" #empty line
echo "Change/ update the po files now and when finished continue to generate mo files out of it."
echo "Press any key to continue"
while [ true ] ; do
read -t 3 -n 1
if [[ $? == 0 ]] ; then
break
fi
done

cd ~
#Generate mo files
for lang in "${languages[@]}"
do
# Check po file available
if [[ -f "$dir_path/locales/$lang/LC_MESSAGES/$fn.po" ]]; then
# it exist, so make mo file
"$dir_gettext/msgfmt.py" -o "$dir_path/locales/$lang/LC_MESSAGES/$fn.mo" "$dir_path/locales/$lang/LC_MESSAGES/$fn"
echo "$fn.mo file in language $lang updated"
fi
done
exit
Binary file added locales/de_DE/LC_MESSAGES/messages.mo
Binary file not shown.
196 changes: 196 additions & 0 deletions locales/de_DE/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# German language of WeatherClock.
# Copyright (C) 2021 Eli's weatherClock
# FIRST AUTHOR: Vierlijner/Naglafarn, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-11-09 21:32+0100\n"
"PO-Revision-Date: 2022-11-09 21:49+0100\n"
"Last-Translator: Naglafarn\n"
"Language: de_DE\n"
"Language-Team: German Naglafarn\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: /home/pi/GitHub/weatherClock/weatherClock.py:38
msgid "Starting WeatherClock..."
msgstr "Anfangen WeatherClock..."

#: /home/pi/GitHub/weatherClock/weatherClock.py:44
msgid "Remaining arguments will not be used: {0}"
msgstr "Verbleibende Argumente werden nicht verwendet: {0}"

#: /home/pi/GitHub/weatherClock/weatherClock.py:46
msgid "Options: {0}"
msgstr "Optionen: {0}"

#: /home/pi/GitHub/weatherClock/weatherClock.py:71
msgid "WeatherClock"
msgstr "WeatherClock"

#: /home/pi/GitHub/weatherClock/weatherClock.py:98
#: /home/pi/GitHub/weatherClock/weatherClock.py:187
msgid "must be one of:"
msgstr "muss einer von sein:"

#: /home/pi/GitHub/weatherClock/weatherClock.py:101
#: /home/pi/GitHub/weatherClock/weatherClock.py:103
#: /home/pi/GitHub/weatherClock/weatherClock.py:109
msgid ""
"usage:\n"
"weatherClock.py [-a|--apikey] <YourApiKey> [[-l|--loglevel] "
"[Debug|Info|Warn|Error]|]"
msgstr ""
"Verwendungszweck:\n"
"weatherClock.py [-a|--apikey] <YourApiKey> [[-l|--loglevel] "
"[Debug|Info|Warn|Error]|]"

#: /home/pi/GitHub/weatherClock/weatherClock.py:111
msgid "Missing one or more parameters."
msgstr "Es fehlen ein oder mehrere Parameter."

#: /home/pi/GitHub/weatherClock/weatherClock.py:168
msgid "'settings.json' file not found. Using command line parameters."
msgstr "'settings.json' nicht gefunden. Verwenden von Befehlszeilenparametern."

#: /home/pi/GitHub/weatherClock/weatherClock.py:173
msgid ""
"No ApiKey given. Use ApiKey in settings.json or use parameter: "
"[-a|--apikey]."
msgstr ""
"Kein ApiKey angegeben. Verwenden Sie ApiKey in settings.json oder "
"verwenden Sie parameter: [-a|--apikey]."

#: /home/pi/GitHub/weatherClock/weatherClock.py:185
msgid "Log Level set to invalid value: {0}"
msgstr "Protokollebene auf ungültigen Wert festgelegt: {0}"

#: /home/pi/GitHub/weatherClock/weatherClock.py:194
#: /home/pi/GitHub/weatherClock/weatherClock.py:198
msgid "Language changed to {0}"
msgstr "Sprache in {0} geändert"

#: /home/pi/GitHub/weatherClock/weatherClock.py:216
msgid "Failed to change system language."
msgstr "Systemsprache konnte nicht geändert werden."

#: /home/pi/GitHub/weatherClock/weatherClock.py:217
msgid ".UTF8' is generated on your system"
msgstr ".UTF8' auf Ihrem System generiert wird"

#: /home/pi/GitHub/weatherClock/weatherClock.py:217
msgid "Make sure locale '"
msgstr "Stellen Sie sicher, dass das Gebietsschema"

#: /home/pi/GitHub/weatherClock/weatherClock.py:310
msgid "cursor pressed: x, y"
msgstr "Cursor gedrückt: x, y"

#: /home/pi/GitHub/weatherClock/weatherClock.py:321
msgid "hour {0} WAS TOUCHED !"
msgstr "Stunde {0} wurde berührt!"

#: /home/pi/GitHub/weatherClock/weatherClock.py:334
msgid "Touched hour is {0} hours ahead"
msgstr "Berührte Stunde ist {0} Stunden voraus"

#: /home/pi/GitHub/weatherClock/weatherClock.py:355
msgid "Day"
msgstr "Tag"

#: /home/pi/GitHub/weatherClock/weatherClock.py:367
msgid "Hour"
msgstr "Uhrzeit"

#: /home/pi/GitHub/weatherClock/weatherClock.py:388
msgid "Temp"
msgstr "Temperatur"

#: /home/pi/GitHub/weatherClock/weatherClock.py:396
msgid "Feels like"
msgstr "Gefuehlt"

#: /home/pi/GitHub/weatherClock/weatherClock.py:405
msgid "POP"
msgstr "Regenchance"

#: /home/pi/GitHub/weatherClock/weatherClock.py:413
msgid "Rain"
msgstr "Regenmenge"

#: /home/pi/GitHub/weatherClock/weatherClock.py:424
msgid "Wind"
msgstr "Wind"

#: /home/pi/GitHub/weatherClock/weatherClock.py:462
#: /home/pi/GitHub/weatherClock/weatherClock.py:471
msgid "current hour: "
msgstr "Aktuelle Stunde: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:465
#: /home/pi/GitHub/weatherClock/weatherClock.py:468
#: /home/pi/GitHub/weatherClock/weatherClock.py:473
msgid "forecast hour: "
msgstr "Prognosestunde: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:476
msgid "temperature: "
msgstr "Temperatur: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:478
msgid "feels like: "
msgstr "Gefuehlt: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:480
msgid "wind speed: "
msgstr "Windgeschwindigkeit: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:483
msgid "weather ID: "
msgstr "Wetter-ID: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:485
msgid "POP: "
msgstr "Regenchance: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:489
msgid "no rain data"
msgstr "Keine Regendaten"

#: /home/pi/GitHub/weatherClock/weatherClock.py:492
msgid "Rain: "
msgstr "Regenmenge: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:525
msgid "Invalid weather ID"
msgstr "Ungültige Wetter-ID"

#: /home/pi/GitHub/weatherClock/weatherClock.py:640
msgid ""
"\n"
"... Main Loop Start ...\n"
msgstr ""
"\n"
"... Start der Hauptschleife ...\n"

#: /home/pi/GitHub/weatherClock/weatherClock.py:662
msgid "** FETCHED NEW DATA **"
msgstr "** NEUE DATEN ABGERUFEN **"

#: /home/pi/GitHub/weatherClock/weatherClock.py:726
msgid "MODE: "
msgstr "MODUS: "

#: /home/pi/GitHub/weatherClock/weatherClock.py:731
msgid "screen was touched"
msgstr "Bildschirm wurde berührt"

#: /home/pi/GitHub/weatherClock/weatherClock.py:740
msgid "Exiting WeatherClock."
msgstr "WeatherClock beenden."

Binary file added locales/en_GB/LC_MESSAGES/messages.mo
Binary file not shown.
Loading