Upload of .po translation file not working

Case number:845813-2009392
Topic:Game: Tools
Opened by:LociOiling
Status:Open
Type:Suggestion
Opened on:Monday, April 6, 2020 - 22:13
Last modified:Friday, June 25, 2021 - 06:10

As reported by socramdm in the forum thread Error "msgfmt not found" uploading or testing po file translation, uploading a translation file with the .po extension is not working.

The messages

Your .po file has errors. Remove it, fix it and upload again.
sh: 1: msgfmt: not found

appear, and nothing happens.

(Mon, 04/06/2020 - 22:13  |  27 comments)


LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Here's my .po file.

Use the "Browse" and "Attach" buttons in the "File Attachments" box below to add your own in a new reply.

You'll also need to add ".txt" to the file name for the attachment to work.

Joined: 03/08/2020
Groups: None

Hi LociOiling,

Thanks for instructions.

Here's my po file.

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

I renamed the attached file to pt_BR.po, and opened it in Poedit.

Everything looks good, and it even appears to be a complete translation.

As mentioned elsewhere in the feedback, it's possible that the "msgfmt" program is not installed on the Foldit server. Foldit moved to a new server last year, and it's possible msgfmt and some related items were overlooked.

Somebody said "puxa cara, aprenda mais uma idioma" over on intro puzzles page on the wiki a few years back. Now we are so close to having the game translated, maybe only a tarball or RPM or whatever away.

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Just for completeness, I tried renaming my file to match existing names like "foldit.fr.po".

I tried uploading "foldit.lo.po", but got the same error.

I also noticed this message in the upload area toward the bottom of the add client translation page:

For security reasons, your upload has been renamed to foldit.lo_.po.

I also changed the "lo" to a real country code, "pr", but this produced the same errors and messages.

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Another great thought: "msgfmt" is a utility program, part of the "gettext" package.

I'm thinking the "msgfmt not found error" means exactly what it says, the system can't find the program.

So maybe something needs to be installed, or a path needs to be adjusted.

Joined: 03/08/2020
Groups: None

Yes. But.. Who it's responsible for the Foldit server (sysadmin)? How to contact him to explain the error?

jeff101's picture
User offline. Last seen 14 hours 30 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

The Foldit Team often reads these Feedbacks.
Perhaps one (like agcohn821) will respond
directly. They have green and white Foldit
icons by their user names.

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Yes to what jeff101 says, and I've also notified the Foldit developers directly.

Meanwhile, the good news is that users can install this translation file on their own.

The first step is to download pt_BR.po_.txt from the reply above: https://fold.it/portal/node/2009392#comment-40916

Rename the file to foldit.pt.po

Copy the file to this directory:

C:\Foldit\cmp-resources-1e8bcb69156e40a1336e1f920fdaa0a0\resources\locale

Change C:\Foldit to the correct location on your system.

This is the current resource directory. The resource directory is sometimes replaced when Foldit installs an update. Be sure to save a copy of foldit.pt.po in a separate spot.

Now when you start Foldit, go to "Set language" on the login screen. You'll see "[pt] Português" as one of the languages. Double-click on it, or single click and click "Apply Language". Foldit then restarts with the language pack installed.

While this isn't quite as good as having the translation already installed, it's better than nothing. Hopefully, the team will get the upload process fixed before too long.

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

See Portuguese translation on the Foldit wiki for instructions on how to install the translation manually.

Joined: 03/08/2020
Groups: None

Great job!

agcohn821's picture
User offline. Last seen 16 hours 21 min ago. Offline
Joined: 11/05/2019
Groups: Foldit Staff

Thank you!

Hey Loci--thank you so much for sending this along to everyone!

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

See also this feedback: messages missing from template file.

A lot of messages aren't getting translated.

For at least some messages, you can just add the English text and the translation to the translate file.

There are other untranslated messages where this doesn't seem to work, however.

Joined: 03/08/2020
Groups: None

Hi all,

Here's the new version of Portuguese Translation with additional messages.

socramdm

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

For the Foldit developers, here's a list of intro puzzle messages that I wasn't able to translate. ("Translate" means adding a fixed keyword to each message, just to identify what *could* be translated.)

There are also some notes on how the translation is supposed to work. Foldit appears to be using the Gnu "gettext" package.

I've been able to add a few more messages since the last update. I'll upload the new files soon.

Foldit has several others areas where messages can't be translated. For example, I haven't been able to translate the "Objectives" area. This gap leads to other problems, such as one intro puzzle message referencing the "show" check box on one of the objectives.

Nicm25's picture
User offline. Last seen 14 hours 47 min ago. Offline
Joined: 04/22/2020
Groups: None
Type: Bug » Suggestion

Oops,unexpected thing happened, I can't upload a language file
a message that seems to be a shell script error is output
I didn't know what I couldn't find.

