The window title for preferences broken by accelerators in the menu

Started by eumagga0x2a, August 21, 2016, 10:00:22 PM

Previous topic - Next topic

eumagga0x2a

The accelerator for the "Preferences" menu item introduced by me in the German and English translation has broken the window title for the preferences window for these locales, my apologies  :-[

It seems that in the past, menu items had their own context "mainMenu", but subsequently everything became "adm". This leads to problems when the same string is used both as a menu item and as a window title, once menus get enhanced by accelerators. A future-proof solution would probably require a return to a special context for menu items with resulting massive changes to translations, but for now I would suggest just adding an accelerator to the "Preferences" string in myOwnMenu.h to keep different usages of the string apart:

diff --git a/avidemux/common/ADM_commonUI/myOwnMenu.h b/avidemux/common/ADM_commonUI/myOwnMenu.h
index f572f31..fb29e07 100644
--- a/avidemux/common/ADM_commonUI/myOwnMenu.h
+++ b/avidemux/common/ADM_commonUI/myOwnMenu.h
@@ -60,7 +60,7 @@ static const MenuEntry _myMenuEdit[] = {
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),       NULL,ACT_MarkA      ,NULL,"Ctrl+PgUp"},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),       NULL,ACT_MarkB      ,NULL,"Ctrl+PgDown"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,       NULL},
-            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Preferences"),        NULL,ACT_PREFERENCES,NULL,NULL},
+            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Pr&eferences"),       NULL,ACT_PREFERENCES,NULL,NULL},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Save current settings as default"), NULL,ACT_SaveAsDefault,NULL,NULL},
         };


This still requires minor changes to translations. Here is the patch for all languages (each tested) exposed in the GUI:

diff --git a/avidemux/qt4/i18n/avidemux_da.ts b/avidemux/qt4/i18n/avidemux_da.ts
index c77b7e9..06d01a9 100644
--- a/avidemux/qt4/i18n/avidemux_da.ts
+++ b/avidemux/qt4/i18n/avidemux_da.ts
@@ -990,6 +990,10 @@ Drop timinginformationer?</translation>
         <translation>Sæt markør B</translation>
     </message>
     <message>
+        <source>Pr&amp;eferences</source>
+        <translation>Præferencer</translation>
+    </message>
+    <message>
         <source>Preferences</source>
         <translation>Præferencer</translation>
     </message>
diff --git a/avidemux/qt4/i18n/avidemux_de.ts b/avidemux/qt4/i18n/avidemux_de.ts
index a73bc5b..3d82ee0 100644
--- a/avidemux/qt4/i18n/avidemux_de.ts
+++ b/avidemux/qt4/i18n/avidemux_de.ts
@@ -7111,10 +7111,14 @@ Drop timing informations ?</source>
         <translation>Standardport</translation>
     </message>
     <message>
-        <source>Preferences</source>
+        <source>Pr&amp;eferences</source>
         <translation>&amp;Einstellungen</translation>
     </message>
     <message>
+        <source>Preferences</source>
+        <translation>Einstellungen</translation>
+    </message>
+    <message>
         <source>Open</source>
         <translation>Ãâ€"&amp;ffnen...</translation>
     </message>
diff --git a/avidemux/qt4/i18n/avidemux_en.ts b/avidemux/qt4/i18n/avidemux_en.ts
index 9c8bf20..f71e5ef 100644
--- a/avidemux/qt4/i18n/avidemux_en.ts
+++ b/avidemux/qt4/i18n/avidemux_en.ts
@@ -1065,10 +1065,6 @@ Drop timing informations ?</source>
         <translation>Set Marker &amp;B</translation>
     </message>
     <message>
-        <source>Preferences</source>
-        <translation>Pr&amp;eferences</translation>
-    </message>
-    <message>
         <source>Save current settings as default</source>
         <translation>Save current settings as de&amp;fault</translation>
     </message>
diff --git a/avidemux/qt4/i18n/avidemux_es.ts b/avidemux/qt4/i18n/avidemux_es.ts
index 2d6c46b..3ba627b 100644
--- a/avidemux/qt4/i18n/avidemux_es.ts
+++ b/avidemux/qt4/i18n/avidemux_es.ts
@@ -5723,6 +5723,10 @@ Drop timing informations ?</source>
         <translation type="unfinished">Hilos</translation>
     </message>
     <message>
