Skip to content

Commit

Permalink
Initial implementation of the sys/translate.sh
Browse files Browse the repository at this point in the history
- Add initial Catalan language support
  • Loading branch information
radare committed May 15, 2017
1 parent 152cb4f commit 165304f
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ meson-windows:
meson-config meson-cfg meson-conf:
# TODO: this is wrong for each platform different plugins must be compiled
cp -f plugins.meson.cfg plugins.cfg
./configure --prefix=/usr
./configure --prefix="${PREFIX}"
$(MAKE) libr/include/r_version.h
# cp -f libr/config.mk libr/config.mk.meson
# cp -f libr/config.h libr/config.h.meson
Expand Down
2 changes: 1 addition & 1 deletion binr/radare2/radare2.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static int main_help(int line) {
}
if (line != 1) {
printf (
" -- open radare2 on an empty file\n"
" -- run radare2 without opening any empty file\n"
" - equivalent of 'r2 malloc://512'\n"
" = read file from stdin (use -i and -c to run cmds)\n"
" -= perform !=! command to run all commands remotely\n"
Expand Down
32 changes: 32 additions & 0 deletions sys/lang/catalan/binr_radare2_radare2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
s,Usage:,Ús:,
s,patch],pegat],
s,file],fitxer],
s,file|,fitxer|,
s,run script file,executa script,
s,before the file is opened,abans que el fitxer s'hagi obert,
s,show help message,mostra l'ajuda,
s,display variable,mostra les variables i els seus valors,
s,evaluate config var,evalua variable de configuració,
s,block size = file size,el tamany de bloc és igual al del fitxer,
s,load plugin file,carrega extensió,
s,quiet mode,mode sigilós,
s,list supported IO plugins,llista les extensions d'IO,
s,do not load user settings and scripts,ignorar la configuració d'usuari i altres scripts d'inici,
s,do not load RBin info,no carregar les capçaleres del binari,
s,do not demangle symbol names,no resoldre els símbols,
s,map file at given address,mapejar fitxer en aquesta adreça,
s,run radare2 without opening any file,executar r2 sense obrir cap fitxer,
s,execute radare command,executa una comanda de r2,
s,force to use that rbin plugin,força l'ús d'una especifica extensió d'rbin,
s,start r2 in sandbox mode,arrenca r2 en mode sandbox,
s,perform sdb query into,realitza una petició sdb,
s,enable debug mode,habilita el mode de depuració,
s,set asm.arch,defineix asm.arch,
s,set asm.bits,defineix asm.bits,
s,set asm.os,defineix asm.os,
s,initial seek,adreça inicial,
s,specify rarun2 profile to load (same as,especifica un perfil de rarun2 (el mateix que,
s/use project, list if no arg, load if no file/utilitza aquest project, llista els projects sense argument/
s,load rabin2 info in thread,carrega la informació del binari en un fil,
s,read file from stdin,llegeix continguts del fitxer desde l'stdin,
s,set base address for PIE binaries,define adreça base per rebasejar binaries PIE,
48 changes: 48 additions & 0 deletions sys/translate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: sys/translate.sh [--reset] [lang|path]"
cd sys/lang && ls
exit 1
fi

if [ "$1" = "--reset" ]; then
RESET=1
shift
else
RESET=0
fi

if [ -d "$1" ]; then
:
else
if [ -d "sys/lang/$1" ]; then
L="sys/lang/$1"
else
if [ -d "$1" ]; then
L="$1"
else
echo "Invalid language"
exit 1
fi
fi
fi

echo
echo "WARNING: Translations are experimental and can only be changed at compile time"
echo "WARNING: Everyone is welcome to submit their translation efforts. I have no plans"
echo "WARNING: to support runtime language selection, because of the unnecessary overhead"
echo

for a in `cd "$L" && echo *` ; do
F=`echo $a | sed -e s,_,/,g`
echo "Processing $F"
git checkout "$F"
if [ "${RESET}" = 0 ]; then
sed -f "$L/$a" < "$F" > .tmp
if [ $? = 0 ]; then
mv .tmp $F
else
echo "Failed"
fi
fi
done

0 comments on commit 165304f

Please sign in to comment.