Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
40546f9a
Commit
40546f9a
authored
Apr 20, 2009
by
Oswald Buddenhagen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load translations
parent
067bab07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
src/app/main.cpp
src/app/main.cpp
+26
-0
src/plugins/designer/formeditorplugin.cpp
src/plugins/designer/formeditorplugin.cpp
+11
-0
src/plugins/help/helpplugin.cpp
src/plugins/help/helpplugin.cpp
+10
-0
No files found.
src/app/main.cpp
View file @
40546f9a
...
...
@@ -38,6 +38,9 @@
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
#include <QtCore/QTimer>
#include <QtCore/QLibraryInfo>
#include <QtCore/QTranslator>
#include <QtCore/QVariant>
#include <QtGui/QMessageBox>
#include <QtGui/QApplication>
...
...
@@ -197,6 +200,12 @@ static inline QStringList getPluginPaths()
return
rc
;
}
#ifdef Q_OS_MAC
# define SHARE_PATH "/../Resources"
#else
# define SHARE_PATH "/../share/qtcreator"
#endif
int
main
(
int
argc
,
char
**
argv
)
{
#ifdef Q_OS_DARWIN
...
...
@@ -208,6 +217,23 @@ int main(int argc, char **argv)
#endif
SharedTools
::
QtSingleApplication
app
((
QLatin1String
(
appNameC
)),
argc
,
argv
);
QTranslator
translator
;
QTranslator
qtTranslator
;
const
QString
&
locale
=
QLocale
::
system
().
name
();
if
(
translator
.
load
(
QLatin1String
(
"qtcreator_"
)
+
locale
,
QCoreApplication
::
applicationDirPath
()
+
QLatin1String
(
SHARE_PATH
"/translations"
)))
{
if
(
qtTranslator
.
load
(
QLatin1String
(
"qt_"
)
+
locale
,
QLibraryInfo
::
location
(
QLibraryInfo
::
TranslationsPath
)))
{
app
.
installTranslator
(
&
translator
);
app
.
installTranslator
(
&
qtTranslator
);
app
.
setProperty
(
"qtc_locale"
,
locale
);
}
else
{
translator
.
load
(
QString
());
// unload()
}
}
// Load
ExtensionSystem
::
PluginManager
pluginManager
;
pluginManager
.
setFileExtension
(
QLatin1String
(
"pluginspec"
));
...
...
src/plugins/designer/formeditorplugin.cpp
View file @
40546f9a
...
...
@@ -44,9 +44,12 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QtPlugin>
#include <QtCore/QDebug>
#include <QtCore/QProcess>
#include <QtCore/QLibraryInfo>
#include <QtCore/QTranslator>
#ifdef CPP_ENABLED
# include <QtGui/QAction>
...
...
@@ -115,6 +118,14 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
FormEditorW
::
ensureInitStage
(
FormEditorW
::
RegisterPlugins
);
}
QString
locale
=
qApp
->
property
(
"qtc_locale"
).
toString
();
if
(
!
locale
.
isEmpty
())
{
QTranslator
*
qtr
=
new
QTranslator
(
this
);
qtr
->
load
(
QLatin1String
(
"designer_"
)
+
locale
,
QLibraryInfo
::
location
(
QLibraryInfo
::
TranslationsPath
));
qApp
->
installTranslator
(
qtr
);
}
error
->
clear
();
return
true
;
}
...
...
src/plugins/help/helpplugin.cpp
View file @
40546f9a
...
...
@@ -58,6 +58,8 @@
#include <QtCore/QSettings>
#include <QtCore/QDir>
#include <QtCore/QResource>
#include <QtCore/QLibraryInfo>
#include <QtCore/QTranslator>
#include <QtGui/QAction>
#include <QtGui/QShortcut>
#include <QtGui/QSplitter>
...
...
@@ -129,6 +131,14 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
QList
<
int
>
modecontext
;
modecontext
<<
m_core
->
uniqueIDManager
()
->
uniqueIdentifier
(
Constants
::
C_MODE_HELP
);
QString
locale
=
qApp
->
property
(
"qtc_locale"
).
toString
();
if
(
!
locale
.
isEmpty
())
{
QTranslator
*
qtr
=
new
QTranslator
(
this
);
qtr
->
load
(
QLatin1String
(
"assistant_"
)
+
locale
,
QLibraryInfo
::
location
(
QLibraryInfo
::
TranslationsPath
));
qApp
->
installTranslator
(
qtr
);
}
// FIXME shouldn't the help engine create the directory if it doesn't exist?
QFileInfo
fi
(
m_core
->
settings
()
->
fileName
());
QDir
directory
(
fi
.
absolutePath
()
+
"/qtcreator"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment