eric4.Project.ProjectTranslationsBrowser

Module implementing a class used to display the translations part of the project.

Classes

ProjectTranslationsBrowser A class used to display the translations part of the project.

Functions

None


ProjectTranslationsBrowser

A class used to display the translations part of the project.

Signals

appendStderr(string)
emitted after something was received from a QProcess on stderr
appendStdout(string)
emitted after something was received from a QProcess on stdout
closeSourceWindow(string)
emitted after a file has been removed/deleted from the project
linguistFile(string)
emitted to open a translation file with Qt-Linguist
sourceFile(string)
emitted to open a translation file in an editor
trpreview(string list)
emitted to preview translations in the translations previewer

Derived from

ProjectBaseBrowser

Methods

ProjectTranslationsBrowser Constructor
__TRPreview Private slot to handle the Preview translations action.
__TRPreviewAll Private slot to handle the Preview all translations action.
__addTranslationFiles Private method to add translation files to the project.
__deleteLanguageFile Private method to delete a translation file from the project.
__generateAll Private method to generate all translation files (.ts) for Qt Linguist.
__generateObsoleteAll Private method to generate all translation files (.ts) for Qt Linguist.
__generateObsoleteSelected Private method to generate selected translation files (.ts) for Qt Linguist.
__generateSelected Private method to generate selected translation files (.ts) for Qt Linguist.
__generateTSFile Private method used to run pylupdate/pylupdate4 to generate the .ts files.
__generateTSFileDone Private slot to handle the finished signal of the pylupdate process.
__openFileInEditor Private slot to handle the Open in Editor menu action.
__readStderr Private method to read from a process' stderr channel.
__readStderrLrelease Private slot to handle the readyReadStandardError signal of the lrelease process.
__readStderrLupdate Private slot to handle the readyReadStandardError signal of the pylupdate process.
__readStdout Private method to read from a process' stdout channel.
__readStdoutLrelease Private slot to handle the readyReadStandardOutput signal of the lrelease process.
__readStdoutLupdate Private slot to handle the readyReadStandardOutput signal of the pylupdate process.
__releaseAll Private method to release the translation files (.qm).
__releaseSelected Private method to release the translation files (.qm).
__releaseTSFile Private method to run lrelease to release the translation files (.qm).
__releaseTSFileDone Private slot to handle the finished signal of the lrelease process.
__removeLanguageFile Private method to remove a translation from the project.
__showPopupMenu Private slot called by the menu aboutToShow signal.
__showPopupMenuBack Private slot called by the backMenu aboutToShow signal.
__showPopupMenuDir Private slot called by the dirMenu aboutToShow signal.
__showPopupMenuMulti Private slot called by the multiMenu aboutToShow signal.
__writeTempProjectFile Private method to write a temporary project file suitable for pylupdate and lrelease.
_createPopupMenus Protected overloaded method to generate the popup menu.
_showContextMenu Protected slot to show the context menu.
handlePreferencesChanged Public slot used to handle the preferencesChanged signal.

ProjectTranslationsBrowser (Constructor)

ProjectTranslationsBrowser(project, qtdir, qt4dir, parent=None)

Constructor

project
reference to the project object
qtdir
path of the Qt installation directory (string)
qt4dir
path of the Qt4 installation directory (string)
parent
parent widget of this browser (QWidget)

ProjectTranslationsBrowser.__TRPreview

__TRPreview(previewAll = False)

Private slot to handle the Preview translations action.

previewAll
flag indicating, that all translations should be previewed (boolean)

ProjectTranslationsBrowser.__TRPreviewAll

__TRPreviewAll()

Private slot to handle the Preview all translations action.

ProjectTranslationsBrowser.__addTranslationFiles

__addTranslationFiles()

Private method to add translation files to the project.

ProjectTranslationsBrowser.__deleteLanguageFile

__deleteLanguageFile()

Private method to delete a translation file from the project.

ProjectTranslationsBrowser.__generateAll

__generateAll()

Private method to generate all translation files (.ts) for Qt Linguist.

All obsolete strings are removed from the .ts file.

ProjectTranslationsBrowser.__generateObsoleteAll

__generateObsoleteAll()

Private method to generate all translation files (.ts) for Qt Linguist.

