pl translation

This commit is contained in:
2026-03-18 02:49:13 +01:00
parent d73ec4f803
commit ad0b8728f8
3 changed files with 160 additions and 62 deletions

View File

@@ -10,15 +10,96 @@ source <(grep = $CFG_FILE)
sleep .1 sleep .1
#notify-send.sh aaa "${0} ${1} ${me}" #notify-send.sh aaa "${0} ${1} ${me}"
# LANG # LANG
#case "$LANG" in case "$LANG" in
# pl*):;; pl*)
# es*):;; _TODOLIST="Lista zadań"
# *):;; _ADD_NEWTASK="Dodaj <b>nowe</b> zadanie..."
#esac _TASK="zadanie"
_DEPRIORITIZE="Usuń priorytet"
_PRIA="priorytet <b>(A)</b>"
_PRIB="priorytet <b>(B)</b>"
_PRIC="priorytet <b>(C)</b>"
_MARK_DONE="Oznacz jako zrobione"
_EDIT="Edytuj"
_MOVE_TO="Przenieś do..."
_MOVE_TASK_TO="Przenieś zadanie do..."
_DEL_TASK="Usuń zadanie"
_ARCHIVE="Archiwizuj (usuń wszystkie wykonane zadania)"
_NOTES_FOR="<b>Notatki</b> dla"
_SWITCHTO="Przełącz do listy zadań"
_TASKS="zadania"
_NEW_TODOLIST="Utwórz <b>nową Listę zadań</b>..."
_IN_TEXTEDITOR="w edytorze tekstu"
_ADD_NOTES="Dodaj notatki (cherrytree) do"
_NEED_NOTES="Potrzebujesz notatek do listy zadań? Zainstaluj Cherrytree"
_ADD_MENU="Dodaj własne menu do"
_EDIT_MENU="Edytuj własne menu do"
_DELETE_MENU="Usuń własne menu do"
_DANGERZONE="Niebezpieczna strefa"
_DELETE="Usuń"
_LIST_AND_ALL=" i powiązane pliki"
_AREYOU_SURE="Czy aby na pewno?"
_YES_DELETE="Tak, usuń"
_CONKY_SETTINGS_LONG="Ustawienia Widżetu Conky"
_CONKY_SETTINGS="Ustawienia widżetu Conky"
_CLEAR_FILTER="Wyczyśc filtr"
_FILTERBY="Filtruj"
_SH_CONKY="Pokaż/ukryj elementy w Conky"
_SH_DONE="Pokaż zakończone zadania"
_SH_PRIO="(A-C) priorytety"
_SH_PROJ="+projekt"
_SH_CONTEXT="@kontekst"
_START_CONKY="Uruchom widżet Conky TODOList"
_COMMANDS_FOR="Komendy dla"
;;
*)
_TODOLIST="TODO List"
_ADD_NEWTASK="Add <b>new</b> task..."
_TASK="task"
_DEPRIORITIZE="Deprioritize"
_PRIA="<b>(A)</b> priority"
_PRIB="<b>(B)</b> priority"
_PRIC="<b>(C)</b> priority"
_MARK_DONE="Mark as done"
_EDIT="Edit"
_MOVE_TO="Move to..."
_MOVE_TASK_TO="Move task to..."
_DEL_TASK="Delete task"
_ARCHIVE="Archive (remove all done tasks)"
_NOTES_FOR="<b>Notes</b> for"
_SWITCHTO="Switch to todolist"
_TASKS="tasks"
_NEW_TODOLIST="Create <b>New TODO List</b>..."
_IN_TEXTEDITOR="in Text editor"
_ADD_NOTES="Add hierarchical notes (cherrytree) to"
_NEED_NOTES="Need notes for todolist? Install Cherrytree"
_ADD_MENU="Add custom menu for"
_EDIT_MENU="Edit custom menu for"
_DELETE_MENU="Delete custom menu for"
_DANGERZONE="Danger Zone"
_DELETE="Delete"
_LIST_AND_ALL="and all related files"
_AREYOU_SURE="Are you sure?"
_YES_DELETE="Yes, delete"
_CONKY_SETTINGS_LONG="Conky display settings/filter"
_CONKY_SETTINGS="Conky widget settings"
_CLEAR_FILTER="Clear filter"
_FILTERBY="Filter by"
_SH_CONKY="Show/hide some elements in Conky"
_SH_DONE="Show done tasks"
_SH_PRIO="(A-C) priority"
_SH_PROJ="+project"
_SH_CONTEXT="@context"
_START_CONKY="Start TODOList conky widget"
_COMMANDS_FOR="Custom commands for"
;;
esac
#MENU #MENU
prettyname=${filename//_/ } prettyname=${filename//_/ }
out+=("^sep(TODO list: <b>${prettyname}</b>)") out+=("^sep($_TODOLIST: <b>${prettyname}</b>)")
out+=("<big></big> Add <b>new</b> task...,mabox-todo.sh addtask && ${0} center") out+=("<big></big> $_ADD_NEWTASK,mabox-todo.sh addtask && ${0} center")
out+=("^sep()") out+=("^sep()")
@@ -61,28 +142,28 @@ iks=${iks%%<*} # i reszty
[[ "${dirty}" == "1" ]] && out+=("^sep(done tasks)") [[ "${dirty}" == "1" ]] && out+=("^sep(done tasks)")
out+=("\"\"\"${line}\"\"\",^checkout(${i})") out+=("\"\"\"${line}\"\"\",^checkout(${i})")
out2+=("^tag(${i})") out2+=("^tag(${i})")
out2+=("^sep(TODO: <b>${prettyname}</b>)") out2+=("^sep($_TODOLIST: <b>${prettyname}</b>)")
out2+=("^sep(Task: ${number})") out2+=("^sep($_TASK: ${number})")
#out2+=("    <small>back to list</small>,^back()") #out2+=("    <small>back to list</small>,^back()")
out2+=("^sep()") out2+=("^sep()")
out2+=("\"\"\"${line}\"\"\",geany -l ${number:-1} ${TODO_DIR}/${filename}.txt") out2+=("\"\"\"${line}\"\"\",geany -l ${number:-1} ${TODO_DIR}/${filename}.txt")
out2+=("^sep()") out2+=("^sep()")
if [ "$dirty" = "0" ];then if [ "$dirty" = "0" ];then
if [ -z "${line##*$pri*}" ]; then if [ -z "${line##*$pri*}" ]; then
out2+=(" Deprioritize,mabox-todo.sh dp ${number};${0} center") out2+=(" $_DEPRIORITIZE,mabox-todo.sh dp ${number};${0} center")
fi fi
out2+=(" <b>(A)</b> priority,mabox-todo.sh p ${number} A;${0} center") out2+=(" $_PRIA,mabox-todo.sh p ${number} A;${0} center")
out2+=(" <b>(B)</b> priority,mabox-todo.sh p ${number} B;${0} center") out2+=(" $_PRIB,mabox-todo.sh p ${number} B;${0} center")
out2+=(" <b>(C)</b> priority,mabox-todo.sh p ${number} C;${0} center") out2+=(" $_PRIC,mabox-todo.sh p ${number} C;${0} center")
out2+=("^sep()") out2+=("^sep()")
out2+=("<big></big> Mark as done,mabox-todo.sh -a -f -n done ${number};${0} center" "^sep()") out2+=("<big></big> $_MARK_DONE,mabox-todo.sh -a -f -n done ${number};${0} center" "^sep()")
fi fi
out2+=("<big></big> Edit task,geany -l ${number:-1} ${TODO_DIR}/${filename}.txt") out2+=("<big></big> $_EDIT $_TASK,geany -l ${number:-1} ${TODO_DIR}/${filename}.txt")
if [ "${#files[@]}" -gt "1" ];then if [ "${#files[@]}" -gt "1" ];then
out2+=("<big>󱉆</big> Move to...,^checkout(file${number})") out2+=("<big>󱉆</big> $_MOVE_TO,^checkout(file${number})")
out3+=("^tag(file${number})") out3+=("^tag(file${number})")
out3+=("^sep(Move task to...)") out3+=("^sep($_MOVE_TASK_TO)")
for file in "${files[@]}" for file in "${files[@]}"
do do
prettyfile=${file//_/ } prettyfile=${file//_/ }
@@ -92,33 +173,33 @@ fi
#out2+=("    <small>back to list</small>,^back()") #out2+=("    <small>back to list</small>,^back()")
out2+=("^sep()") out2+=("^sep()")
out2+=("<big></big> Delete task,mabox-todo.sh -f -n del ${number};${0} center") out2+=("<big></big> $_DEL_TASK,mabox-todo.sh -f -n del ${number};${0} center")
fi fi
done <<< $(mabox-todo.sh -d ~/.config/todo/config-jgmenu ls) done <<< $(mabox-todo.sh -d ~/.config/todo/config-jgmenu ls)
[[ "$dirty" > "0" ]] && out+=("<big>󱝧</big> Archive (remove all done tasks),mabox-todo.sh -f archive; ${0} center" "^sep()") [[ "$dirty" > "0" ]] && out+=("<big>󱝧</big> $_ARCHIVE,mabox-todo.sh -f archive; ${0} center" "^sep()")
out+=("<big></big> TODO List: <b>${prettyname}</b>...,^checkout(files)") out+=("<big></big> $_TODOLIST: <b>${prettyname}</b>...,^checkout(files)")
[[ -f "${TODO_DIR}/${filename}.ctb" ]] && out+=("^sep()" "<big>󱁂</big> <b>Notes</b> for ${prettyname},cherrytree ${TODO_DIR}/${filename}.ctb") [[ -f "${TODO_DIR}/${filename}.ctb" ]] && out+=("^sep()" "<big>󱁂</big> $_NOTES_FOR ${prettyname},cherrytree ${TODO_DIR}/${filename}.ctb")
out2+=("^tag(files)") out2+=("^tag(files)")
if [ "${#files[@]}" -gt "1" ];then if [ "${#files[@]}" -gt "1" ];then
out2+=("^sep(Switch to todolist:)") out2+=("^sep($_SWITCHTO:)")
while read -r line while read -r line
do do
prettyline=${line//_/ } prettyline=${line//_/ }
tasks=$(cat ~/.todo/${line}.txt |wc -l) tasks=$(cat ~/.todo/${line}.txt |wc -l)
if [ "$line" = "${filename}" ];then if [ "$line" = "${filename}" ];then
out2+=("<big>綠</big> ${prettyline} <small><i>(${tasks} tasks)</i></small> ,${0} center") out2+=("<big>綠</big> ${prettyline} <small><i>($_TASKS ${tasks})</i></small> ,${0} center")
else else
out2+=("<big>祿</big> ${prettyline} <small><i>(${tasks} tasks)</i></small> ,mabox-todo.sh s $line;${0} center") out2+=("<big>祿</big> ${prettyline} <small><i>($_TASKS ${tasks})</i></small> ,mabox-todo.sh s $line;${0} center")
fi fi
done <<< $(mabox-todo.sh listfiles) done <<< $(mabox-todo.sh listfiles)
fi fi
out2+=("^sep()") out2+=("^sep()")
out2+=("<b></b> Create <b>New TODO List</b> (file)...,mabox-todo.sh addfile && ${0} center") out2+=("<b></b> $_NEW_TODOLIST,mabox-todo.sh addfile && ${0} center")
out2+=("^sep(TODO List: ${prettyname})") out2+=("^sep($_TODOLIST: ${prettyname})")
out2+=("<big></big> Edit <b>${prettyname}</b>.txt in Text editor,xdg-open ${TODO_DIR}/${filename}.txt") out2+=("<big></big> $_EDIT <b>${prettyname}</b>.txt $_IN_TEXTEDITOR,xdg-open ${TODO_DIR}/${filename}.txt")
### Cherrytree ### Cherrytree
@@ -128,39 +209,39 @@ then
: :
#out2+=("Edit notes,cherrytree ${TODO_DIR}/${filename}.ctb") #out2+=("Edit notes,cherrytree ${TODO_DIR}/${filename}.ctb")
else else
out2+=("<big></big> Add hierarchical notes to <b>${prettyname}</b> todolist (Cherrytree),mabox-todo.sh addnotes ${filename};${0}") out2+=("<big></big> $_ADD_NOTES <b>${prettyname}</b>,mabox-todo.sh addnotes ${filename};${0}")
fi fi
else else
out2+=("<big>󱁂</big> Need notes for todolist? Install Cherrytree,pamac-installer cherrytree") out2+=("<big>󱁂</big> $_NEED_NOTES,pamac-installer cherrytree")
fi fi
## Custom Menu ## Custom Menu
if [[ -f "${TODO_DIR}/${filename}.csv" ]];then if [[ -f "${TODO_DIR}/${filename}.csv" ]];then
out2+=("Edit <b>${prettyname}</b> todolist custom menu,xdg-open ${TODO_DIR}/${filename}.csv") out2+=("$_EDIT_MENU <b>${prettyname}</b>,xdg-open ${TODO_DIR}/${filename}.csv")
out2+=("Delete <b>${prettyname}</b> todolist custom menu,rm -f ${TODO_DIR}/${filename}.csv;${0} center") out2+=("$_DELETE_MENU <b>${prettyname}</b>,rm -f ${TODO_DIR}/${filename}.csv;${0} center")
else else
out2+=("<big>󰍜</big> Add custom menu for <b>${prettyname}</b> todolist,mabox-todo.sh addmenu ${filename}") out2+=("<big>󰍜</big> $_ADD_MENU <b>${prettyname}</b>,mabox-todo.sh addmenu ${filename}")
fi fi
#out2+=("   ,^back()") #out2+=("   ,^back()")
out2+=("^sep(Danger Zone)") out2+=("^sep($_DANGERZONE)")
out2+=("<big></big> Delete <b>${prettyname}</b> todolist and all related files,^checkout(delproj)") out2+=("<big></big> $_DELETE <b>${prettyname}</b> $_LIST_AND_ALL,^checkout(delproj)")
out3+=("^tag(delproj)") out3+=("^tag(delproj)")
out3+=("^sep(Are you sure?)") out3+=("^sep($_AREYOU_SURE)")
out3+=("\"\"\"Yes, delete <b>${prettyname}</b> todolist and all files\"\"\",mabox-todo.sh removeproject ${filename};${0} center") out3+=("\"\"\"$_YES_DELETE <b>${prettyname}</b> $_LIST_AND_ALL\"\"\",mabox-todo.sh removeproject ${filename};${0} center")
### for Conky only if running ### for Conky only if running
out+=("^sep()") out+=("^sep()")
if pgrep -f 'conky.*conky/TODOlist' 2> /dev/null;then if pgrep -f 'conky.*conky/TODOlist' 2> /dev/null;then
out+=("<big></big> Conky display settings/filter,^checkout(display)") out+=("<big></big> $_CONKY_SETTINGS_LONG,^checkout(display)")
# DISPLAY SETTINGS SUBMENU # DISPLAY SETTINGS SUBMENU
out2+=("^tag(display)") out2+=("^tag(display)")
out2+=("^sep(Conky settings)") out2+=("^sep($_CONKY_SETTINGS)")
[[ "$filter" != "" ]] && out2+=("<big></big> Clear filter ($filter),mb-setvar filter= ${CFG_FILE};${0} center") [[ "$filter" != "" ]] && out2+=("<big></big> $_CLEAR_FILTER ($filter),mb-setvar filter= ${CFG_FILE};${0} center")
out2+=("^sep(Filter by)") out2+=("^sep($_FILTERBY)")
# Projects # Projects
if (( ${#projects[@]} == 0 )); then if (( ${#projects[@]} == 0 )); then
@@ -182,14 +263,14 @@ else
done done
fi fi
out2+=("^sep(Show/hide some elements in Conky)") out2+=("^sep($_SH_CONKY)")
[[ "$hide_done" = "y" ]] && out2+=("<big></big> Show done tasks ,mb-setvar hide_done=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> Show done tasks ,mb-setvar hide_done=y ${CFG_FILE}; ${0} center") [[ "$hide_done" = "y" ]] && out2+=("<big></big> $_SH_DONE,mb-setvar hide_done=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> $_SH_DONE,mb-setvar hide_done=y ${CFG_FILE}; ${0} center")
[[ "$hide_priority" = "y" ]] && out2+=("<big></big> (A-C) priority ,mb-setvar hide_priority=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> (A-C) priority ,mb-setvar hide_priority=y ${CFG_FILE}; ${0} center") [[ "$hide_priority" = "y" ]] && out2+=("<big></big> $_SH_PRIO,mb-setvar hide_priority=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> $_SH_PRIO ,mb-setvar hide_priority=y ${CFG_FILE}; ${0} center")
[[ "$hide_project" = "y" ]] && out2+=("<big></big> +project,mb-setvar hide_project=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> +project,mb-setvar hide_project=y ${CFG_FILE}; ${0} center") [[ "$hide_project" = "y" ]] && out2+=("<big></big> $_SH_PROJ,mb-setvar hide_project=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> $_SH_PROJ,mb-setvar hide_project=y ${CFG_FILE}; ${0} center")
[[ "$hide_context" = "y" ]] && out2+=("<big></big> @context,mb-setvar hide_context=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> @context,mb-setvar hide_context=y ${CFG_FILE}; ${0} center") [[ "$hide_context" = "y" ]] && out2+=("<big></big> $_SH_CONTEXT,mb-setvar hide_context=n ${CFG_FILE}; ${0} center") || out2+=("<big></big> $_SH_CONTEXT,mb-setvar hide_context=y ${CFG_FILE}; ${0} center")
else else
out+=("Start TODOList conky widget,conkyctl startone ${HOME}/.config/conky/TODOlist_mbcolor.conkyrc;${0}") out+=("$_START_CONKY,conkyctl startone ${HOME}/.config/conky/TODOlist_mbcolor.conkyrc;${0}")
fi fi
@@ -204,7 +285,7 @@ fi
if [ -f ${TODO_DIR}/${filename}.csv ]; then if [ -f ${TODO_DIR}/${filename}.csv ]; then
LINES=$(grep -Ev "^#|^$" ${TODO_DIR}/${filename}.csv|wc -l) LINES=$(grep -Ev "^#|^$" ${TODO_DIR}/${filename}.csv|wc -l)
if [ ${LINES} != 0 ]; then if [ ${LINES} != 0 ]; then
out+=("^sep(Custom commands for <b>${prettyname}</b> todolist)") out+=("^sep($_COMMANDS_FOR <b>${prettyname}</b>)")
fi fi
fi fi

View File

@@ -3,6 +3,26 @@
# mabox-todo.sh - conky widget + menus to interact with todo.sh # mabox-todo.sh - conky widget + menus to interact with todo.sh
case "$LANG" in
pl*)
_ADD_NEWTASK="Dodaj nowe zadanie..."
_ADD="dodaj"
_ABORT="anuluj"
_TASKDESC="Zadanie +projekt @kontekst"
_ADD_NEWTODOLIST="Nowa lista zadan..."
_TODONAME="Nazwa Listy"
;;
*)
_ADD_NEWTASK="Add new task..."
_ADD="add"
_ABORT="abort"
_TASKDESC="Task description +Project @Context"
_ADD_NEWTODOLIST="Add new TODO list..."
_TODONAME="TODO List name"
;;
esac
# Config file # Config file
CFG_FILE=~/.config/mabox/mabox-todo.conf CFG_FILE=~/.config/mabox/mabox-todo.conf
if [ ! -f "$CFG_FILE" ];then if [ ! -f "$CFG_FILE" ];then
@@ -38,8 +58,8 @@ prettyname=${filename//_/ }
[[ "$hide_priority" == "y" ]] && options+=("-P") [[ "$hide_priority" == "y" ]] && options+=("-P")
#header="Project:$filename \${alignc}TODO.txt (click me!)\${alignr}Filter:\${voffset 8}" #header="Project:$filename \${alignc}TODO.txt (click me!)\${alignr}Filter:\${voffset 8}"
header="\${color0}\${alignc}TODO List header="#\${color0}\${alignc}TODO List
\${alignc}${prettyname}\${alignr}#[filter: $filterlabel] \${color0}\${alignc}${prettyname}\${alignr}#[filter: $filterlabel]
\${voffset 8}" \${voffset 8}"
#declare -a cmd=(todo.sh ${options[@]} -d ~/.config/todo/config-conky ${action} ${filter}) #declare -a cmd=(todo.sh ${options[@]} -d ~/.config/todo/config-conky ${action} ${filter})
#out+=$(${cmd[@]}) #out+=$(${cmd[@]})
@@ -85,7 +105,7 @@ clearfilter(){
sd "filter.*$" "filter=" ${CFG_FILE} sd "filter.*$" "filter=" ${CFG_FILE}
} }
addtask(){ addtask(){
task=$(yad --width=400 --center --border=40 --undecorated --no-buttons --close-on-unfocus --text-align=center --text "<big><b>Add new task...</b></big>\n <b>Enter</b> - add | <b>Esc</b> - abort" --entry --entry-text="Task description +Project @Context" --ricon=gtk-clear) task=$(yad --width=400 --center --border=40 --undecorated --no-buttons --close-on-unfocus --text-align=center --text "<big><b>$_ADD_NEWTASK</b></big>\n <b>Enter</b> - $_ADD | <b>Esc</b> - $_ABORT" --entry --entry-text="$_TASKDESC" --ricon=gtk-clear)
if [ ! -z "${task}" ];then if [ ! -z "${task}" ];then
#notify-send.sh "okej" "${task}" #notify-send.sh "okej" "${task}"
pass_to_todo_sh add "${task}" pass_to_todo_sh add "${task}"
@@ -94,7 +114,7 @@ else
fi fi
} }
addfile(){ addfile(){
file=$(yad --skip-taskbar --width=400 --center --border=40 --undecorated --no-buttons --text-align=center --text "Add new TODO list..." --entry --entry-text="List name" --ricon=gtk-clear) file=$(yad --skip-taskbar --width=400 --center --border=40 --undecorated --no-buttons --text-align=center --text "$_ADD_NEWTODOLIST" --entry --entry-text="$_TODONAME" --ricon=gtk-clear)
if [ ! -z "${file}" ];then if [ ! -z "${file}" ];then
#Remove spaces #Remove spaces
file=${file// /_} file=${file// /_}
@@ -153,8 +173,8 @@ conkyctl startone $HOME/.config/conky/TODOlist_mbcolor.conkyrc
case "$1" in case "$1" in
-c) to_conky;; -c) to_conky;;
init|-i)init;; init|-i)init;;
listfiles|l)listfiles;; #list task files listfiles|l|-l)listfiles;; #list task files
switchfile|s)switchfile "$2";; #switch to tasks file switchfile|s|-s)switchfile "$2";; #switch to tasks file
filter)filter "$2";; filter)filter "$2";;
clearfilter) clearfilter;; clearfilter) clearfilter;;
addtask)addtask;; addtask)addtask;;

