Topic: Po file damage on edit

Dear All
i try to edit my Po file and  i have to force stop my ubuntu and shutdown . now after restart i  want edit Po file poedit cant edit po file and say it probably corrupted. Po file size show 0 now . while my translation in frontaccounting work normally.
is that any way i can recover my Po file ??

Re: Po file damage on edit

If you have the .mo file, use msgunfmt to extract back the .po file.

Re: Po file damage on edit

Dear apmuthu
thanks for your replay
it convert file to po by command "msgunfmt -o, --output-file=sample.po"
but po file crated not include references link in translate?
what can i do?

4 (edited by apmuthu 08/17/2016 04:58:17 am)

Re: Po file damage on edit

You need to use either "-o" or "--output-file=" but not both. Try:

msgunfmt -i -o ar_EG-2.3.12-1.po
// CRLF => LF for new .po and for empty.po files
// format and space of msgstr and msgid upto first double quote must be same
msgmerge -s --no-location ar_EG-2.3.12-1.po empty.po -o ar_EG-2.3.12-2.po
// Edit the ar_EG-2.3.12-2.po file and compile
msgfmt ar_EG-2.3.12-2.po -o

Re: Po file damage on edit

Dear apmuthu
thanks for your replay .
final po file create without any reference link as sample bellow:
sgid " changed to "
msgstr " تغییر به "

msgid " for item "
msgstr " برای کالا "

msgid ""
" is not writable. Change its permissions so it is, then re-run the operation."
msgstr "غیرقابل نوشتن.سطح دسترسی را تغییر دهید و سپس تلاس کنید."

msgid "#"
msgstr "#"
while the empty file be like :
#: /frontaccounting.php:75
#: /frontaccounting.php:76
msgid "Main  Menu"
msgstr ""

#: /frontaccounting.php:77
#: /access/logout.php:21
#: /themes/default/renderer.php:72
#: /themes/default/renderer.php:84
msgid "Logout"
msgstr ""

#: /access/login.php:13
#: /access/password_reset.php:13
msgid "Restricted access"
msgstr ""
as mater of fact , my po file translate word but i dont know its related to which link.

Re: Po file damage on edit

There is a flag for the msmerge utility: "--no-location" which uniformly strips the file and line references in the output.

If you want the file and line number references possibly with no sorting (-s), then reverse the order of the files:

msgmerge empty.po ar_EG-2.3.12-1.po -o ar_EG-2.3.12-2.po