SDL Trados Studio
SDL Trados GroupShare
SDL Trados Business Manager
SDL Trados Live
SDL Speech to Text
SDL Managed Translation - Enterprise
Translation Management Connectors
SDL LiveContent S1000D
SDL Contenta S1000D
SDL Tridion Docs
SDL Tridion Sites
SDL Content Assistant
SDL Machine Translation Cloud
SDL Machine Translation Connectors
SDL Machine Translation Edge
Tridion Docs Developers
SDL User Experience
Language Products - GCS Internal Community
SDL Community Internal Group
SDL Access Customer Portal
SDL Professional Services
Language Technology Partner Group
SDL Academic Partners
SDL Enterprise Technology Partners
ETUG (European Trados User Group) Public Information
Machine Translation User Group
Nordic SDL Tridion Docs User Group
SDL Tridion UK Meetup
SDL Tridion User Group New England
SDL Tridion West Coast User Group
SDL WorldServer User Group
Tridion Docs Europe & APAC User Group
Tridion User Group Benelux
Tridion User Group Ohio Valley
SDL MultiTerm Ideas
SDL Passolo Ideas
SDL Trados GroupShare Ideas
SDL Trados Studio Ideas
SDL Machine Translation Cloud Ideas
SDL Machine Translation Edge Ideas
SDL Language Cloud TMS Ideas
SDL Language Cloud Terminology Ideas
SDL Language Cloud Online Editor Ideas
SDL Managed Translation - Enterprise Ideas
SDL TMS Ideas
SDL WorldServer Ideas
SDL Tridion Docs Ideas
SDL Tridion Sites Ideas
SDL LiveContent S1000D Ideas
SDL Contenta S1000D
SDL XPP Ideas
Events & Webinars
To SDL Documentation
To SDL Support
To SDL Training
Training & Certification
What's New in SDL
Detecting language please wait for.......
I am trying to access the Termbase statistics with the MultiTerm Api.
I am able to retrieve the Total number of entries:
But how do I retrieve the breakdown for each language, like this:
Thanks in advance
HI Samuel Baldus,
In order to get the number of entries for a standalone application, please see the following code (which can be also found within the SDL GitHub public repository, under the Code samples…
Hi Samuel Baldus,
I did an investigation on the Multiterm public API and you can get the number of entries for each language using one of the the following methods:
Method 1. Get the language indexes from the current project and retrieve the NumberOfEntriesInIndex using the languageIndex:
var projectsController = SdlTradosStudio.Application.GetController<ProjectsController>(); var activeProject = projectsController?.CurrentProject;
var termbaseConfiguration = activeProject?.GetTermbaseConfiguration();
var languageIndexes = termbaseConfiguration.LanguageIndexes;
After you get the list of Language Indexes, you should retreive the corresponding Language Index for the curent language, like in the below print screen:
In the final step, you can use the languageIndex to get the number of entries from the termbase, using the below code:
var numberOfLanguageEntries = termbase.Information.NumberOfEntriesInIndex["languageIndex"];
Note: On the Community Wiki area, we have a documentation which explains how to add a new entry, what is language index and how to get it using Multiterm SDK, the wiki page can be accessed using this link. (I've updated the Wiki page with this new information which shows how to get the number of entries for each language using the public API)
Method 2. Parsing the Termbase Definition XML and get the needed information (this method is a bit complex, because requiers to create your own implementation to get the nodes information). The Definition can be accessed using the following code:
var entries = termbase.Entries;var definition = termbase.Definition;var def = definition._Definition;
The _Definition property keeps the entire termbase definition, including the languages and entries, so you can use it to extract the needed information.
You can use the https://codebeautify.org/xmlviewer tool to check how the xml result looks like.
With kind regards,
Hi Florentina Caputa
Thanks for the reply, however neither of the methods will give me the required data.
Your first method uses the SdlTradosStudio/Project Api and in my case I am accessing standalone termbases (not attached to projects).
The second method uses the Termbase Definition XML data which I already have access to. However a termbase definition can have more languages defined than actually in use. For example, I can define "de", "en" and "fr", which would all appear in the definition file; but only the "de" and "en" languages could have entries and terms. This is the data I am looking for.
How does the desktop application access the term count for each language without looping through each entry?
Hi Samuel Baldus,
I will look on how you can get the number of entries on a standalone application and I will come back to you with an answer.
In order to get the number of entries for a standalone application, please see the following code (which can be also found within the SDL GitHub public repository, under the Code samples folder):
The "GetNumberOfEntriesForEachLanguage(Termbase localtermbase)" method will return the terms entry for each language. I've implemented the method to return a Dictionary<string,int> which contains the language index and the corresponding number of terms.
On the appstore.sdl.com site, you can also find the Multiterm Desktop SDK, and I've also update the Multiterm Wiki page with the above details.
Lovely stuff, just what I needed. Thanks again for your help.
Samuel Baldus I am really happy that my answer helped you, any time.
Wish you a beautiful day.
Sorry to bring this one up again.
I've just noticed that your code counts the number of Entries per Language.
What I am really after is the number of Terms per Language.
Is that at all possible?