Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calamares
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
Calamares
Commits
69d870a4
Commit
69d870a4
authored
Oct 14, 2016
by
Teo Mrnjavac
Browse files
Options
Downloads
Patches
Plain Diff
Preliminary work on translations support in dummypythonqt.
parent
b77b4ee7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/dummypythonqt/main.py
+16
-1
16 additions, 1 deletion
src/modules/dummypythonqt/main.py
with
16 additions
and
1 deletion
src/modules/dummypythonqt/main.py
+
16
−
1
View file @
69d870a4
...
@@ -22,6 +22,21 @@ import platform
...
@@ -22,6 +22,21 @@ import platform
from
PythonQt.QtGui
import
*
from
PythonQt.QtGui
import
*
# Set up translations.
# You may skip this if your Calamares module has no user visible strings.
# DO NOT install _ into the builtin namespace because each module loads
# its own catalog.
# DO use the gettext class-based API and manually alias _ as described in:
# https://docs.python.org/3.5/library/gettext.html#localizing-your-module
import
gettext
import
inspect
import
os
filename
=
inspect
.
getframeinfo
(
inspect
.
currentframe
()).
filename
path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
filename
))
t
=
gettext
.
translation
(
'
dummypythonqt
'
,
os
.
path
.
join
(
path
,
'
lang
'
))
_
=
t
.
lgettext
# Example Python ViewModule.
# Example Python ViewModule.
# A Python ViewModule is a Python program which defines a ViewStep class.
# A Python ViewModule is a Python program which defines a ViewStep class.
# This class must be marked with the @calamares_module decorator. A
# This class must be marked with the @calamares_module decorator. A
...
@@ -47,7 +62,7 @@ class DummyPythonQtViewStep():
...
@@ -47,7 +62,7 @@ class DummyPythonQtViewStep():
label
.
text
=
accumulator
label
.
text
=
accumulator
btn
=
QPushButton
()
btn
=
QPushButton
()
btn
.
setText
(
"
Click me!
"
)
btn
.
setText
(
_
(
"
Click me!
"
)
)
self
.
main_widget
.
layout
().
addWidget
(
btn
)
self
.
main_widget
.
layout
().
addWidget
(
btn
)
btn
.
connect
(
"
clicked(bool)
"
,
self
.
on_btn_clicked
)
btn
.
connect
(
"
clicked(bool)
"
,
self
.
on_btn_clicked
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment