# Export all component text used in Ignition

**URL:** <https://forum.inductiveautomation.com/t/export-all-component-text-used-in-ignition/53668>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [December 2, 2021, 1:36pm UTC](https://forum.inductiveautomation.com/t/export-all-component-text-used-in-ignition/53668 "2021-12-02T13:36:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 2, 2021, 1:59pm UTC](https://forum.inductiveautomation.com/t/export-all-component-text-used-in-ignition/53668/4 "2021-12-02T13:59:23Z")

</div>

Here is a script i used to automatically add all text values to the translate manager in perspective  
By checking the resource files… warning this may take a while xd

```auto
	import os
	import json
	from com.inductiveautomation.ignition.gateway import IgnitionGateway
	from com.inductiveautomation.ignition.gateway.script import GatewaySystemUtilities
	
	package = IgnitionGateway.get().getLocalizationManager().loadFullPackage()
	oldKeys = package.getAvailableKeys()
	context = IgnitionGateway.get()
	pathToProjectFolder = str(context.systemManager.dataDir.absoluteFile).replace('\\','/') + '/projects'	
	pathToProject = pathToProjectFolder + "/" + system.perspective.getProjectInfo().name + "/com.inductiveautomation.perspective/views/"
	
	def json_extract(obj, key):
	    """Recursively fetch values from nested JSON."""
	    arr = []
	
	    def extract(obj, arr, key):
	        """Recursively search for values of key in JSON tree."""
	        if isinstance(obj, dict):
	            for k, v in obj.items():
	                if isinstance(v, (dict, list)):
	                    extract(v, arr, key)
	                elif k == key:
	                    arr.append(v)
	        elif isinstance(obj, list):
	            for item in obj:
	                extract(item, arr, key)
	        return arr
	
	    values = extract(obj, arr, key)
	    return values

	newKeys = []
	for root, dirs, files in os.walk(pathToProject):
		try:
			for x in json_extract(json.loads(open(root + '/view.json').read()), 'text'):
				if x not in newKeys and x not in oldKeys and x != "":
					newKeys.append(x)
		except:
			pass
	
	for key in newKeys:			
		system.util.modifyTranslation(str(key),str(key),'en')
	

```

i got one for vision too but the gateway isnt on rn you need it? xd

---

_[View the full topic](https://forum.inductiveautomation.com/t/export-all-component-text-used-in-ignition/53668)._
