[gpsbabel] Ship translations for the GUI

Hans Ulrich Niedermann ndim at fedoraproject.org
Thu Jan 13 11:42:47 UTC 2011


commit 626465223b56d0a85be16550206bb326642df9b1
Author: Hans Ulrich Niedermann <hun at n-dimensional.de>
Date:   Tue Jan 11 22:24:10 2011 +0100

    Ship translations for the GUI
    
    Build and install the *.qm translation files.
    
    The gpsbabelfe-bin process finds the files and opens them, which is
    great. Unfortunately, this has no effect on the actual language the
    GUI shows. This needs fixing, eventually.

 gpsbabel.spec |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gpsbabel.spec b/gpsbabel.spec
index 51e7f45..fa4fdbe 100644
--- a/gpsbabel.spec
+++ b/gpsbabel.spec
@@ -29,6 +29,8 @@ Patch11:       gpsbabel-1.4.2-use-system-shapelib.patch
 Patch21:       gpsbabel-1.4.2-xmldoc.patch
 BuildRoot:     %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
+%global translationdir %{_datadir}/qt4/translations
+
 BuildRequires: expat-devel
 BuildRequires: libusb-devel
 BuildRequires: zlib-devel
@@ -75,6 +77,7 @@ make gpsbabel.html
 
 pushd gui
 qmake-qt4
+lrelease-qt4 *.ts
 make %{?_smp_mflags}
 popd
 
@@ -85,6 +88,8 @@ make -C gui DESTDIR=%{buildroot} install
 
 install -m 0755 -d                            %{buildroot}%{_bindir}/
 install -m 0755 -p gui/objects/gpsbabelfe-bin %{buildroot}%{_bindir}/
+install -m 0755 -d                            %{buildroot}%{translationdir}/
+install -m 0644 -p gui/gpsbabel*_*.qm         %{buildroot}%{translationdir}/
 
 desktop-file-install \
         --dir %{buildroot}/%{_datadir}/applications \
@@ -93,6 +98,8 @@ desktop-file-install \
 install -m 0755 -d            %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
 install -m 0644 -p %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
 
+%find_lang %{name} --with-qt --all-name
+
 %clean
 rm -rf %{buildroot}
 
@@ -114,7 +121,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %doc gpsbabel.html gpsbabel.org-style3.css
 %{_bindir}/gpsbabel
 
-%files gui
+%files gui -f %{name}.lang
 %defattr(-,root,root,-)
 %doc gui/{AUTHORS,COPYING,README*,TODO}
 %{_bindir}/gpsbabelfe-bin


More information about the scm-commits mailing list