← Back to team overview

kicad-developers team mailing list archive

Re: Loading symbol libraries

 

Le 25/01/2018 à 16:24, Jeff Young a écrit :
> More performance enhancements:
> 
> 1) Edit Symbol gets similar fix as Place Symbol
> 2) progress-dialog-updating reduced to once every 50ms
> 3) SearchText gets lazy normalization
> 4) translation of typeNames and default fieldNames reduced to a single time
> 
> These fixes speed first-load-time of both Edit Symbol and Place Symbol by a factor of 3, and
> second-load-time of Edit Symbol to near-instantaneous.
> 
> Cheers,
> Jeff.
> 
> 

Hi Jeff,

Are you sure
static wxString namePrefix = _( "Unit" );
works when Eeschema is run in stand alone ?

The translation of strings works only after the dictionary is loaded.
This is not always the case of static wxStrings.

If Eeschema is run from Kicad, the dictionary is loaded but I am not sure this is the case in stand
alone mode.
And if the language is modified, the translation of static strings is not updated.

This is especially true if strings are displayed in the User Interface.

Perhaps a better fix could be:
- remove m_typeName, if not used in other place than GetTypeName()
- make LIB_ITEM::GetTypeName() virtual (perhaps virtual pure) and the virtual GetTypeName() of each
class returns the translated name when needed in UI messages (returns _( "Arc" ) instead of typeName
for a LIB_ARC for instance).
(note: from the point of view of translations, the current code:
 m_typeName = _( "Arc" ); in the ctor
and the accessor
 wxString GetTypeName() { return m_typeName; }
is already not good: any translated string should by built on the fly when possible)

Thanks.

-- 
Jean-Pierre CHARRAS


Follow ups

References