Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 2 voices.

Last updated by Kristof 3 years, 9 months ago.

Assigned support staff: Sumit.

Author Posts
December 11, 2017 at 10:32 am #1454001

Kristof

We are displaying a Countries dropdown field in our Gravity Form (footer on hidden link) that we have populated with the default Gravity Forms Countries list.
These country strings show up nicely in the String Translation table, but as there are 210 countries, we cannot translate them manually, so we downloaded the PO file from the Gravity Forms website and uploaded the gravityforms-nl_NL.mo file to /wp-content/languages/plugins/.
It seems this MO file is being ignored as all countries on the Dutch /nl/ site are still in English. How can we tell WPML to not use the individual strings but load the mo translations?

Screenshot_9.png
Screenshot_8.png
December 12, 2017 at 1:32 pm #1455590

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thank you for contacting support forum.

#1 Can you please provide me a screenshot of the backend of gravity form so I can understand how did you set up this field?
#2 Can you confirm if the translation of countries name exists in PO/MO files?
#3 Please go to WPML > Support > Debug Information and give me the information in the next reply. You can read the detailed instruction here: http://wpml.org/faq/provide-debug-information-faster-support/

Thanks

December 14, 2017 at 9:45 am #1457598

Kristof

#1 Add dropdown field >> Bulk Add / Predefined Choices >> Countries
#2 Yes, see screenshot_9 I uploaded before
#3 Debug info added

Screenshot_11.png
December 14, 2017 at 3:09 pm #1458030

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thanks for the explanation.
Gravity form allows you to import the choices which mean those are now user entered values and saved into the database. So cannot be translated using MO files, however, I understand this is difficult to translate all those country names manually. Therefore, I will post this question to my team and I will update you again.

Thanks

December 15, 2017 at 2:48 pm #1459044

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

I checked with my team. Unfortunately, MO files cannot be used to translate those strings. Because those strings are stored in the database. MO file can only translate strings in PHP files.
However, you can export those strings as PO file and then edit in PO editor once done then import again.
Here is the complete document https://wpml.org/documentation/getting-started-guide/string-translation/#import-export-po
Please let know if you have any question.

Thanks

December 15, 2017 at 2:59 pm #1459063

Kristof

But we already have a PO file downloaded from the Gravity Forms plugin, can't we use that one to import? All languages are already translated in that one. hidden link

December 15, 2017 at 3:21 pm #1459095

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Unfortunately, this will not work. Because the PO files that WPML exports contain information to match the strings while importing again.
Let's consider the example
PO file from gravity form site

#: includes/fields/class-gf-field-address.php:717
msgid "Yemen"
msgstr "Yémen"

PO file from WPML export

# wpml-name: select-1-choice-208-Yemen
msgid "Yemen"
msgstr ""

This line "wpml-name: select-1-choice-208-Yemen" does not exist in PO files from gravity forms thus cannot be matched and imported as new strings.
If you can manage to search-replace with some PO editor to add a translation in WPML PO file then it will work.

Thanks

December 18, 2017 at 8:32 am #1460024

Kristof

Ok, we will manually translate just a few countries then.