Transifex

Transifex enables robust localization across your user base, no matter the language.

The Transifex and Braze integration leverage Connected Content, allowing you to include a source string in your messages instead of lines of language-based conditional formatting. This, in turn, automates translation and frees up your teams to focus on delivering brilliant customer experiences.

Prerequisites

Requirement Description
Transifex Account A Transifex account is required to take advantage of this partnerhsip.

Integration

Step 1: Set up basic authentication

To set up basic authentication for your account, navigate to the Braze platform, under Manage Settings, open the Connected Content tab. Here you will provide the credentials used for all Connected Content calls to Transifex.

Basic Authentication Credential Management

Click New Credential, name your credential, and add your user name and password for your Transifex account.

Basic Authentication Credential Creation

Step 2: Connected Content

The Transifex integration uses Transifex’s translation strings API. The following cURL will allow you to see if your Transifex account has context values associated with translations. Input the <PROJECT_NAME> and <RESOURCE_NAME> found in your Transifex account.

1
curl -i -L --user username:password -X GET https://www.transifex.com/api/2/project/<PROJECT_NAME>/resource/<RESOURCE_NAME>/translation/en/strings

For example, if your Transifex project is located at https://www.transifex.com/appboy-3/french2/french_translationspo/, the project_name will be “french2” and the resource_name will be “french_translationspo”.

An example response with a blank context field is pictured below:

Terminal response

Connnected Content message example

This example code snippet utilizes the Transifex Strings API and the user’s language attribute.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% assign key = "<API_KEY>" %}
{% assign context = "<CONTENT>" %}
{% assign source_string = key | append: ':' | append: context %}
{% assign project = "<PROJECT_NAME>" %}
{% assign resource = "<RESOURCE_NAME>" %}
{% assign source_hash = source_string | md5 %}

{% if {{${language}}} == "en" or {{${language}}} == "it" or {{${language}}} == "de" or {{${language}}} == "another_language_you_support"  %}
{% connected_content https://www.transifex.com/api/2/project/{{project}}/resource/{{resource}}/translation/{{${language}}}/string/{{source_hash}}/ :basic_auth <Insert Basic Auth Credential Name Here> :save strings %}
{% endif %}

{% if {{strings}} != null and {{strings.translation}} != "" and {{${language}}} != null %}
  {{strings.translation}}
{% else %}
  {% abort_message('null or blank') %}
{% endif %}
WAS THIS PAGE HELPFUL?
New Stuff!