Obsolete strings are kept.

ProjectTranslationsBrowser.__generateObsoleteSelected

__generateObsoleteSelected()

Private method to generate selected translation files (.ts) for Qt Linguist.

Obsolete strings are kept.

ProjectTranslationsBrowser.__generateSelected

__generateSelected()

Private method to generate selected translation files (.ts) for Qt Linguist.

All obsolete strings are removed from the .ts file.

ProjectTranslationsBrowser.__generateTSFile

__generateTSFile(noobsolete = False, generateAll = True)

Private method used to run pylupdate/pylupdate4 to generate the .ts files.

noobsolete
flag indicating whether obsolete entries should be kept (boolean)
generateAll
flag indicating whether all translations should be generated (boolean)

ProjectTranslationsBrowser.__generateTSFileDone

__generateTSFileDone(exitCode, exitStatus)

Private slot to handle the finished signal of the pylupdate process.

exitCode
exit code of the process (integer)
exitStatus
exit status of the process (QProcess.ExitStatus)

ProjectTranslationsBrowser.__openFileInEditor

__openFileInEditor()

Private slot to handle the Open in Editor menu action.

ProjectTranslationsBrowser.__readStderr

__readStderr(proc, ps)

Private method to read from a process' stderr channel.

proc
process to read from (QProcess)
ps
propmt string (string or QString)

ProjectTranslationsBrowser.__readStderrLrelease

__readStderrLrelease()

Private slot to handle the readyReadStandardError signal of the lrelease process.

ProjectTranslationsBrowser.__readStderrLupdate

__readStderrLupdate()

Private slot to handle the readyReadStandardError signal of the pylupdate process.

ProjectTranslationsBrowser.__readStdout

__readStdout(proc, ps)

Private method to read from a process' stdout channel.

proc
process to read from (QProcess)
ps
propmt string (string or QString)

ProjectTranslationsBrowser.__readStdoutLrelease

__readStdoutLrelease()

Private slot to handle the readyReadStandardOutput signal of the lrelease process.

ProjectTranslationsBrowser.__readStdoutLupdate

__readStdoutLupdate()

Private slot to handle the readyReadStandardOutput signal of the pylupdate process.

ProjectTranslationsBrowser.__releaseAll

__releaseAll()

Private method to release the translation files (.qm).

ProjectTranslationsBrowser.__releaseSelected

__releaseSelected()

Private method to release the translation files (.qm).

ProjectTranslationsBrowser.__releaseTSFile

__releaseTSFile(generateAll = False)

Private method to run lrelease to release the translation files (.qm).

generateAll
flag indicating whether all translations should be released (boolean)

ProjectTranslationsBrowser.__releaseTSFileDone

__releaseTSFileDone(exitCode, exitStatus)

Private slot to handle the finished signal of the lrelease process.

ProjectTranslationsBrowser.__removeLanguageFile

__removeLanguageFile()

Private method to remove a translation from the project.

ProjectTranslationsBrowser.__showPopupMenu

__showPopupMenu()

Private slot called by the menu aboutToShow signal.

ProjectTranslationsBrowser.__showPopupMenuBack

__showPopupMenuBack()

Private slot called by the backMenu aboutToShow signal.

ProjectTranslationsBrowser.__showPopupMenuDir

__showPopupMenuDir()

Private slot called by the dirMenu aboutToShow signal.

ProjectTranslationsBrowser.__showPopupMenuMulti

__showPopupMenuMulti()

Private slot called by the multiMenu aboutToShow signal.

ProjectTranslationsBrowser.__writeTempProjectFile

__writeTempProjectFile(langs, filter)

Private method to write a temporary project file suitable for pylupdate and lrelease.

langs
list of languages to include in the process. An empty list (default) means that all translations should be included. (list of ProjectBrowserFileItem)
filter
list of source file extension that should be considered (list of strings)
Returns:
flag indicating success

ProjectTranslationsBrowser._createPopupMenus

_createPopupMenus()

Protected overloaded method to generate the popup menu.

ProjectTranslationsBrowser._showContextMenu

_showContextMenu(coord)

Protected slot to show the context menu.

coord
the position of the mouse pointer (QPoint)

ProjectTranslationsBrowser.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

Up