Commit 85640311 authored by Yves Gesnel's avatar Yves Gesnel
Browse files

Version mac: amélioration de la traduction et optimisation du bundle

parent 55037de8
......@@ -43,7 +43,7 @@ MANIFEST-all := $(MANIFEST) \
include Makefile \n
# Unix:
MANIFEST-unix := $(MANIFEST-min) \
exclude data/macmenu_fr.qm \n\
exclude data/qtmac_fr.qm \n\
exclude data/images/pyromaths.icns \n\
exclude data/images/pyromaths.ico \n
# Mac app:
......@@ -54,7 +54,7 @@ MANIFEST-mac := $(MANIFEST-min) \
# Win app:
MANIFEST-win := $(MANIFEST-min) \
prune data/linux \n\
exclude data/macmenu_fr.qm \n\
exclude data/qtmac_fr.qm \n\
exclude data/images/pyromaths.icns \n
### SHORTCUTS & COMPATIBILITY
......@@ -175,17 +175,11 @@ repo: deb
app: version
# Make standalone Mac application
$(clean)
$(setup) py2app -b $(BUILD) -d $(DIST) $(OUT)
cd $(PYRO)/data && lrelease macmenu_fr.ts
$(setup) py2app -O2 -b $(BUILD) -d $(DIST) $(OUT)
# ..Clean-up unnecessary files/folders
rm -f $(APP)/PkgInfo
cd $(APP)/Resources && rm -rf include lib/python2.*/config lib/python2.*/site.pyc
cd $(APP)/Resources/lib/python2.*/lib-dynload &&\
rm -f _AE.so _codecs_cn.so _codecs_hk.so _codecs_iso2022.so \
_codecs_jp.so _codecs_kr.so _codecs_tw.so _Evt.so _File.so \
_hashlib.so _heapq.so _locale.so _multibytecodec.so _Res.so \
_ssl.so array.so bz2.so cPickle.so datetime.so gestalt.so \
MacOS.so pyexpat.so resource.so strop.so unicodedata.so \
PyQt4/Qt.so
cd $(APP)/Resources && rm -rf site.pyc include lib/python2.*/config lib/python2.*/site.pyc
cd $(APP)/Frameworks &&\
rm -rf *.framework/Contents *.framework/Versions/4.0 \
*.framework/Versions/Current *.framework/*.prl \
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr">
<context>
<name>MAC_APPLICATION_MENU</name>
<message>
<source>Services</source>
<translation>Services</translation>
</message>
<message>
<source>Hide %1</source>
<translation>Masquer %1</translation>
</message>
<message>
<source>Hide Others</source>
<translation>Masquer les autres</translation>
</message>
<message>
<source>Show All</source>
<translation>Tout afficher</translation>
</message>
<message>
<source>Preferences...</source>
<translation>Préférences...</translation>
</message>
<message>
<source>Quit %1</source>
<translation>Quitter %1</translation>
</message>
<message>
<source>About %1</source>
<translation>À propos de %1</translation>
</message>
</context>
<context>
<name>QFileDialog</name>
<message>
<source>&amp;Choose</source>
<translation>&amp;Choisir</translation>
</message>
<name>QFileDialog</name>
<message>
<source>&amp;Save</source>
<translation>Enregistrer</translation>
</message>
</context>
<context>
<name>QDialogButtonBox</name>
<message>
<source>Cancel</source>
<translation>Annuler</translation>
</message>
</context>
</TS>
\ No newline at end of file
......@@ -78,22 +78,37 @@ def _mac_opt():
'QtMultimedia', 'QtNetwork', 'QtOpenGL', 'QtScript',
'QtScriptTools', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit',
'QtXml', 'QtXmlPatterns', 'phonon']
lib_dynload_unused = ['_AE', '_codecs_cn', '_codecs_hk', '_codecs_2022',
'_codecs_iso2022', '_codecs_jp', '_codecs_kr',
'_codecs_tw', '_Evt', '_File', '_hashlib', '_heapq',
'_locale', '_multibytecodec', '_Res','_ssl', 'array',
'bz2', 'cPickle', 'datetime', 'gestalt', 'MacOS',
'pyexpat', 'rurce', 'strop', 'unicodedata']
site_packages_unused = ['_osx_support', '_builtinSuites', 'Carbon',
'distutils', 'Finder', 'StdSuites', 'unittest',
'xml', 'StringIO', 'getopt', 'repr','_strptime',
'gettext', 'sets', '_threading_local', 'glob',
'base64', 'locale', 'sre', 'bdb', 'optparse.',
'ssl', 'calendar', 'pdb', 'stringprep', 'cmd',
'pkg_resources' 'tempfile','copy', 'pkgutil',
'textwrap', 'difflib', 'platform', 'threading',
'dummy_thread', 'plistlib', 'quopri', 'fnmatch',
'pprint']
excludes = lib_dynload_unused + site_packages_unused + ['PyQt4.%s' % f for f in qt_unused]
# py2app
py2app = dict(plist = plist,
iconfile = 'data/images/pyromaths.icns',
includes = ['gzip'],
excludes = ['PyQt4.%s' % f for f in qt_unused],
dylib_excludes = qt_unused,
excludes = excludes,
argv_emulation = True,
)
return dict(
app = ['src/pyromaths.py'],
data_files = [
( 'data', ['data/macmenu_fr.qm']),
( 'data', ['data/qtmac_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/*')),
],
......
......@@ -58,11 +58,11 @@ def main():
app = QtGui.QApplication(argv)
pyromaths = StartQT4()
# Intégration de QTranslator
from PyQt4.QtCore import QTranslator
translator = QTranslator()
translator.load("macmenu_fr", "data")
translator.load("qtmac_fr", "data")
app.installTranslator(translator)
pyromaths.show()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment