Forum breadcrumbs - You are here:ForumGeneral: HelpCustom components
You need to log in to create posts and topics.

Custom components

I created custom component subcircuits.

For example, I created the outputs.xml file like this:

 <!DOCTYPE SimulIDE>

<itemlib>
    
    <itemset category="Outputs" type="Subcircuit" folder="arduino">
    
    <item name="FlashingGate"/>  
    </itemset>
    
</itemlib>

It works in the English version, but if I change the language, it creates an "Outputs" category at the bottom of the list. To make it work for Italian, I need to set category="Uscite." Is there a way to add it to the existing category regardless of the language?

Greetings

Is there a way to add it to the existing category regardless of the language?

No, but I will have a look and try to solve it.

I thought about doing it this way:

void ComponentSelector::LoadCompSetAt( QDir compSetDir )
{
    m_compSetDir = compSetDir;

// By Simulide Arduino start
    QSettings settings( QStandardPaths::standardLocations( QStandardPaths::DataLocation).first()+"/simulide.ini",  QSettings::IniFormat, 0l );
    QString locale = QLocale::system().name();
    if( settings.contains( "language" ) ) locale = settings.value( "language" ).toString();

    if (locale == "it") compSetDir.setNameFilters( QStringList( "*_it.xml" ) );
    else compSetDir.setNameFilters( QStringList( "*_en.xml" ) );
// By Simulide Arduino end

    QStringList xmlList = compSetDir.entryList( QDir::Files );

    //if( xmlList.isEmpty() ) return;                  // No comp sets to load

I only use two languages ​​and the number of files to edit is not excessive but with many languages ​​the necessary files become many.

Greetings

I had a look at this and categories are already working regardless of the language.
For example all subcircuits that come in "data" folder go to the proper folder in any language I choose.