# Export Translation manager to readable and editable file

**URL:** <https://forum.inductiveautomation.com/t/export-translation-manager-to-readable-and-editable-file/98194>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 5, 2024, 10:32am UTC](https://forum.inductiveautomation.com/t/export-translation-manager-to-readable-and-editable-file/98194 "2024-11-05T10:32:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thijs\_Geus](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@Thijs\_Geus](https://forum.inductiveautomation.com/u/Thijs_Geus)\
**Post date:** [November 5, 2024, 10:32am UTC](https://forum.inductiveautomation.com/t/export-translation-manager-to-readable-and-editable-file/98194/1 "2024-11-05T10:32:28Z")

</div>

Hey,

Is there a way to easily export the Translation manager and edit those files so i can send them to a translator that does not have experience in XML or so?

I already tried Excel but i cant even import the xml.

Are there some people that had the same issues, that have a tool they could recommend or something.

The issue already was there in 2016 regarding:

> [@Translating project](https://forum.inductiveautomation.com/t/translating-project/11168):
>
> I have a fairly big project coming to an end. Now is time start thinking about translate it to another language (russian in my case). I made project in english and now I need to send all texts for translation to Russia, so that one of the russians will translate this to their language. How can this be done? I know about export terms in Translation Manager, but output from this export is either XML or PROPERTIES (I never heard of that). How is this helpful? What can I (or the russians) do with …

I hope there are better solutions available 8 years later?

Thanks in advance!

-Thijs

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 18, 2024, 7:25pm UTC](https://forum.inductiveautomation.com/t/export-translation-manager-to-readable-and-editable-file/98194/2 "2024-11-18T19:25:36Z")

</div>

As mentioned at the bottom of that thread, translation export/import in "properties" format will be a pretty much human readable format like:

```python
someKey=someValue
someOtherKey=someOtherValue

```

For all your defined translation terms, one file per supported locale.  
Is there something this format doesn't offer you that you're looking for?

---

<div class="post-metadata">

**Author:** ![Thijs\_Geus](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@Thijs\_Geus](https://forum.inductiveautomation.com/u/Thijs_Geus)\
**Post date:** [November 19, 2024, 7:41am UTC](https://forum.inductiveautomation.com/t/export-translation-manager-to-readable-and-editable-file/98194/3 "2024-11-19T07:41:30Z")

</div>

Optimally a CSV export/import would be pretty useful i think.

I build it myself with scripts and that works great.

Its essentially so i can send just one file to a translation bureau and they can easily add all the languages i need in excel or other format where they have experience in.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 19, 2024, 4:20pm UTC](https://forum.inductiveautomation.com/t/export-translation-manager-to-readable-and-editable-file/98194/4 "2024-11-19T16:20:40Z")

</div>

What's the format of that CSV?  
Something like:

```csv
locale, term, translation
"en-US", "abc", "abc_translation"

```

I'm hoping to add a translation bundle import/export tool that works with Ignition's somewhat odd format to [Kindling](https://github.com/inductiveautomation/kindling/issues/212), the semi-official GUI tool I created to work with Ignition files.

It would also be good to add first-party support to Ignition, obviously; the entire translation management system needs some attention. It's on our list to get to, but hasn't risen to the top of the pile yet.

---

<div class="post-metadata">

**Author:** ![Thijs\_Geus](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@Thijs\_Geus](https://forum.inductiveautomation.com/u/Thijs_Geus)\
**Post date:** [November 20, 2024, 7:53am UTC](https://forum.inductiveautomation.com/t/export-translation-manager-to-readable-and-editable-file/98194/5 "2024-11-20T07:53:07Z")

</div>

Nice to hear you are looking into the translation manager!

an example of the CSV:

```python
Key,es,zh,en,nl
Menu Item 2,Elemento de Menú 2,菜单项 二,Menu Item 2,Menu Item 2
Dutch,Holandés,荷兰语,Dutch,Nederlands

```

So if i want to add another language i just put the language code after the last in the header and then adjust it, but that works easily in Excel for example.

My script to export CSV:

```python
def runAction(self, event):
    import csv
    from com.inductiveautomation.ignition.gateway import IgnitionGateway

    # Get the localization manager
    localization_manager = IgnitionGateway.get().getLocalizationManager()

    # Load the full translation package
    translation_package = localization_manager.loadFullPackage()

    # Get all translation keys
    keys = translation_package.getAvailableKeys()

    # Collect all available languages
    all_languages = set()
    for key in keys:
        translations = translation_package.getTranslationsFor(key)
        all_languages.update(translations.keys())

    # Define the CSV file path
    csv_file_path = "filepath"

    # Write to CSV
    with open(csv_file_path, mode='w') as file:
        writer = csv.writer(file, lineterminator='\n')
        # Create header row
        header = ["Key"] + list(all_languages)
        writer.writerow(header)

        # Write translation rows
        for key in keys:
            translations = translation_package.getTranslationsFor(key)
            row = [key] + [translations.get(lang, '') for lang in all_languages]
            writer.writerow(row)

    print("Export successful!")

```

And import back to the translationmanager:

```python
    import system.util
    import io

    # Define the CSV file path
    csv_file_path = "filepath"

    # Read from CSV and update translations
    with io.open(csv_file_path, mode='r', encoding='utf-8-sig') as file:
        # Read all lines
        lines = file.readlines()

    # Split the lines into headers and rows
    headers = lines[0].strip().split(',')
    system.perspective.print("CSV Headers: " + str(headers))

    if 'Key' not in headers:
        system.perspective.print("Error: 'Key' column not found in CSV file.")
        return

    languages = headers[1:] # Get languages from the header row
    system.perspective.print("Languages found: " + str(languages))

    for line in lines[1:]:
        try:
            row = line.strip().split(',')
            key = row[headers.index('Key')]
            translations = {lang: row[headers.index(lang)] for lang in languages if row[headers.index(lang)]}
            for lang, translation in translations.items():
                try:
                    system.util.modifyTranslation(key, translation, lang)
                except Exception as e:
                    system.perspective.print("Error adding translation for {key} in {lang}: {e}")
        except Exception as e:
            system.perspective.print("Error processing row: {e}")

    system.perspective.print("Import successful!")

```

\*I am not an expert in Ignition, but this works as expected
