What are POT/PO files?
POT (portable object template) and PO (portable object) files are a text-based object file commonly used for translations. This human readable file is accepted by many translations service providers, and each file will contain a message ID (msgid) and message string (msgstr). The differences between the two file types are: POT files will only contain the untranslated text strings, while PO files will contain both the untranslated text strings and the actual translations.
Example POT Content:
msgid "Hello!"
msgstr ""
Example PO Content:
msgid "Hello!"
msgstr "Bonjour!"
Do localizations work with Sendwithus Snippets?
You bet! Localizations for snippets go through the same process as localizing templates. Wrap the content in the snippet with trans tags and reference the snippet in the template. This action will make the content available in the POT export file.
How do I tell which locale is my default?
If you have multiple localizations created, you can select the arrow dropdown on the templates page to see the list of available locales. The default locale will be indicated by a green checkmark.
If you do not have any localizations created, the current template is your default locale. To view the locale code, click on the template and go to the template editor. On the right side of your screen, you will see a template ID along with a locale code for the template.
What happens if I include the default locale in the PO file upload?
Since the default locale contains your marked up trans tags, we will prevent you from uploading the corresponding locale file. Please remove this file from your packaged zip files to continue localizing your templates.
What happens if I don’t specify the locale on the Send API call?
If you do not specify a locale on the Send API call, we will send the default locale. If you specify a locale that does not exist we will also send the default locale.
Can I include HTML in the trans tags?
You sure can! We usually recommend only wrapping text or copy with the trans tags, but we understand the importance of preserving the context structure. You’re more than welcome to wrap HTML in trans tags, but just be sure your translation team and system can handle these cases.
Can I use trans tags in other versions of the template? Will these versions be translated?
Yes! You can use trans tags in separate versions of the template and during the upload PO process, we will apply those localizations to the versions accordingly.
I can’t find the locale I want to use. Are you going to be adding any additional locales?
If you can’t find the locale you’d like to use, please send us an email at support@sendwithus.com and we’d be happy to help you!
Why aren’t my PO files uploading?
There could be a couple reasons why the PO file process is not accepting the files. Let’s walk through a couple of those cases.
Sendwithus requires the name of the PO files to match the locale code of the localization you’d like to create. For example,
Valid Locale Syntax
- en-US.po
- fr-FR.PO
Invalid Locale Syntax
- EN-US.po
- fr_FR.po
- Spanish.po
For a list of supported locale codes, visit our localization API docs.
Sendwithus requires two headers (POT-Creation-Date and POT-Revision-Date) in the PO file to match the following syntax
YEAR-MO-DA HO:MI+ZONE
.
Valid Accepted Dates
"POT-Creation-Date: 2018-10-03 12:00+0000\n"
"PO-Revision-Date: 2018-10-04 04:00+0000\n"
Sendwithus does not support nested variables in PO files. To work around this, assign the nested value to a top level variable.
{% set name = company.employee.firstName %}
{% trans %}Hi {{ name }}{% endtrans %}
If any of your msgid
’s contain variables, make sure the translated msgstr
also includes the exact same variable name. Don’t forget the %
at the beginning of the variable and the s
at the end.
msgid "Hello %(FirstName)s."
msgstr "Hola %(FirstName)s."
If you’re still having troubles with your PO file, send us an email at support@sendwithus.com.