]> git.saurik.com Git - wxWidgets.git/commitdiff
Translate '&Help' to '&' for italian Windows only
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 12 Aug 2005 15:29:57 +0000 (15:29 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 12 Aug 2005 15:29:57 +0000 (15:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

Makefile.in
build/bakefiles/wx.bkl
docs/tech/tn0002.txt
locale/Makefile
locale/msw/it.po [new file with mode: 0644]
src/common/intl.cpp
src/generic/mdig.cpp
src/msw/mdi.cpp

index 7368fe137c5c36ee04c9cf7e9b0cc1617b863fa7..95da87e5cd1b3b455fff3cb5bbbdd2760de74454 100644 (file)
@@ -1173,6 +1173,7 @@ SOUND_SDL_CXXFLAGS = -DWXUSINGDLL -DwxUSE_GUI=0 $(PIC_FLAG) $(CPPFLAGS) \
 SOUND_SDL_OBJECTS =  \
        sound_sdl_sound_sdl.o
 LOCALE_LINGUAS = ca cs da de el es fi fr hu id it ja nl pl ru sl sv tr uk zh zh_CN zh_TW
+LOCALE_MSW_LINGUAS =  it
 
 ### Conditionally set variables: ###
 
@@ -9144,7 +9145,7 @@ COND_WXUSE_REGEX_BUILTIN___LIB_REGEX_p = \
 
 all: $(__wxregex___depname) $(__wxzlib___depname) $(__wxpng___depname) $(__wxjpeg___depname) $(__wxtiff___depname) $(__wxodbc___depname) $(__wxexpat___depname) $(__monodll___depname) $(__monolib___depname) $(__basedll___depname) $(__baselib___depname) $(__netdll___depname) $(__netlib___depname) $(__coredll___depname) $(__corelib___depname) $(__advdll___depname) $(__advlib___depname) $(__mediadll___depname) $(__medialib___depname) $(__odbcdll___depname) $(__odbclib___depname) $(__dbgriddll___depname) $(__dbgridlib___depname) $(__htmldll___depname) $(__htmllib___depname) $(__qadll___depname) $(__qalib___depname) $(__xmldll___depname) $(__xmllib___depname) $(__xrcdll___depname) $(__xrclib___depname) $(__gldll___depname) $(__gllib___depname) $(__sound_sdl___depname) $(__wxrc___depname) $(__cocoa_res___depname)
 
-install: all $(__install_wxregex___depname) $(__install_wxzlib___depname) $(__install_wxpng___depname) $(__install_wxjpeg___depname) $(__install_wxtiff___depname) $(__install_wxodbc___depname) $(__install_wxexpat___depname) $(__install_monodll___depname) $(__install_monolib___depname) $(__install_basedll___depname) $(__install_baselib___depname) $(__install_netdll___depname) $(__install_netlib___depname) $(__install_coredll___depname) $(__install_corelib___depname) $(__install_advdll___depname) $(__install_advlib___depname) $(__install_mediadll___depname) $(__install_medialib___depname) $(__install_odbcdll___depname) $(__install_odbclib___depname) $(__install_dbgriddll___depname) $(__install_dbgridlib___depname) $(__install_htmldll___depname) $(__install_htmllib___depname) $(__install_qadll___depname) $(__install_qalib___depname) $(__install_xmldll___depname) $(__install_xmllib___depname) $(__install_xrcdll___depname) $(__install_xrclib___depname) $(__install_gldll___depname) $(__install_gllib___depname) $(__install_sound_sdl___depname) $(__install_wxrc___depname) install-wxconfig locale_install $(__cocoa_res_install___depname)
+install: all $(__install_wxregex___depname) $(__install_wxzlib___depname) $(__install_wxpng___depname) $(__install_wxjpeg___depname) $(__install_wxtiff___depname) $(__install_wxodbc___depname) $(__install_wxexpat___depname) $(__install_monodll___depname) $(__install_monolib___depname) $(__install_basedll___depname) $(__install_baselib___depname) $(__install_netdll___depname) $(__install_netlib___depname) $(__install_coredll___depname) $(__install_corelib___depname) $(__install_advdll___depname) $(__install_advlib___depname) $(__install_mediadll___depname) $(__install_medialib___depname) $(__install_odbcdll___depname) $(__install_odbclib___depname) $(__install_dbgriddll___depname) $(__install_dbgridlib___depname) $(__install_htmldll___depname) $(__install_htmllib___depname) $(__install_qadll___depname) $(__install_qalib___depname) $(__install_xmldll___depname) $(__install_xmllib___depname) $(__install_xrcdll___depname) $(__install_xrclib___depname) $(__install_gldll___depname) $(__install_gllib___depname) $(__install_sound_sdl___depname) $(__install_wxrc___depname) install-wxconfig locale_install locale_msw_install $(__cocoa_res_install___depname)
        $(INSTALL_DIR) $(DESTDIR)$(datadir)/aclocal
        (cd $(srcdir) ; $(INSTALL_DATA)  wxwin.m4 $(DESTDIR)$(datadir)/aclocal)
        $(INSTALL_DIR) $(DESTDIR)$(libdir)/wx/include/$(TOOLCHAIN_FULLNAME)/wx
@@ -9695,6 +9696,16 @@ locale_install:
        fi ; \
        done
 
+locale_msw_install: 
+       $(INSTALL_DIR) $(DESTDIR)$(datadir)/locale
+       for l in $(LOCALE_MSW_LINGUAS) ; do \
+       $(INSTALL_DIR) $(DESTDIR)$(datadir)/locale/$$l ; \
+       $(INSTALL_DIR) $(DESTDIR)$(datadir)/locale/$$l/LC_MESSAGES ; \
+       if test -f $(srcdir)/locale/msw/$$l.mo ; then \
+       $(INSTALL_DATA) $(srcdir)/locale/msw/$$l.mo $(DESTDIR)$(datadir)/locale/$$l/LC_MESSAGES/wxmsw.mo ; \
+       fi ; \
+       done
+
 @COND_TOOLKIT_COCOA@lib/libwx_$(TOOLCHAIN_NAME).0.r: 
 @COND_TOOLKIT_COCOA@   $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/cocoa/dummy.r -o lib/libwx_$(TOOLCHAIN_NAME).0.rsrc
 @COND_TOOLKIT_COCOA@   $(DEREZ) lib/libwx_$(TOOLCHAIN_NAME).0.rsrc -useDF >lib/libwx_$(TOOLCHAIN_NAME).0.r
index ffd449f90b5d1b128c4e2427cd76e5b823474d6a..a8b8128d921f7a14915abc7e16cf664677f91d95 100644 (file)
             </linguas>
             <install-to>$(LOCALEDIR)</install-to>
         </gettext-catalogs>
+        <gettext-catalogs id="locale_msw">
+            <srcdir>$(SRCDIR)/locale/msw</srcdir>
+            <catalog-name>wxmsw</catalog-name>
+            <linguas>it</linguas>
+            <install-to>$(LOCALEDIR)</install-to>
+        </gettext-catalogs>
+                
 
         <!-- Mac OS X resources: -->
         <set var="MACOS_R">lib/libwx_$(TOOLCHAIN_NAME).$(WXSOVERSION[0]).r</set>
index 9568ee628ae7f4212a94a200ab3ab64e3cf11848..694a67d85f5e5655d5a0e5ea85af632d317ee751 100644 (file)
@@ -59,12 +59,30 @@ them). Then type "make lang.mo" which will create the binary message catalog.
 Under Windows (If you don't have Cygwin or MinGW), you should execute the
 commands manually, please have a look at Makefile to see what must be done.
 
+For platform specific translations, .po files such as 'locale/msw/it.po' can be
+used to provide translations that override the usual ones in 'locale/it.po'.
+The genaterated .mo files are then installed under the names such as 'wxmsw.mo'
+alongside the generic 'wxstd.mo'.
+
+A new platform specific translation should be added to a section such as this
+in wx.bkl:
+
+    <gettext-catalogs id="locale_msw">
+        <srcdir>$(SRCDIR)/locale/msw</srcdir>
+        <catalog-name>wxmsw</catalog-name>
+        <linguas>it</linguas>
+        <install-to>$(LOCALEDIR)</install-to>
+    </gettext-catalogs>
+
 === EOF ===
 
 Author:  VZ
 Version: $Id$
 
 $Log$
+Revision 1.6  2005/08/12 15:29:47  MW
+Translate '&Help' to '&' for italian Windows only
+
 Revision 1.5  2004/10/22 19:12:59  KH
 *** empty log message ***
 
index 2adfdd9d32fdb59e357c5dd218c5b699a2cce930..448c6c18ea6ca74503e449cdb588cb3de2b768d0 100644 (file)
@@ -7,7 +7,7 @@
 # being called with this dir as the cwd, but if we generate this file
 # with configure an explicit path should be specified -- RL.
 
-WX_LINGUAS := `ls *.po 2> /dev/null | sed -n 's/\(wxstd\)\?\.po//p'`
+WX_LINGUAS := `ls *.po */*.po 2> /dev/null | sed -n 's/\(wxstd\)\?\.po//p'`
 
 # the programs we use (TODO: use configure to detect them)
 MSGFMT=msgfmt --verbose
diff --git a/locale/msw/it.po b/locale/msw/it.po
new file mode 100644 (file)
index 0000000..c132389
--- /dev/null
@@ -0,0 +1,16 @@
+# wxMSW specific overrides for it.po
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: $Id$\n"
+"POT-Creation-Date: 2005-08-12 14:23:42+0100\n"
+"PO-Revision-Date: 2005-08-12 14:23:42+0100\n"
+"Last-Translator: Mike Wetherell <mike.wetherell@ntlworld.com>\n"
+"Language-Team: wxWidgets translators <wx-translators@lists.wxwidgets.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# The help menu is called just '?' on Italian versions of Windows
+msgid "&Help"
+msgstr "&?"
index 8aeb57fbe9f90edf4c1ee4aedff8be694abab5c7..1f360d9a5a4d7c3c966ea1c6cd52ae6a7bb2d753 100644 (file)
@@ -79,6 +79,8 @@
 #include "wx/encconv.h"
 #include "wx/hashmap.h"
 #include "wx/ptr_scpd.h"
+#include "wx/app.h"
+#include "wx/apptrait.h"
 
 #if defined(__WXMAC__)
   #include  "wx/mac/private.h"  // includes mac headers
@@ -1470,8 +1472,19 @@ bool wxLocale::Init(const wxChar *szName,
   m_pMsgCat = NULL;
   bool bOk = true;
   if ( bLoadDefault )
+  {
     bOk = AddCatalog(wxT("wxstd"));
 
+    // there may be a catalog with toolkit specific overrides, it is not
+    // an error if this does not exist
+    if ( bOk && wxTheApp )
+    {
+      wxAppTraits *traits = wxTheApp->GetTraits();
+      if (traits)
+        AddCatalog(traits->GetToolkitInfo().name.BeforeFirst(wxT('/')).MakeLower());
+    }
+  }
+
   return bOk;
 }
 
index 7e950d05425573cc02c7333b181b73624ee0ad62..b2ad4fd4e2468b82c00eed5341b79de7e5556243 100644 (file)
@@ -307,7 +307,7 @@ void wxGenericMDIParentFrame::AddWindowMenu(wxMenuBar *pMenuBar)
 {
     if (pMenuBar && m_pWindowMenu)
     {
-        int pos = pMenuBar->FindMenu(_("Help"));
+        int pos = pMenuBar->FindMenu(wxStripMenuCodes(wxString(_("&Help"))));
         if (pos == wxNOT_FOUND)
         {
             pMenuBar->Append(m_pWindowMenu, _("&Window"));
index b52982d10d567b46aaf454d612d7d4c80c96f9a4..dad11b4bcd85680438a95f81a504f2a342536141 100644 (file)
@@ -1401,8 +1401,9 @@ static void InsertWindowMenu(wxWindow *win, WXHMENU menu, HMENU subMenu)
                 continue;
             }
 
-
-            if ( wxStripMenuCodes(wxString(buf)).IsSameAs(_("Help")) )
+            wxString strHelp(_("&Help"));
+            wxString strBuf(buf);
+            if ( wxStripMenuCodes(strBuf) == wxStripMenuCodes(strHelp) )
             {
                 success = true;
                 ::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,