Architect - Documentation of category EXAMPLE_JSON shouldn't be copied when building localization files

When the localization files are build from the documentation (file .origamDoc in a model package), the application fails to start if there are more occurrences of category EXAMPLE_JSON for one element.

Since this category is an example of code, it shouldn’t be part of the localization file since it isn’t translated anyway. Also in this case you may want to cover e.g. both the request and result example, so it makes sense to have it more times in the original documentation file.

image

It was possible to save the two examples in the first place, but rebuilding the localization files fails.

Error
Item has already been added. Key in dictionary: 'Documentation EXAMPLE_JSON'  Key being added: 'Documentation EXAMPLE_JSON'
========================================
Item has already been added. Key in dictionary: 'Documentation EXAMPLE_JSON'  Key being added: 'Documentation EXAMPLE_JSON'
------------------------------------------
========================================
 Stack trace
========================================
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at Origam.DA.ObjectPersistence.LocalizationCache.LoadFile(String path)
   at Origam.Extensions.ReaderWriterLockSlimExtensions.RunWriter(ReaderWriterLockSlim rwLock, Action action)
   at OrigamArchitect.Commands.GenerateLocalizationFile.Run()
   at OrigamArchitect.frmMain.MenuItemClick(Object sender, EventArgs e)

It’s a good idea to exclude some parts of documentation elements. I propose to create a setting, something like LocalizationExcludedDocumentationElements and to name all those that should be excluded.

Or we can be more positive and make it opt-in, so LocalizationIncludedDocumentationElements. Since localization settings are already a part of OrigamSettings.config, I would put it there as a comma separated values list.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.