The file uploaded OK.
Your .po file has these errors:
Your .po file has errors. Remove it, fix it and upload again.
sh: 1: msgfmt: not found

The po file I translated for sharing has been self verifying to work when run on my client.
looking around log.txt, I couldn't find message in warn or error.
The verification method is
just copy attachment .po files to "/cmp-resources-XXX/resources/locale/".

Steps I took
Go to "Test Client Translation"
"foldit.ja.po" Upload and test
Rename and return with error
I guess I can't find "foldit.ja_.po"
Renamed to "foldit.ja_.po" and tried again
Returns with an error
It works without the .mo file, so I guess it's old and unused
Go to "Share Client Translation"
Attempts to post but returns with an error
Give up

am I overlooking something?, what should I do after this?

Instead, I decided to post directly to resolve this issue.
originally, I was planning to post with the following message.

--------
hey, good news
font resolved, tentatively japanese translation for available.
for many people who can't read Latin letters.

This translation is the test (demo) version, so GUI only and valid not accurate.
Oops, there seems to be a problem with 'tooltip font'
unfortunately I had not choice so not translation. Oh,'Mottainai'

try updating or installing the .ja.po file manually

enjoy!
--------

P.S Oops, long text, I just had to posting good :)
rename : foldit_ja_po.txt to foldit.ja.po

Nicm25's picture
User offline. Last seen 14 hours 47 min ago. Offline
Joined: 04/22/2020
Groups: None
Type: Suggestion » Bug

rude, unfamiliar I've changed status and I'll put it back. XD

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Hi Nicm25,

Sorry you're still running into this problem. Uploading .po files has been broken for a while now.

The Foldit team is working on a new website. We hope it will include a fix for the translation feature.

If you have a translation, attaching it to a feedback, as you have done, is best for now. As you discovered, you'll have to rename it with ".txt", so "foldit.xx.po" becomes "foldit.xx.po.txt".

The Foldit team is actively working to improve translations. There's now a working Korean translation, something that's been requested for a long time. Some software changes were necesssary. Something similar will probably work for Japanese.

The #localization channel on the Foldit Discord server is a good place to discuss the issues involved. (You can also share translations there.)

(Edit: I failed to read the complete feedback, and failed to notice that Nicm25 had already attached a translation file. Long day here.)

LociOiling's picture
User offline. Last seen 3 hours 35 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

successful test

As discussed on the #localization channel on Discord, I was able to get this translation to display. It seems like the necessary fonts are already present. Here is what you need to do.

  1. get the devprev release of Foldit
  2. download the translation file
  3. rename the translation file to foldit.ja.po
  4. copy the translation file to the current resources/locale directory, for example C:\Foldit\cmp-resources-64b8f7d6986867f25d667e2d83a2422a\resources\locale
  5. start Foldit, click on the flag to change the language
  6. Japanese should now appear in the list of languages, although the text displayed is not correct
  7. click on Japanese, Foldit restarts and displays the translation

There are still some untranslated messages, but it looks like a good start.

In some cases, the translation template file, foldit.pot, may be incomplete. You may be able to add missing messages to foldit.pot and foldit.ja.po to translate them. In some cases, it's difficult to match the exact syntax of the English message, due to newlines and other formatting.

Another problem is messages which aren't correctly marked in the Foldit source code files. These messages can't be translated until the source code is changed.

There's a "log_untranslated" setting in options.txt to help identify missing messsages. This setting can be added to options.txt when Foldit is not running. I'd suggest adding it after the "language" setting. The result would look like this:

 "language" : "ja"
 "log_untranslated" : "1"

The result is a file which will be called "untranslated_messages.ja.log". It contained 253 messages when I tried it. The log file contains the untranslated messages in the msgid keyword, with a msgstr keyword. The log file can be added to foldit.ja.po, allowing the missing messages to be translated. I've attached the file (renamed to *.txt) below.

Nicm25's picture
User offline. Last seen 14 hours 47 min ago. Offline
Joined: 04/22/2020
Groups: None

Hi LociOiling,
Thanks for watching
If there are no problems it's ok, I intend some untranslated problems.
others interested in foldit, but I uploaded early for those who are suffering from language problems with interface manipulation.

Because I'm working on this issue in my spare time
seems that it will take a long time to continue translating the improved version.
(I am an ordinary person who is not familiar with biology, so I work to find the right word for japanese, which has many word expressions)
by adding "log_untranslated" in "options.txt", I was able to identify the target message, which is helpful. :)

Thank you

Nicm25's picture
User offline. Last seen 14 hours 47 min ago. Offline
Joined: 04/22/2020
Groups: None

japanese pot beta version 1
Hi,
good news, trying to improve many translations.
i have various problems, but I continued to translate as far as possible for japanese.
It's still in beta, but you can download from attachment.
rename : foldit_ja_po_b1.txt to foldit.ja.po