View File

@@ -8,8 +8,8 @@ conky.config = {
own_window_class = 'Conky', own_window_class = 'Conky',
own_window_title = 'Conky', own_window_title = 'Conky',
alignment = 'middle_left', alignment = 'middle_middle',
gap_x = 30, gap_x = 0,
gap_y = 0, gap_y = 0,
minimum_width = 200, minimum_width = 200,
@@ -20,16 +20,13 @@ conky.config = {
override_utf8_locale = true, override_utf8_locale = true,
-- COLORS -- COLORS
draw_shades = true, draw_shades = false,
default_shade_color = '#000000', default_shade_color = '#000000',
draw_outline = false, draw_outline = false,
default_outline_color = '#222222', default_outline_color = '#222222',
default_color = '#F8F8FF', default_color = '#d3d4bf',
color0 = '#accdc7', color0 = '#accdc7',
color1 = '#309552',
color2 = '#E8CB2D',
-- BORDERS -- BORDERS
draw_borders = true, draw_borders = true,
@@ -66,7 +63,7 @@ conky.config = {
conky.text = [[ conky.text = [[
#${execpi 30 todo.sh -d ~/.config/todo/config-conky ls} #${execpi 30 todo.sh -d ~/.config/todo/config-conky ls}
${execpi 3 mabox-todo.sh -c} ${execpi 5 mabox-todo.sh -c}
#${image ~/.config/conky/images/test.png -p 0,0} #${image ~/.config/conky/images/test.png -p 0,0}
#${image ~/.config/conky/images/test.png -p 400,0} #${image ~/.config/conky/images/test.png -p 400,0}
]]; ]];