Cannot Perform Translation Updates

Hi,
As far as i understood, after i have updated the “messages.po” translation file, I should run the following command:
bash 1-update-pot-files.sh playsms-1.2.1/contrib/tools/language

However, when i run this command i am getting the following errors (missing files):

touch: cannot touch ‘language/messages.pot’: No such file or directory
touch: cannot touch ‘language/index.html’: No such file or directory
xgettext: error while opening “language/messages.pot” for reading: No such file or directory
xgettext: error while opening “language/messages.pot” for reading: No such file or directory
find: ‘…/lib/’: No such file or directory
find: ‘…/inc/’: No such file or directory
find: ‘themes/common/’: No such file or directory

Please advise me how can i overcome this issue and update my translation file because in my system those files does not exists in the above paths (i do see those file in several other paths but do not know what is the write path and where shell i update it).

Thanks & Best Regards,
Nimrod

the format is:

the-script-name.sh [playSMS installation dir]

Still didn’t find a solution for updating language…

I a bit confused, i have noticed that in my server there are two different playSMS folders with languages files and all…
My folders are:

  1. /root/playsms-1.2.1/web/plugin/language
  2. /var/www/html/playsms/plugin/language

Maybe the update could not dind the files becuase i am trying to use “/root/playsms-1.2.1/” instead of “/var/www/html/playsms”.

What path should i used for bash 1-update-pot-files.sh and what path shell i use to change/add language data ?

Thanks,
Nimrod

if you installed playSMS on /var/www/html/playsms then you should use that folder

anton

Odd, i could not find “1-update-pot-files.sh” in my “playsms” folder but i do see it in “playsms-1.2.1” folder.
Can i run it from “playsms-1.2.1” folder and direct it to “playsms” folder ?

By the way, if it helps, my “1-update-pot-files.sh” file looks like this:

#!/bin/bash

PLAYSMS=$1

if [ -z “$PLAYSMS” ]; then
echo "Usage: $0 "
exit 1
fi

CWD=$(pwd)

##Common strings
cd $PLAYSMS/plugin
touch language/messages.pot
touch language/index.html
xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o language/messages.pot …/init.php
xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o language/messages.pot …/index.php ##Themes,plugins and tools strings
find …/lib/ -iname “.php" -exec xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o language/messages.pot {} ;cd $PLAYSMS/web/plugin
find …/inc/ -iname "
.php” -exec xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o language/messages.pot {} ;find . -type d -name “language” | grep -v “grep” | sed -e “s//[^/]$//" > /tmp/.lang_folders
find themes/common/ -iname "
.php” -exec xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o language/messages.pot {} ;for i in cat /tmp/.lang_folders ; do mkdir -p “$i/language” ; done
for i in cat /tmp/.lang_folders ; do rm -f “$i/language/messages.pot” ; done
for i in cat /tmp/.lang_folders ; do touch “$i/language/messages.pot” ; done
for i in cat /tmp/.lang_folders ; do
find $i -iname ‘*.php’ -exec xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o “$i/language/messages.pot” {} ; ;
touch "$i/language/index.html"
done
rm /tmp/.lang_folders
cd $CWD

exit 0

please focus :smile:

you did this:

bash 1-update-pot-files.sh playsms-1.2.1/contrib/tools/language```

thats wrong, because your playSMS installation dir is at /var/www/html/playsms

so you must do this instead:

bash 1-update-pot-files.sh /var/www/html/playsms

and of course you must run above command in the same directory as the script

anton

OK, done what you suggested and still got the following error:

[root@livechat language]# bash 1-update-pot-files.sh /var/www/html/playsms/
find: missing argument to -exec' find: missing argument to-exec’
1-update-pot-files.sh: line 20: syntax error near unexpected token do' 1-update-pot-files.sh: line 20:find themes/common/ -iname “*.php” -exec xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o language/messages.pot {} ;for i in cat /tmp/.lang_folders ; do mkdir -p “$i/language” ; done’

I still have some problem…

missing argument to-exec’
1-update-pot-files.sh: line 20: syntax error near unexpected token do’
1-update-pot-files.sh: line 20:find themes/common/ -iname “*.php” -exec xgettext -L PHP --omit-header --no-location --sort-output --from-code=utf-8 -j -o language/messages.pot {} ;for i incat /tmp/.lang_folders ; do mkdir -p “$i/language” ; done’