----------

Information for developers below
problems and how i dealt with...

I've tried the campaign, translation doesn't seem to work.
so I translated it and but I comment outed to reduce extra payload.

When I view the tooltip, I can't seem to see pop-up text. (no glyph?)
I don't know how to switch tooltip fonts, so I comment outed.

We not force this because I can guess it noun or unique name
for words and messages that appear to be untranslated.

Instead of attaching a README, the first 4KBytes are shown as comments.

I haven't editor with another tool due to environmental constraints.
so I can use editor is notepad(win) or nano(linux) like.
I sorted by function for manual editing.

note: further pursuit is a separate issue, so I'm thinking of separating this topics.
i'm hesitant to post each individual issue as it may be new website.

joshmiller's picture
User offline. Last seen 4 days 17 hours ago. Offline
Joined: 09/08/2017
Groups: Foldit Staff

Thanks Nicm25! We will look into the issues you mentioned and share your Japanese translation with other Foldit players.

Nicm25's picture
User offline. Last seen 14 hours 47 min ago. Offline
Joined: 04/22/2020
Groups: None

japanese pot beta version 2
Hi,
good news, I've almost completed the translation, but with no consensus yet.
It's built into foldit at devprev version, but you can try new version for japanese.
and for everyone who the supported translation helping and problem handling
thank you!
rename : foldit_ja_po_b2.txt to foldit.ja.po

----------

sorry for confusing you, file name i attached last time was incorrect, but this time it should be okay.

Nicm25's picture
User offline. Last seen 14 hours 47 min ago. Offline
Joined: 04/22/2020
Groups: None

japanese pot beta version 3
Hi,
good news, I've almost completed the translation, but with no consensus yet.
It's already built into foldit, but you can try new version for japanese.

fixed some untranslated and changed message for translation improvers.
thank you!
rename : foldit_ja_po_3.txt to foldit.ja.po

agcohn821's picture
User offline. Last seen 16 hours 21 min ago. Offline
Joined: 11/05/2019
Groups: Foldit Staff

Thank you so much Nicm25!

Nicm25's picture
User offline. Last seen 14 hours 47 min ago. Offline
Joined: 04/22/2020
Groups: None

Current pot
Hi,
good news, i will distribute the skeleton pot file for those who are about translation.
i'm sorted by feature and contains some messages that translation doesn't work yet.
feel free to use it if you want to translate more!
thank you
rename : foldit_pot2106.txt to foldit.pot

Joined: 10/10/2015
Groups: Team China
Type: Bug » Suggestion

New translators, note that the .po file sadly must be named a language code Foldit recognizes such as foldit.zh.po for Zhongwen (Chinese) and as Loci said, in cmp-resources-e9a39b0e7470c069cebb26d9e237026c/resources/locale/ or whatever the current one is that isn't cmp-resources-00000000000000000000000000000000 , and the current one will delete custom .po files on update but I found out the 0000 one doesn't delete it (though Foldit won't load it from there).
I can't see the Test Client Translation thing people are talking about as devprev doesn't work on Mac.
Also, the flags disappeared. If someone's bothered by politics maybe it's fortunate, though it might make finding your language harder. Maybe there could be an option to show flags.
Nice to see the new Language button logo, though.
If you have a Chinese IP address maybe try downloading the file linked (that I thought was from the Foldit wiki but can't find it) to Baidu; I can't see it easily as US is blocked.
I'll probably update the wiki to note CJK now work... at least once you switch to them.

Joined: 10/10/2015
Groups: Team China

Also, the Latinization for Hebrew is currently Abrit. That may be fine for some obscure keyboard layouts, since I read this week that [capital] A can represent its consonant rather than its vowel, but I had never read that version in my 9 years of Hebrew. In Hebrew, the name for the language is pronounced Ivrit and I'm pretty sure that's the preferred direct transliteration (though v and b are similar, thus the transliteration "Hebrew". Personally, I would set the Romanization to either Ivrit or Hebrew to be clear, especially since Hebrew characters [and flags] no longer render on the initial language selection screen. Avi Saig's last edit to the Hebrew .po file was in uh... 2012 it seems, which is actually earlier than the .pot template file date, 2013. Also, like Nicm said, the black popup speech bubbles when hovering the cursor don't render CJK or even Hebrew, so maybe it would be good to temporarily comment-out (but don't delete) those parts. And like I said, the Hebrew's backwards (though it seems to be written that way in the file and doesn't make much of a difference for Hebrew), so if you auto-translate Arabic, which has connected letters, it might have some glitches (like maybe the 2nd line of a sentence appearing above the 1st), just a heads-up. And note that Foldit .pot files should not be opened with PowerPoint.

Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons