mirror of
https://gitlab.com/JKANetwork/jka-toolkit.git
synced 2026-02-16 10:01:33 +01:00
Translate, for internationalize
This commit is contained in:
Binary file not shown.
@@ -2,13 +2,13 @@
|
|||||||
# gitdit, a dialog interface to manage git repositories
|
# gitdit, a dialog interface to manage git repositories
|
||||||
# Author: JKA Network - contacto@jkanetwork.com
|
# Author: JKA Network - contacto@jkanetwork.com
|
||||||
|
|
||||||
VERSION="1.0.3"
|
VERSION="1.0.4"
|
||||||
#First check if the user is in a git repository
|
#First check if the user is in a git repository
|
||||||
preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ")
|
preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ")
|
||||||
if [ $preOption = "Not" ];then #When it isn't only it can do git clone
|
if [ $preOption = "Not" ];then #When it isn't only it can do git clone
|
||||||
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface $VERSION" 0 0 6 c "Descargar un nuevo repo (Hacer clone)" i "Inicializar nuevo repo"`
|
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface $VERSION" 0 0 6 c "Download new repository (Do clone)" i "Make a new empty repo"`
|
||||||
else #Else, all other options
|
else #Else, all other options
|
||||||
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" t "Confirmar cambios sin subida" s "Subir actualizaciones al git (Hacer push)" n "Crear nueva rama" b "Cambiar de rama " m "Unir ramas (Hacer merge)"`
|
gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Download repo updates (git pull)" t "Make commit without upload" s "Make commit if necc. and upload changes (git push)" n "Create new branch" b "Change branch" m "Merge branch (Do in branch you want to merge)"`
|
||||||
actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch
|
actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch
|
||||||
actual2=$(git branch --list | grep "^*" | cut -f2 -d" ") #Current branch name
|
actual2=$(git branch --list | grep "^*" | cut -f2 -d" ") #Current branch name
|
||||||
fi
|
fi
|
||||||
@@ -16,7 +16,7 @@ if [ ! -z $gitopt ];then #No canceled
|
|||||||
case $gitopt in
|
case $gitopt in
|
||||||
#Not staying in a git repo
|
#Not staying in a git repo
|
||||||
"i")
|
"i")
|
||||||
gitdir=`dialog --stdout --inputbox "Directorio del repositorio" 10 60 "."`
|
gitdir=`dialog --stdout --inputbox "Repo directory" 10 60 "."`
|
||||||
if [ $(echo $gitdir | cut -f1 -d"/") = "~" ];then #~ don't understand like $HOME
|
if [ $(echo $gitdir | cut -f1 -d"/") = "~" ];then #~ don't understand like $HOME
|
||||||
gitdirdef="$HOME"
|
gitdirdef="$HOME"
|
||||||
for (( i=2; i<=$cant; i++ ))
|
for (( i=2; i<=$cant; i++ ))
|
||||||
@@ -34,7 +34,7 @@ if [ ! -d $gitdir ];then
|
|||||||
mkdir -p $gitdirdef
|
mkdir -p $gitdirdef
|
||||||
fi
|
fi
|
||||||
if [ $? -eq 1 ];then
|
if [ $? -eq 1 ];then
|
||||||
echo "No tienes permiso para escribir en ese directorio" >> /dev/stderr
|
echo "You dont have permission to write in this directory" >> /dev/stderr
|
||||||
else
|
else
|
||||||
cd $gitdirdef
|
cd $gitdirdef
|
||||||
git init
|
git init
|
||||||
@@ -43,7 +43,7 @@ fi
|
|||||||
"c")
|
"c")
|
||||||
giturl=`dialog --stdout --inputbox "URL del git" 10 60`
|
giturl=`dialog --stdout --inputbox "URL del git" 10 60`
|
||||||
if [ -z $giturl ];then
|
if [ -z $giturl ];then
|
||||||
echo "Ningún repositorio especificado"
|
echo "No repository there."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
git clone $giturl
|
git clone $giturl
|
||||||
@@ -54,24 +54,24 @@ git pull $actual;;
|
|||||||
"s")
|
"s")
|
||||||
estado=$(git status | grep -E '(^Changes|^Untracked)' ) #It need to commit something?
|
estado=$(git status | grep -E '(^Changes|^Untracked)' ) #It need to commit something?
|
||||||
if [ "$estado" ];then #When is necesary commit
|
if [ "$estado" ];then #When is necesary commit
|
||||||
commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"`
|
commit=`dialog --stdout --inputbox "Changes text: " 10 50 "changes"`
|
||||||
if [[ -z $commit ]];then
|
if [[ -z $commit ]];then
|
||||||
commit="changes"
|
commit="changes"
|
||||||
fi
|
fi
|
||||||
git add . && git commit -m "$commit" && git push $actual
|
git add -A && git commit -m "$commit" && git push $actual
|
||||||
else #Nothing to commit, only push
|
else #Nothing to commit, only push
|
||||||
git push $actual
|
git push $actual
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"t")
|
"t")
|
||||||
commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"`
|
commit=`dialog --stdout --inputbox "Changes text: " 10 50 "changes"`
|
||||||
if [[ -z $commit ]];then
|
if [[ -z $commit ]];then
|
||||||
commit="changes"
|
commit="changes"
|
||||||
fi
|
fi
|
||||||
git add . && git commit -m "$commit"
|
git add -A && git commit -m "$commit"
|
||||||
;;
|
;;
|
||||||
"b")
|
"b")
|
||||||
howopt=`dialog --stdout --scrollbar --menu "Cambiar de rama" 0 0 6 c "Solo cambiar de rama" u "Cambiar de rama y actualizarla"`
|
howopt=`dialog --stdout --scrollbar --menu "Change branch" 0 0 6 c "Only change branch" u "Change branch and update it"`
|
||||||
if [ -z $howopt ];then
|
if [ -z $howopt ];then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@@ -103,7 +103,7 @@ do
|
|||||||
let j++
|
let j++
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama`
|
ramificacion=`dialog --stdout --scrollbar --menu "Select branch to goto" 0 0 6 $rama`
|
||||||
if [ ! -z $ramificacion ];then
|
if [ ! -z $ramificacion ];then
|
||||||
git checkout ${lista[$ramificacion]}
|
git checkout ${lista[$ramificacion]}
|
||||||
if [ $howopt = "u" ];then
|
if [ $howopt = "u" ];then
|
||||||
@@ -112,7 +112,7 @@ if [ ! -z $ramificacion ];then
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"n")
|
"n")
|
||||||
NewBranch=`dialog --stdout --inputbox "Nombre de la nueva rama" 10 50 "new branch"`
|
NewBranch=`dialog --stdout --inputbox "Name of the new branch" 10 50 "New branch"`
|
||||||
if [ ! -z $NewBranch ];then
|
if [ ! -z $NewBranch ];then
|
||||||
git checkout -b $NewBranch
|
git checkout -b $NewBranch
|
||||||
fi
|
fi
|
||||||
@@ -128,7 +128,7 @@ do
|
|||||||
let j++
|
let j++
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir a $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama`
|
merges=`dialog --stdout --scrollbar --menu "Select branch for merge to $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama`
|
||||||
if [ ! -z $merges ];then
|
if [ ! -z $merges ];then
|
||||||
git merge ${lista[$merges]}
|
git merge ${lista[$merges]}
|
||||||
git push $actual
|
git push $actual
|
||||||
|
|||||||
Reference in New Issue
Block a user