+        <source>Pr&amp;eferences</source>
+        <translation type="unfinished">Preferencias</translation>
+    </message>
+    <message>
         <source>Preferences</source>
         <translation type="unfinished">Preferencias</translation>
     </message>
diff --git a/avidemux/qt4/i18n/avidemux_fr.ts b/avidemux/qt4/i18n/avidemux_fr.ts
index f8f30ca..bc95af9 100644
--- a/avidemux/qt4/i18n/avidemux_fr.ts
+++ b/avidemux/qt4/i18n/avidemux_fr.ts
@@ -1934,12 +1934,16 @@ Ignorer les informations de timing ?</translation>
         <translation type="unfinished">Mettre le marqueur B</translation>
     </message>
     <message>
-        <location filename="../../common/ADM_commonUI/DIA_prefs.cpp" line="488"/>
-        <location filename="../../common/ADM_commonUI/myOwnMenu.h" line="64"/>
+        <location filename="../../common/ADM_commonUI/DIA_prefs.cpp" line="491"/>
         <source>Preferences</source>
         <translation></translation>
     </message>
     <message>
+        <location filename="../../common/ADM_commonUI/myOwnMenu.h" line="63"/>
+        <source>Pr&amp;eferences</source>
+        <translation></translation>
+    </message>
+    <message>
         <location filename="../../common/ADM_commonUI/myOwnMenu.h" line="70"/>
         <source>Decoder Option</source>
         <translation type="unfinished">Option du décodeur</translation>
diff --git a/avidemux/qt4/i18n/avidemux_hu.ts b/avidemux/qt4/i18n/avidemux_hu.ts
index 11a660c..158faa2 100644
--- a/avidemux/qt4/i18n/avidemux_hu.ts
+++ b/avidemux/qt4/i18n/avidemux_hu.ts
@@ -1094,6 +1094,10 @@ Eldobjuk ezeket az idÃ...‘szinkron adatokat ?</translation>
         <translation>Szálak</translation>
     </message>
     <message>
+        <source>Pr&amp;eferences</source>
+        <translation>Beállítások</translation>
+    </message>
+    <message>
         <source>Preferences</source>
         <translation>Beállítások</translation>
     </message>
diff --git a/avidemux/qt4/i18n/avidemux_it.ts b/avidemux/qt4/i18n/avidemux_it.ts
index 9f37a8b..6afc598 100644
--- a/avidemux/qt4/i18n/avidemux_it.ts
+++ b/avidemux/qt4/i18n/avidemux_it.ts
@@ -8098,6 +8098,10 @@ DEI TERMINI E DELLE CONDIZIONI&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
         <translation>Threading</translation>
     </message>
     <message>
+        <source>Pr&amp;eferences</source>
+        <translation>Preferenze</translation>
+    </message>
+    <message>
         <source>Preferences</source>
         <translation>Preferenze</translation>
     </message>
diff --git a/avidemux/qt4/i18n/avidemux_pl.ts b/avidemux/qt4/i18n/avidemux_pl.ts
index 22cafd9..ca08b6f 100644
--- a/avidemux/qt4/i18n/avidemux_pl.ts
+++ b/avidemux/qt4/i18n/avidemux_pl.ts
@@ -5953,6 +5953,10 @@ chcesz kontynuowaÃ,,‡ mimo to?</translation>
         <translation type="unfinished">WÃ,,…tkowanie</translation>
     </message>
     <message>
+        <source>Pr&amp;eferences</source>
+        <translation type="unfinished">Preferencje</translation>
+    </message>
+    <message>
         <source>Preferences</source>
         <translation type="unfinished">Preferencje</translation>
     </message>
diff --git a/avidemux/qt4/i18n/avidemux_ru.ts b/avidemux/qt4/i18n/avidemux_ru.ts
index aecb902..13c11a8 100644
--- a/avidemux/qt4/i18n/avidemux_ru.ts
+++ b/avidemux/qt4/i18n/avidemux_ru.ts
@@ -4510,6 +4510,10 @@ Drop timing informations ?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Pr&amp;eferences</source>
+        <translation type="unfinished">СвойÃ'Ã'‚ва</translation>
+    </message>
+    <message>
         <source>Preferences</source>
         <translation type="unfinished">СвойÃ'Ã'‚ва</translation>
     </message>


Sorry for inconvenience!