Ignore "description" field in source files when translating

I’m using react-intl to extract the translation source for my React app. It generates JSON in the format of

{
defaultMessage: “This is a message”,
description: “This is a description”,
}

The descriptions are showing up to be translated in the editor. Is there any way to avoid this behavior?

Thanks!

Hi Gabrielle, could you please kindly share your source file and send us the string URL to the Editor to show us the examples where the descriptions are showing up to be translated in the editor?

You may copy the URL in the following way:

copy-url

Hi Natalia,

Thanks for the quick reply. Here’s a link to one of those strings: Crowdin

And here is a snippet of the file uploaded:

{
  "+Q7lxn": {
    "defaultMessage": "Leave game",
    "description": "Label on a button that returns the player to the lobby"
  },
  "+f1MtU": {
    "defaultMessage": "Display",
    "description": "Label for the display mode setting"
  },

Hi Gabrielle,

Let us check this with our tech team and come back to you

Dear Gabrielle,

The file seems perfectly valid. How did you upload it to Crowdin? Could it be that it’s uploaded via the CLI/GitHub integration with the “type” property set to “json” (or not set at all)? Setting the type to “react_intl” explicitly should solve the problem. The description will become contextual information. If you uploaded the file via the UI, there is a good chance that our MIME detector did a bad job, we will create a JIRA ticket for the team to investigate further if you uploaded it via UI.

There’s also an application Crowdin File Type Modifier: Change the file type of your files when you upload them to Crowdin where you can configure a file type setting for each new file uploaded to your project (if you prefer to upload via the UI).

Hi Natalia,
I uploaded them via the UI. If you recommend it, I can switch to use the API instead. I’m currently just evaluating Crowdin so going through the UI was faster. Specifically I’ve been finding the file in the Sources tab and clicking “Update”.

I tried using the Crowdin File Type Modifier, but I’m seeing a similar error as in my other thread:

Revision Domain Exception: There is no application found that can handle the strings.json file type

Perhaps it’s the way I configured it?

Gabrielle,

The application would work with new files that you’re uploading, if you’re updating the source file using the “Update” option it might not catch it, so you need to first re-upload the source file itself.

As for API/CLI, it would be faster, especially with a focus on a long-term result. You can spend some time creating a full-circle script and then just let the machine automatically upload/download files/translations regularly.

Hi Dima,

Thank you for the reply.
I actually just had this realization myself, not long ago. Everything is now working well for me. Thank you for the recommendation to use the API - that was my longer-term plan as well.