Producing content that caters to various linguistic communities has long been a critical marketing tactic and educational endeavour. If you're a content creator, marketer, or business owner, successful localization strategies are essential for reaching worldwide audiences. A way to localize your content in After Effects is by utilizing a dropdown menu controller and a CSV file. One of our old blogs outlines the localization process using multiple CSV files that need to be updated for every specific language, which might not be ideal for daily usage. In this article, we will explore a more practical and efficient method with expressions, controllers and a single CSV file. Let's dive in!
Localization
In terms of content, localization involves choosing and adjusting different global languages to provide tailored content for specific regions or countries. Although videos and advertisements are typically created in standard English worldwide, they must still be translated into a particular language to reach specific audiences in a particular country or region. This process goes further than simply translating, providing a sense of the local culture in the video or advertisement as well.
Prerequisites for localization
The process requires a CSV file with attributes as different languages and their values or content in columns. Since this article mainly focuses on the localization process we will not be discussing about creating a whole template, but rather focus on the techniques. So you can either build a new template or try around with and existing one.
Step-by-Step Process:
- Import the CSV file into the project and drop it to the main composition.
- Create an
Adjustment Layer
and rename it to something appropriate likeLanguage_Menu
or something similar. We will be using this layer as a menu controller.
- We will add the dropdown menu controller from
effects and presets
panel to theadjustment layer
and edit its default value. We will keep the languages or attribute names exactly as written in the CSV file as this will also be used as a key factor for the expression.
- Depending on the number of text/content needed or the number of attributes stored in the CSV, we will add text layers according to it. So for example, if there is a total content of 7 captions, we will need 7 text layers to link the caption to its source text.
- To feed the content to the text layers, we will be using expression particularly
dataValue()
which will also be associated with theLanguage_Menu
layer's menu controller. Remember to keep the text layer as ascene sequence
and should start from the top as we will be using the index of the layers, so for thetop index
, its value will be 1.
var languageIdx = thisComp.layer("Language_Menu").effect("Language")("Menu").value;
var languageIdx_updated = languageIdx - 1
thisComp.layer("lang.csv").footage("lang.csv").dataValue([languageIdx_updated, index-1]);
- The code above is the main logic behind the mechanism of the whole project. In simple words, the expression is used to check the language name present as an attribute in the CSV file with the dropdown menu value which all happens using index values. So if we select the language as French, it will check for French in the
attribute
column of CSV. - Here the
languageIdx
variable is used to store the index chosen in the menu atLanguage_Menu
layer. Since the CSV layer stores values in an array format which has a zero-based indexing, we need to adjust the index values by subtracting one to align with our current format oflanguageIdx
. - The CSV file dropped earlier will now be linked to our expression with help of the
dataValue(row,column)
. In Adobe After Effects, thedataValue()
method is used to access data from data files, such as CSV or JSON files, that are imported into the project as footage. The dataValue uses rows and columns to get linked to the respective value. - So here,
dataValue([languageIdx_updated, index-1])
means it's trying to access the data of the rows as of the value oflanguageIdx_updated
i.e. the language of the content and the column is set to 1 i.e. second content of the CSV. Note that the columns have all the different caption content according to the scene. So all the text layer's column value is set toindex -1
such that from the top of the comp index will be 1 but the actual CSV will start from 0 so the first value index is set to 0. - We will create additional text layers for the captions as needed. Each text layer's source text will have the expression listed above, with the correct index according to the sequence of the captions, as this is the most important factor.
The language selection can now be effectively done through the dropdown menu. By choosing one option in the dropdown menu, the content of the entire project can be adapted for easier and more efficient daily use or for other similar dropdown situations.
Conclusion
Utilizing expressions for automation in After Effects is a highly effective method for working with motion graphics. In our project, we have used a CSV file and connected its attributes to After Effects via a dropdown menu controller and expressions, simplifying the process compared to traditional methods. This is only one example of how dropdown menu controllers and CSV can be used to automate workflow.
Thank you for reading this article. Please consider subscribing if you loved it.