Browse Source

feat:Add python API GetKicadCurrentLanguage

newinvert
Zhuang Jiezhi 2 years ago
committed by Seth Hillbrand
parent
commit
9b8fa85b32
  1. 8
      pcbnew/python/scripting/pcbnew_scripting_helpers.cpp
  2. 7
      pcbnew/python/scripting/pcbnew_scripting_helpers.h

8
pcbnew/python/scripting/pcbnew_scripting_helpers.cpp

@ -605,3 +605,11 @@ bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
return true;
}
wxString GetLanguage()
{
if( s_PcbEditFrame )
return GetSettingsManager()->GetCommonSettings()->m_System.language;
else
return "";
}

7
pcbnew/python/scripting/pcbnew_scripting_helpers.h

@ -209,4 +209,11 @@ bool IsActionRunning();
bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
bool aReportAllTrackErrors );
/**
* Get the language string from COMMON_SETTINGS.
*
* @return the current language string.
*/
wxString GetLanguage();
#endif // __PCBNEW_SCRIPTING_HELPERS_H
Loading…
Cancel
Save