Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pyromaths
pyromaths
Commits
45f81080
Commit
45f81080
authored
May 14, 2013
by
Yves Gesnel
Browse files
Version mac : traduction du menu Pyromaths
parent
ef237acd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
45f81080
...
...
@@ -43,6 +43,7 @@ MANIFEST-all := $(MANIFEST) \
include Makefile
\n
# Unix:
MANIFEST-unix
:=
$
(
MANIFEST-min
)
\
exclude data/macmenu_fr.qm
\n\
exclude data/images/pyromaths.icns
\n\
exclude data/images/pyromaths.ico
\n
# Mac app:
...
...
@@ -53,6 +54,7 @@ MANIFEST-mac := $(MANIFEST-min) \
# Win app:
MANIFEST-win
:=
$
(
MANIFEST-min
)
\
prune data/linux
\n\
exclude data/macmenu_fr.qm
\n\
exclude data/images/pyromaths.icns
\n
### SHORTCUTS & COMPATIBILITY
...
...
@@ -173,25 +175,7 @@ repo: deb
app
:
version
# Make standalone Mac application
$(clean)
echo
"
$
(MANIFEST-mac)"
>
MANIFEST.in
$(setup)
py2app
-b
$(BUILD)
-d
$(DIST)
$(OUT)
# ..Improve french localization..."
# ....Extract strings from qt_menu.nib
cd
$(DIST)
&&
\
ibtool
--generate-strings-file
qt_menu.strings
\
$(APP)
/Frameworks/QtGui.framework/Versions/4/Resources/qt_menu.nib
&&
\
iconv
-f
utf-16
-t
utf-8 qt_menu.strings
>
qt_menu_tmp.strings
&&
\
mv
-f
qt_menu_tmp.strings qt_menu.strings
&&
\
$
(
sed-i
)
's/Hide/Masquer/g'
qt_menu.strings
&&
\
$
(
sed-i
)
's/Others/les autres/g'
qt_menu.strings
&&
\
$
(
sed-i
)
's/Show All/Tout afficher/g'
qt_menu.strings
&&
\
$
(
sed-i
)
's/Quit/Quitter/g'
qt_menu.strings
# ....Import french strings
cd
$(APP)
/Frameworks/QtGui.framework/Versions/4/Resources
&&
\
ibtool
--strings-file
$(DIST)
/qt_menu.strings
\
--write
qt_menu_french.nib qt_menu.nib
&&
\
rm
-rf
qt_menu.nib
&&
mv
qt_menu_french.nib qt_menu.nib
rm
$(DIST)
/qt_menu.strings
# ..Clean-up unnecessary files/folders
rm
-f
$(APP)
/PkgInfo
cd
$(APP)
/Resources
&&
rm
-rf
include lib/python2.
*
/config lib/python2.
*
/site.pyc
...
...
setup.py
View file @
45f81080
...
...
@@ -88,7 +88,15 @@ def _mac_opt():
)
return
dict
(
app
=
[
'src/pyromaths.py'
],
data_files
=
[(
'data'
,
glob
(
'data/*'
))],
data_files
=
[
(
'data'
,
[
'data/macmenu_fr.qm'
]),
(
'data/images'
,
[
'data/images/pyromaths.png'
,
'data/images/whatsthis.png'
]),
(
'data/images/vignettes'
,
glob
(
'data/images/vignettes/*.png'
)),
(
'data/macmenu_fr.qm'
),
(
'data/templates'
,
glob
(
'data/templates/*.tex'
)),
(
'data/packages'
,
glob
(
'data/packages/*'
)),
],
setup_requires
=
[
'py2app>=0.7.3'
,
'lxml>=2.2.2'
],
options
=
{
'py2app'
:
py2app
},
)
...
...
src/pyromaths/interface.py
View file @
45f81080
...
...
@@ -309,6 +309,7 @@ class Ui_MainWindow(object):
self
.
action_a_propos
=
QtGui
.
QAction
(
MainWindow
)
self
.
action_a_propos
.
setText
(
u
"À propos"
)
self
.
action_a_propos
.
setMenuRole
(
QtGui
.
QAction
.
AboutRole
)
self
.
menuFichier
.
addAction
(
self
.
actionTous_les_exercices
)
self
.
menuFichier
.
addSeparator
()
...
...
src/pyromaths/pyromaths.py
View file @
45f81080
...
...
@@ -58,6 +58,12 @@ def main():
app
=
QtGui
.
QApplication
(
argv
)
pyromaths
=
StartQT4
()
# Intégration de QTranslator
from
PyQt4.QtCore
import
QTranslator
translator
=
QTranslator
()
translator
.
load
(
"macmenu_fr"
,
"data"
)
app
.
installTranslator
(
translator
)
pyromaths
.
show
()
test
(
pyromaths
)
...
...
Write
Preview
Supports
Markdown
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