Change entitynames and fieldnames in llblgenproj-file from Dutch to English

Posts   
 
    
SanderF
User
Posts: 128
Joined: 11-Dec-2006
# Posted on: 15-Jan-2026 16:02:16   

We currently have approximately 500 entities with approximately 12,000 fields mapped in the LLBLGen designer. We intend to change the names of the entities and fields from Dutch to English. Is there a tool available within LLBLGen to do this? We're working on a PowerShell script that does this based on an Excel sheet with translations and manipulating the .llblgenproj-file, but we're running into several issues, such as relationships and forfs where names are sometimes separated by a :. This makes the conversion difficult.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 40034
Joined: 17-Aug-2003
# Posted on: 16-Jan-2026 09:42:34   

There's no translation service in the designer, but it does have a plugin system for you to utilize so you can access the entire object model. If you look at the Sourcecode archive (available in the Extras section of a version's download page), there's a plugins folder which has a C# project. It has a couple of plugins in sourcecode to illustrate how to create a simple plugin.

See also: https://www.llblgen.com/Documentation/5.13/Designer/Functionality%20Reference/PluginRunner.htm and for how to write a plugin: https://www.llblgen.com/Documentation/5.13/SDK/gui_implementingplugin.htm

The designer ships with a plugin called 'Project inspector'. You can start it by right-clicking on the project node in the project explorer -> Run plugin -> Project inspector. It basically lists the entire object model represented by the project. It's a visual way for you to navigate the object model so you can easily find what to change in your plugin.

E.g. to iterate over all the entities, enumerate the EntityModel.Vertices collection. Additionally, the Project has an API, which is documented in the reference manual here: https://www.llblgen.com/Documentation/5.13/ReferenceManuals/Designer/html/727B4215.htm. As the designer uses an undo / redo system, it's probably the easiest to wrap the entire process in an UndoablePeriodCommand. This is a command that can undo/redo everything in 1 go. As the designer is using an event system to keep everything in sync, changing something will cause a ripple effect of changed events at times. This isn't noticeable other than in the project explorer which is repainted a lot because of that. So it's crucial if you go the plugin route to make sure the plugin description states the project explorer has to be reset (See the sdk doc page linked above).

To do that, use:

var cmd = new UndoablePeriodCommand();

CommandQueueManagerSingleton.GetInstance().BeginUndoablePeriod(cmd);

// do work

CommandQueueManagerSingleton.GetInstance().EndUndoablePeriod(cmd);

You can also switch off the undo/redo system temporarily to speed things up by using: CommandQueueManagerSingleton.GetInstance().BeginNonUndoablePeriod() and ending it with CommandQueueManagerSingleton.GetInstance().EndNonUndoablePeriod().

If you want to do this in a CLI tool, you can, you then should look at one of the two CLI tools we ship in sourcecode form: the CLI refresher and the CLI generator. Both load the project and from there you can access it and do what you want with it, and as there's no designer active, there's no undo/redo system live as well.

Renaming is a matter of setting the Name property of a new value. This won't ripple through to relationships however. You have to iterate over these yourself and set the navigator names manually. The relationships in the model are the Edges collection of the EntityModel mentioned earlier. I'd first rename all entities, then all fields of each entity, then the relationships and then the Forfs. You don't have to touch mappings or tables.

To construct new names based on the patterns defined in the project, you can utilize the methods CoreUtils.MakeCLSCompliantName, CoreUtils.MakeUniqueName, ApplicationUtils.CreateUniqueElementName, ApplicationUtils.CreateNavigatorNamesand there are some more you can utilize, see the reference manual for details.

E.g. this is how the (sadly, internal) method RelationshipEdge.ProduceUniqueNavigatorNames() produces unique names in the reverse engineering process:

string startNavigator;
string endNavigator;
ApplicationUtils.CreateNavigatorNames(this, containingProject.Properties, out startNavigator, out endNavigator);
startNavigator = CoreUtils.MakeUniqueName(new FieldNameValidator(this.StartVertex, containingProject) 
                                                { AdditionalNavigatorsToCheck = additionalNavigatorsStartEntity }, startNavigator);
endNavigator = CoreUtils.MakeUniqueName(new FieldNameValidator(this.EndVertex, containingProject) 
                                                { AdditionalNavigatorsToCheck = additionalNavigatorsEndEntity }, endNavigator);

Then you have to set the NavigatorName property on the Navigator objects of the relationship.

To test things out, you can also use the C# repl inside the designer, in the Element Search window simple_smile You can write any C# there in the query pane and do whatever you want to the project elements, and it'll run that as long as you e.g. return the expected object.

Veel succes! simple_smile

Frans Bouma | Lead developer LLBLGen Pro