Survey Monkey and PO Files

Many users have asked me how they can translate (in Transifex) PO files that already contain some translation’s. What is the best practice to upload these files and translate them in Transifex?”

2 Likes

Hi @Sean_G!
That’s really a very common use case, and we would love to help users translating their PO files and Survey Monkey content in Transifex!

That’s the main issue: the source and translation content should be included in different PO files, and when a user downloads a file from Survey Monkey, both source text and translations appear in the same file.

This means that in order to start translating your content to Transifex, you need to:
– Create a new resource by uploading your source file to Transifex. This depends on the language you consider as a source language
– Once the resource is created, you can start translating your content into other languages using Transifex Web Editor as it is described in our documentation guide here.

I hope it helps,
Best,

I would also like to elaborate on this.

A PO source file in Transifex should follow one of the following structures:

(POT structure) : msgstr field is empty for all the entries in the file. This is called “POT structure”

e.g.

msgid “adventurous”
msgstr “”

msgid “willing”
msgstr “”

or

(PO structure) : msgstr field holds the translatable source string. No empty msgstr fields are included in the file. This is called “PO structure”

e.g.

msgid “adventurous”
msgstr “adventurous”

msgid “willing”
msgstr “willing”

Please note that our handler takes the way the first string is formatted into account in order to parse the file as a .po or as a .pot file. So, it is really important the msgstr fields to either be empty or contain the source string instead. The difference between these formats is mentioned in our FAQ section here [What’s the difference using a .po and .pot file as a source file?].

As far as the translation file, it should follow the structure below:

msgid “adventurous”
msgstr “abenteuerlich”

msgid “willing”
msgstr “bereit”

As you can see the msgstr field holds the translation text in the corresponding target language and the msgid holds the source string. So, in case you upload this file as a source file to Transifex, our handler will parse the file as a PO file since the msgstr fields are not empty and consider these values as source strings. That’s why we mention in our documentation here that the source file must contain only the text in the source language:

I hope that the above helps.

1 Like

This is not where I help gather the worlds accumulation of music. I understand the broad strokes i think.

I know this is a kind of old thread, but I’m running into issues with setting up a new resource for a survey monkey survey.

Perhaps if I document what I’ve tried and how they’re broken, others can suggest solutions.

First to address the problem of getting the source separate from the translations.

  • Temporarily add English to the list of languages in Survey Monkey, this allows you to download a po file that doesn’t contain translations
  • Run msgen --output-file=<new-source-file> <downloaded file> to create a source file that has the msgid copied for msgstr for all messages. This is necessary, otherwise there are errors when uploading the file for any msg id with an empty msgstr.

So far, so good, upload the new source file. Strings appear, and context includes the Survey Monkey context that identifies the elements of the survey.

Download translation po files that include some percentage of translated strings from Survey Monkey and use Upload file to upload to transifex. For example, upload the translations_es.po file for the Spanish version of the resource.

There are no errors, but no strings in the Spanish resource appear to be translated.

I noticed that there were formatting differences in the msgctxt strings between the files downloaded from Survey Monkey and the source file generated by msgen. I tried normalizing everything by using --no-wrap everywhere to prevent wrapping. Still no luck.

Is there a way to get this to work through the UI? Would it work to use the tx command line?

Hello @chrisg ,

Thank you for reaching out again to the Transifex community. What I understood so far, is that you exported a file from Survey Monkey, and you uploaded it successfully to Transifex as a source file. Now, that you downloaded from Survey Monkey a translated file and you uploaded it to Transifex you don’t see any of the translations. is that correct? Can you please share with me, the translated file you are trying to upload and which is the URL of the source file in your Transifex resource?

Thank you in advance for your answer.

Kind regards,
Panagiotis

Confirming that your summary is correct. I think I may have just found what the issue is, and I’m not sure if there’s any way to make this work.

The survey monkey translation files include msgctxt to allow for duplicate strings used in different survey questions. The context string looks like:

"{\"cxt\": \"question_required\", \"id\": 4314468895, \"checksum\": 290631095}"

while the cxt and id are the same, the checksum for the english string is 3705025782 and for other languages it’s different. In Spanish it’s 290631095. So the context doesn’t match and the translation is ignored.

My workaround:

  1. generate English source and upload as a new resource as above
  2. Pull all translations (untranslated) from transifex: tx pull -a
  3. Download all translations from survey monkey.
  4. Run msgmerge <survey_monkey>.po <transifex>.po > new.po on each language
  5. Unfortunately, this marks all the translations as fuzzy because the context changed, so edit the new.po file to remove all the #, fuzzy lines and save it as <transifex>.po
  6. Run tx push -l <lang> for the file you just saved.

Alternative suggestions are welcome!

I’ll add an update when I try uploading a translated file to survey monkey. I’m expecting there to be more issues when the context doesn’t match in the other direction, but maybe they’ll ignore it as any change to the translation would presumably invalidate the checksum. Unfortunately I think this is a Survey Monkey problem - having the checksum in the context.

Hello @chrisg ,

Thank you for your description.

It would be good to have an example of a source and a translation file - Can you please send us a message to support@transifex.com to take a better look into this?

Looking forward to your response.

Kind regards,
Panagiotis

When uploading PO files with existing translations to Transifex, you need to follow certain best practices to ensure a smooth and accurate translation process. Here’s a step-by-step guide on how to do it:

  1. Create a Transifex Project: If you haven’t already, create a new project in Transifex for the content you want to translate. Give the project a meaningful name and set the source language as the original language of the PO files.

  2. Add Languages to the Project: Add the target languages to your Transifex project. These are the languages you want the PO files to be translated into.

  3. Upload PO Files: In the Transifex project, navigate to the resource where you want to upload the PO files. Click on the “Upload Resources” button and choose the PO files you want to import. Make sure to select the correct source language for each PO file during the upload process.

  4. Sync Existing Translations: Once the PO files are uploaded, Transifex will automatically identify any existing translations in the files and align them with the corresponding strings in the project. This process is known as “Translation Memory” matching. It ensures that existing translations are reused, saving time and effort for translators.

  5. Invite Translators: Invite translators to work on the project. Translators can access the uploaded PO files and start translating any new strings or updating existing translations.

  6. Review and Approve Translations: After translations are submitted, they should be reviewed by a language reviewer or project manager to ensure accuracy and consistency. Approved translations will be reflected in the translated PO files.

  7. Download Translated PO Files: Once the translations are complete, you can download the translated PO files from Transifex. These files will now include the new translations and any existing translations that were updated during the process.

  8. Update Your Application: Replace the old PO files in your application with the newly downloaded and translated PO files. This will ensure that your application displays the latest and most accurate translations.

By following these steps, you can efficiently translate and manage existing PO files in Transifex, leveraging Translation Memory to reuse existing translations and streamline the localization process. Transifex offers a collaborative environment for translators and project managers, making it easier to manage multilingual content and keep translations up-to-date.

For more information check this: yardgearsguide.com -