SkinningTools.UI.translator

Module Contents

Classes

SearchableComboBox

combobox that adds functionality to search for the object necessary out of the list of items

TranslatorDialog

simple dialog with google translate connections

Functions

showUI(inDict, widgetName)

function to show the widget blocking other functionality

testUI(inDict, widgetName)

convenience function to show the current widget without it being part of the system

class SkinningTools.UI.translator.SearchableComboBox(parent=None)

combobox that adds functionality to search for the object necessary out of the list of items

_sync(self)

sync the current text with the text of give item at the index

class SkinningTools.UI.translator.TranslatorDialog(inDict=None, defaultLanguage='japanese', widgetName=None, parent=None)

simple dialog with google translate connections making sure that we can translate any given text to any language the items displayed will always have the english text to the left to compare

_createDict(self)

create the dictionary using the information of the widget

Returns

the translated dictionary

Return type

dict

_doTranslate(self)

seperate function to translate elements when the dialog is already build

_populateDialog(self)

populate the dialog using the given dictionary and auto translate the necessary pieces of information

_recreateDialog(self)

create the dialog with all the information of the given dictionary

getLangValue(self)

convenience function to get the name of the language we are translating to

Returns

the language to translate to

Return type

string

storeTranslation(self)

build the translation json file

translateConnection(self, key, inText, doTranslate=True)

create layout with the setup using a label and a lineedit to make sure we can change the translation if necessary

Parameters
  • key (string) – key value of the original dictionary to use for later

  • inText (string) – the text to translate or use as the input to change

  • doTranslate (bool) – if True the text given will be translated, if False we use the text for asjustments

Returns

the layout holding the widgets

Return type

QLayout

SkinningTools.UI.translator.showUI(inDict, widgetName)

function to show the widget blocking other functionality

Parameters
  • inDict (dict) – the dictionary to translate

  • widgetName (string) – the name of the widget to use to store the file

Returns

the current widget

Return type

QWidget

SkinningTools.UI.translator.testUI(inDict, widgetName)

convenience function to show the current widget without it being part of the system

Parameters
  • inDict (dict) – the dictionary to translate

  • widgetName (string) – the name of the widget to use to store the file

Returns

the current widget

Return type

QWidget