pidgin.next.minor: 04c6d35e: Add the ability to choose which translat...
datallah at pidgin.im
datallah at pidgin.im
Sat Nov 7 23:00:37 EST 2009
-----------------------------------------------------------------
Revision: 04c6d35ed800e8ea9c2683a7ec8ac819bbb4e63f
Ancestor: ef74fecb519cd6466b752c045ccc63a5056be58e
Author: datallah at pidgin.im
Date: 2009-11-08T03:53:07
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/04c6d35ed800e8ea9c2683a7ec8ac819bbb4e63f
Modified files:
Makefile.mingw pidgin/win32/nsis/pidgin-installer.nsi
ChangeLog:
Add the ability to choose which translations are installed.
-------------- next part --------------
============================================================
--- Makefile.mingw 63857aebc94e55aa6fa7ace02acb942f57503da1
+++ Makefile.mingw 89c72d20edd0a90c3cea3281b4cdf5eaf5b4bc6c
@@ -72,7 +72,7 @@ EXTERNAL_DLLS_FIND_EXP = $(patsubst %,-o
#build an expression for `find` to use to ignore the above files
EXTERNAL_DLLS_FIND_EXP = $(patsubst %,-o -name %,$(EXTERNAL_DLLS))
-.PHONY: all docs install installer installer_offline installer_zip debug_symbols_zip installers clean uninstall create_release_install_dir $(PIDGIN_REVISION_H) $(PIDGIN_REVISION_RAW_TXT)
+.PHONY: all docs install installer installer_offline installer_zip debug_symbols_zip installers clean uninstall create_release_install_dir generate_translations_installer_include $(PIDGIN_REVISION_H) $(PIDGIN_REVISION_RAW_TXT)
all: $(PIDGIN_CONFIG_H) $(PIDGIN_REVISION_H)
$(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE)
@@ -90,18 +90,25 @@ endif
$(MAKE) -C share/ca-certs -f $(MINGW_MAKEFILE) install
$(MAKE) -C share/sounds -f $(MINGW_MAKEFILE) install
+generate_translations_installer_include: create_release_install_dir
+ rm -f pidgin/win32/nsis/pidgin-translations.nsh
+ find $(STRIPPED_RELEASE_DIR)/locale -maxdepth 1 -mindepth 1 \
+ -exec basename {} ';' \
+ | sed -e s/^/\!insertmacro\ LANG_SECTION\ \"/ -e s/$$/\"/ \
+ > pidgin/win32/nsis/pidgin-translations.nsh
+
create_release_install_dir: install
rm -rf $(STRIPPED_RELEASE_DIR)
cp -R $(PIDGIN_INSTALL_DIR) $(STRIPPED_RELEASE_DIR)
find $(STRIPPED_RELEASE_DIR) \( -name '*.dll' -o -name '*.exe' \) \
- -not \( -false $(EXTERNAL_DLLS_FIND_EXP) \) -exec $(STRIP) --strip-unneeded {} ';'
+ -not \( -false $(EXTERNAL_DLLS_FIND_EXP) \) \
+ -exec $(STRIP) --strip-unneeded {} ';'
-installer: create_release_install_dir
-
+installer: create_release_install_dir generate_translations_installer_include
$(MAKENSIS) $(MAKENSISOPT)V3 $(MAKENSISOPT)DPIDGIN_VERSION="$(PIDGIN_VERSION)" $(MAKENSISOPT)DPIDGIN_PRODUCT_VERSION="$(PIDGIN_PRODUCT_VERSION)" $(MAKENSISOPT)DPIDGIN_INSTALL_DIR="$(STRIPPED_RELEASE_DIR)" $(MAKENSISOPT)DGTK_INSTALL_VERSION="$(GTK_INSTALL_VERSION)" pidgin/win32/nsis/pidgin-installer.nsi
mv pidgin/win32/nsis/pidgin-$(PIDGIN_VERSION).exe ./
-installer_offline: create_release_install_dir debug_symbols_zip
+installer_offline: create_release_install_dir generate_translations_installer_include debug_symbols_zip
$(MAKENSIS) $(MAKENSISOPT)V3 $(MAKENSISOPT)DPIDGIN_VERSION="$(PIDGIN_VERSION)" $(MAKENSISOPT)DPIDGIN_PRODUCT_VERSION="$(PIDGIN_PRODUCT_VERSION)" $(MAKENSISOPT)DOFFLINE_INSTALLER $(MAKENSISOPT)DPIDGIN_INSTALL_DIR="$(STRIPPED_RELEASE_DIR)" $(MAKENSISOPT)DGTK_INSTALL_VERSION="$(GTK_INSTALL_VERSION)" pidgin/win32/nsis/pidgin-installer.nsi
mv pidgin/win32/nsis/pidgin-$(PIDGIN_VERSION)-offline.exe ./
============================================================
--- pidgin/win32/nsis/pidgin-installer.nsi c9f6f835b6d81bedf0f9d3bead07656b5074daa6
+++ pidgin/win32/nsis/pidgin-installer.nsi 7bbce01ac6fbbf05eaced46884da0ce44e071669
@@ -35,6 +35,7 @@ SetDateSave on
!include "Sections.nsh"
!include "WinVer.nsh"
!include "LogicLib.nsh"
+!include "Memento.nsh"
!include "FileFunc.nsh"
!insertmacro GetParameters
@@ -73,6 +74,9 @@ SetDateSave on
!define ASPELL_REG_KEY "SOFTWARE\Aspell"
!define DOWNLOADER_URL "http://pidgin.im/win32/download_redir.php"
+!define MEMENTO_REGISTRY_ROOT HKLM
+!define MEMENTO_REGISTRY_KEY "${PIDGIN_UNINSTALL_KEY}"
+
;--------------------------------
;Version resource
VIProductVersion "${PIDGIN_PRODUCT_VERSION}"
@@ -408,7 +412,7 @@ Section $(PIDGIN_SECTION_TITLE) SecPidgi
Delete "$INSTDIR\plugins\liboscar.dll"
Delete "$INSTDIR\plugins\libjabber.dll"
- File /r ..\..\..\${PIDGIN_INSTALL_DIR}\*.*
+ File /r /x locale ..\..\..\${PIDGIN_INSTALL_DIR}\*.*
File "${PIDGIN_INSTALLER_DEPS}\exchndl.dll"
; Check if Perl is installed, if so add it to the AppPaths
@@ -494,6 +498,22 @@ SectionGroupEnd
SectionGroupEnd
;--------------------------------
+;Translations
+
+!macro LANG_SECTION lang
+ ${MementoUnselectedSection} "${lang}" SecLang_${lang}
+ SetOutPath "$INSTDIR\locale\${lang}\LC_MESSAGES"
+ File /oname=pidgin.mo "..\..\..\${PIDGIN_INSTALL_DIR}\locale\${lang}\LC_MESSAGES\pidgin.mo"
+ SetOutPath "$INSTDIR"
+ ${MementoSectionEnd}
+!macroend
+SectionGroup $(TRANSLATIONS_SECTION_TITLE) SecTranslations
+ # pidgin-translations is generated based on the contents of the locale directory
+ !include "pidgin-translations.nsh"
+SectionGroupEnd
+${MementoSectionDone}
+
+;--------------------------------
;Spell Checking
SectionGroup /e $(PIDGIN_SPELLCHECK_SECTION_TITLE) SecSpellCheck
@@ -1199,6 +1219,8 @@ Function .onInit
DeleteRegValue HKCU "${OLD_GAIM_REG_KEY}" "Installer Language"
WriteRegStr HKCU "${PIDGIN_REG_KEY}" "Installer Language" "$R0"
+ ${MementoSectionRestore}
+
!insertmacro SetSectionFlag ${SecSpellCheck} ${SF_RO}
!insertmacro UnselectSection ${SecSpellCheck}
@@ -1310,6 +1332,13 @@ FunctionEnd
Pop $R0
FunctionEnd
+Function .onInstSuccess
+
+ ${MementoSectionSave}
+
+FunctionEnd
+
+
Function un.onInit
Call un.RunCheck
More information about the Commits
mailing list