# Facing issue with google translator using dbt model / macros

**URL:** <https://discourse.getdbt.com/t/facing-issue-with-google-translator-using-dbt-model-macros/13175>\
**Category:** Help\
**Tags:** snowflake, dbt-core\
**Created:** [May 3, 2024, 9:27am UTC](https://discourse.getdbt.com/t/facing-issue-with-google-translator-using-dbt-model-macros/13175 "2024-05-03T09:27:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vipinkumar](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@Vipinkumar](https://discourse.getdbt.com/u/Vipinkumar)\
**Post date:** [May 3, 2024, 9:27am UTC](https://discourse.getdbt.com/t/facing-issue-with-google-translator-using-dbt-model-macros/13175/1 "2024-05-03T09:27:43Z")

</div>

Hey Team, I’m seeking a solution to translate non-English strings within a column in my dbt model. Here’s the scenario: I have an employee table with an address column containing non-English strings. My goal is to create another column, say address\_en, which will hold the English translations using either a dbt model or macros. I’ve attempted various approaches but haven’t found a solution yet. Interestingly, I managed to achieve this using a Databricks notebook with the following function:

```python
from deep_translator import GoogleTranslator
import pandas as pd

def translate_text(row):
  if pd.isnull(row):
    return ''
  if row == '':
    return ''
  else:
    try:
      translated = GoogleTranslator(source='auto', target='en').translate(row)
      return translated
    except:
      return row

translate_deep = udf(translate_text)

```

I’d appreciate any assistance with this, as it’s currently blocking my progress.

---

<div class="post-metadata">

**Author:** ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)\
**Post date:** [May 3, 2024, 12:48pm UTC](https://discourse.getdbt.com/t/facing-issue-with-google-translator-using-dbt-model-macros/13175/2 "2024-05-03T12:48:06Z")

</div>

You would need a python model for this [Python models | dbt Developer Hub](https://docs.getdbt.com/docs/build/python-models)

Have a good read on this page

dbt python models are only supported if you are using snowflake, databricks or bigquery (I assume you are using databricks, so it is fine)

---

<div class="post-metadata">

**Author:** ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)\
**Post date:** [May 3, 2024, 12:49pm UTC](https://discourse.getdbt.com/t/facing-issue-with-google-translator-using-dbt-model-macros/13175/3 "2024-05-03T12:49:48Z")

</div>

Actually, maybe you are using Snowflake (because of the tags of the questions)

If so, these are the packages you can use for python models: [Snowflake Snowpark for Python](https://repo.anaconda.com/pkgs/snowflake/)
