Sometimes the names and texts in the Episerver UI can be confusing for the editors of a specific site. Luckily, we as developers can override all texts stored in Episervers language files, in two easy steps.
- Locate the text you want to override
- Add your own translation to an XML file
Locate the text you want to override
Episerver stores the texts in XML language files included as embedded resources in their DLL files. You will find most texts in these two assemblies:
Say we want to change the tab name from «Sites» to «Languages», because editors use the tab to change – exactly – language.
The original tab names:
Open the assemblies in DotPeek, ILSpy or similar, locate the language file in your preferred language under the folder «Resources», and search for the text you want to replace, in this case «Sites».
Locating the original tab name using ILSpy:
Add your own translation to an XML file
All we have to do is create an XML file within our solution with the exact same path to the text, including the same language parameter.
<?xml version="1.0" encoding="utf-8"?> <languages> <language name="English" id="en"> <episerver> <cms> <components> <sitetree> <title>Languages</title> </sitetree> </components> </cms> </episerver> </language> </languages>
And the final result: