Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality
Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By nomad27
#4556
I am just learning to use ProcessMaker and I could be doing something wrong, but I wanted to report this just in case something needs adjusting--

I tried to make an addition in the English po file (processmaker.en.po). After I made the change, when I went to the Admin screen to import the file, I got a really long error ending with "The .po file have a bad format!" At first I thought it was from something I added. But then I uninstalled and deleted all of Processmaker, did a clean install, and tried to import the English po file as it came straight from the installation (with no changes) and got the same error.

Here's the gist of the error:
-----------------
Notice: Undefined offset: 1 in C:\Program Files\ProcessMaker\apps\processmaker\htdocs\workflow\engine\classes\class.languages.php on line 87

Notice: Undefined offset: 1 in C:\Program Files\ProcessMaker\apps\processmaker\htdocs\workflow\engine\classes\class.languages.php on line 87

... (many more lines like those above, too much to post in this message)
string(31) "The .po file have a bad format!"
------------------

I made some modification to class.languages.php file so it would print out each item in the language file as it was being imported, so I could see what item was causing the error during import. Looks like the error was being thrown on or around this item:

# TRANSLATION
# JAVASCRIPT/USERS_REASSIGN
#: JAVASCRIPT/USERS_REASSIGN
msgid "You can't to delete this user because has some pending tasks, reassign the pending tasks first. <br/><br/>
Do you want to reassign these tasks now?"
msgstr "You can't to delete this user because has some pending tasks, reassign the pending tasks first. <br/><br/>
Do you want to reassign these tasks now?"

Just to test it, I simplified this item in the English po file to this:

# TRANSLATION
# JAVASCRIPT/USERS_REASSIGN
#: JAVASCRIPT/USERS_REASSIGN
msgid "You can't delete user because of some pending tasks, reassign the pending tasks first. Reassign these tasks now?"
msgstr "You can't delete user because of some pending tasks, reassign the pending tasks first. Reassign these tasks now?"

Then I ran the import again. It got farther this time, but eventually gave similar error. It looked like this time the error was occurring on or around this item:

# TRANSLATION
# JAVASCRIPT/ID_MSG_GROUPS_ADDCONFIRM
#: JAVASCRIPT/ID_MSG_GROUPS_ADDCONFIRM
msgid "At least one user must be selected.
"
msgstr "At least one user must be selected.
"

This is version 1.2-2740 running on Windows Vista.
User avatar
By amosbatto
#4559
You probably made some change to the PO file which is not allowed by the PO format.

For instance, this is not allowed:
Code: Select all
msgid "At least one user must be selected.
"
msgstr "At least one user must be selected.
"
It has to be:
Code: Select all
msgid "At least one user must be selected."
msgstr "At least one user must be selected."
or:
Code: Select all
msgid ""
"At least one user must be selected."
msgstr ""
"At least one user must be selected."
You should use PoEdit to edit translations files to avoid these problems. See: http://wiki.processmaker.com/index.php/ ... ocessMaker
If you want to edit PO files by hand, read the GNU gettext manual to learn the format.
User avatar
By martijnburger
#5016
Hi everyone,

I am getting the same error. I am using po-edit. The first half of the translation went okay, but after tonights work I am getting this error. Is there some way of debugging where in the .po file the error might be?


BR,

Martijn
User avatar
By martijnburger
#5037
Hello everyone,

we solved this problem. For some reason the following line was in my edited .po file:
Code: Select all
# TRANSLATION
# msgid "<b>Mask Sufixes: </b>%Y=Year, %m=Month, %d=Day"
#: msgid "<b>Mask Sufixes: 
#</b>%Y=Year, %m=Month, %d=Day"
msgid "rms/fields/date.xml?PME_MAS"
msgstr "rms/fields/date.xml?PME_MAS"
In the orginial file the statement was:
Code: Select all
# TRANSLATION
# msgid "<b>Mask Sufixes: </b>%Y=Year, %m=Month, %d=Day"
#: msgid "<b>Mask Sufixes: </b>%Y=Year, %m=Month, %d=Day"
msgid "rms/fields/date.xml?PME_MAS"
msgstr "rms/fields/date.xml?PME_MAS"
When I changed the code back it worked like a charm. How did we found the line in which the code was corrupt? We added the following debugging statement before line 85 to the file /opt/processmaker/workflow/engine/classes/class.languages.php:
Code: Select all
 echo $sLine.'<br>';
Now when we try to upload the corrupt .po file the error window gives us all successful imported language statements, so the next one is the statement that is corrupt.

Please make sure that you delete the debugging command in the class.languages.php file after fixing the .po

BR,

Martijn
User avatar
By amosbatto
#5093
Hi Martijn,
Was that change caused by PoEdit? If so, we need to file a bug report with PoEdit.
User avatar
By martijnburger
#5134
Hi Amos,

Yes! Po-edit corrupted the file. Strange thing, what is different about the rule that makes po-edit corrupt these lines...

BR,

Martijn
Case status draft

Alguien me puede ayudar? Mis casos siempre quedan […]

Download Processmaker version 3.8.3

Hello good people , anyone with Version 3.8. […]

Dappsfirm specializes in Poker Game Development, o[…]

Dappsfirm specializes in Keno Game Development, of[…]