Bug 109533 - Language change in phrases configuration tab doesn't work when clicking OK.
Summary: Language change in phrases configuration tab doesn't work when clicking OK.
Status: RESOLVED INTENTIONAL
Alias: None
Product: kmail
Classification: Applications
Component: templates (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-23 21:24 UTC by Jonas Widarsson
Modified: 2009-12-21 21:31 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Widarsson 2005-07-23 21:24:06 UTC
Version:           KMail 1.8.1 Using KDE 3.4.2 (compiled from SVN branch 3.4) (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc version 3.3.5  (Gentoo 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) 
OS:                Linux

Open Configuration dialog.
Chose Composer section and the Phrases tab
I have swedish selected. And I have several others installed too.
But if I select a different language and click OK, the change doesn't stick.

If I change phrases and switch language and click OK, changes to the 
phrases apply, but not the switch.

If I click "Apply", it works.
If I click "OK", language switch is ignored.

Compiled from svn 3.4 branch sometime near 20 july 2005. (a few days ago)
Comment 1 Olivier Fisette 2005-08-04 01:57:09 UTC
I can confirm this feature is broken. On my system, the selection keeps going back to English no matter what I do, and the phrases are always in French. So I always end up with things like:

    Le Wednesday, 3 August 2005 06:20 pm, vous avez écrit :

No matter what I change in the configuration dialog.
Comment 2 Jakub Suder 2005-11-05 12:17:54 UTC
I confirm it too. I'm using KDE 3.4.2 on Fedora 4.

I'm Polish, so I chose Polish as the main language in KDE. But in Kmail, I wanted the phrases to be in English (in Polish it always adds "... napisałeś" (you wrote), while it should be "napisałeś" for men, and "napisałaś" for women ;) so i decided it will be better to set those phrases to English, as they're the same for both genders :).

So, I opened the settings dialog, and went to composer/phrases. In combo there was only Polish, and Polish phrases below ("Dnia %D, napisałeś:"). I added English, selected it in combo and pressed Ok. Then I press reply, and what I see? "Dnia piątek, 4 listopada 2005 14:25, napisałeś:". I go to the configuration dialog, and there is even no English in the combo.

So this time after selecting it, I pressed apply and then Ok. (apply then cancel doesn't work neither). There was a change, I must admit; it added to the mail "Dnia Friday 04 of November 2005 14:25, napisałeś:". So it changed the name of the day to English, but the rest stayed Polish (like the French/English mix Olivier wrote about above). Now when I go to the settings, English is selected, there are English phrases in the text fields below (On %D, you wrote:), but it still doesn't work. When I press reply, it adds a Polish phrase with English day/month.

I don't know if that helps, but in ~/.kde/share/config/kmailrc I've found such entries:

[KMMessage #0]
language=pl
phrase-forward=Przekazana wiadomość
phrase-reply=Dnia %D, napisałeś:
phrase-reply-all=Dnia %D, %F napisał:

[KMMessage #1]
language=en_US

(that's all, no phrase-* below en_US).
Comment 3 Michal Trzcinski 2005-11-08 11:54:46 UTC
Yeah, this is exactly Jakub Suder wrote. This is a bug.

When i change global language in KDE to English, then i have "On Monday 07 November 2005 12:20 pm, Somebody wrote:", but i want a KDE in Polish.

When i set global language in KDE to Polish and have English in Phrases i have: 
"Dnia Monday 07 of November 2005 12:20, Someone napisał:".
Comment 4 Martin Pley 2005-11-25 06:26:46 UTC
Problem:
When the config-file is written, the default value is set to "On %D, you wrote:" . But when the config is read back, the default value is set to i18n("On %D, you wrote:").

Solution:
Remove the i18n() from line 3768 ff. (of 3.5er branch) of kmmessage.cpp.

May this be fixed for 3.5 final?
Comment 5 Martin Pley 2005-11-25 06:44:49 UTC
Ok, perhapes it's even better to remove the defaults from replyphrases.kcfgc. :-)
Comment 6 Allan Beaufour 2006-04-07 19:19:09 UTC
Still happens in 3.5.2 :(
Comment 7 Jakub Suder 2006-04-07 19:30:37 UTC
When I manually add such lines to kmailrc after "language=en_US":

phrase-forward=Forwarded message
phrase-reply=On %D, you wrote:
phrase-reply-all=On %D, %F wrote:

Then everything works as it should...
Comment 8 Allan Beaufour 2006-04-07 19:41:08 UTC
Ah, so it's only a question of the configuration dialog not saving the information properly in the kmailrc file?
Comment 9 Martin Pley 2006-04-07 20:27:45 UTC
no, there is an i18n() where it should not be.
Comment 10 Ismail Onur Filiz 2006-04-09 11:54:21 UTC
SVN commit 527761 by onurf:

The reply/forward phrases shouldn't have defaults, since it leads to
a mixup when the system locale is different from the KMail option for them.
For details, see bug 109533.

The problem is still not fully solved though, since the changes in the
configuration dialog are not immediately 'read' back. 

CCBUG: 109533



 M  +3 -0      kmkernel.cpp  
 M  +0 -3      replyphrases.kcfg  


--- branches/KDE/3.5/kdepim/kmail/kmkernel.cpp #527760:527761
@@ -1463,6 +1463,9 @@
 
 void KMKernel::readConfig()
 {
+  //Needed here, since this function is also called when the configuration
+  //changes, and the static variables should be updated then - IOF
+  KMMessage::readConfig();
 }
 
 void KMKernel::cleanupImapFolders()
--- branches/KDE/3.5/kdepim/kmail/replyphrases.kcfg #527760:527761
@@ -20,17 +20,14 @@
     <entry name="PhraseForward" type="String" key="phrase-forward">
       <label></label>
       <whatsthis></whatsthis>
-      <default>Forwarded Message</default>
     </entry>
     <entry name="PhraseReplySender" type="String" key="phrase-reply">
       <label></label>
       <whatsthis></whatsthis>
-      <default>On %D, you wrote:</default>
     </entry>
     <entry name="PhraseReplyAll" type="String" key="phrase-reply-all">
       <label></label>
       <whatsthis></whatsthis>
-      <default>On %D, %F wrote:</default>
     </entry>
 
   </group>
Comment 11 Ismail Onur Filiz 2006-04-09 12:01:49 UTC
First of all, thanks to Martin Pley for pointing out to the solution. Let me elaborate on the remaining part of the problem:

When you change the language in the Configuration page and click OK, the changes do not go into effect immediately. You need to go into Configuration once more and click OK so that it starts working. 

It is probably because the changes are not immediately written back to the configuration file. But I'd prefer to leave it to somebody who is more knowledgeable about how the KConfig framework works.
Comment 12 Ismail Onur Filiz 2006-04-23 13:25:06 UTC
SVN commit 532941 by onurf:

Forward port commits:

518656:
-----------
Fixes the following crash, by adding check for null-pointers: 
 
A message part that is not an email by itself is "view"ed. When reply or forward actions are triggered, KMail crashes. 
   
It also hides the main toolbar and menu for non-message viewers. 
     
CCBUG: 123316 

527761:
-----------
The reply/forward phrases shouldn't have defaults, since it leads to
a mixup when the system locale is different from the KMail option for them.
For details, see bug 109533.

The problem is still not fully solved though, since the changes in the
configuration dialog are not immediately 'read' back. 

CCBUG: 109533



 M  +2 -1      kmcommands.cpp  
 M  +3 -0      kmkernel.cpp  
 M  +7 -2      kmreadermainwin.cpp  
 M  +0 -3      replyphrases.kcfg  


--- trunk/KDE/kdepim/kmail/kmcommands.cpp #532940:532941
@@ -175,7 +175,8 @@
   : mProgressDialog( 0 ), mResult( Undefined ), mDeletesItself( false ),
     mEmitsCompletedItself( false ), mParent( parent )
 {
-  mMsgList.append( &msg->toMsgBase() );
+  if ( msg )
+    mMsgList.append( &msg->toMsgBase() );
 }
 
 KMCommand::~KMCommand()
--- trunk/KDE/kdepim/kmail/kmkernel.cpp #532940:532941
@@ -1394,6 +1394,9 @@
 
 void KMKernel::readConfig()
 {
+  //Needed here, since this function is also called when the configuration
+  //changes, and the static variables should be updated then - IOF
+  KMMessage::readConfig();
 }
 
 void KMKernel::cleanupImapFolders()
--- trunk/KDE/kdepim/kmail/kmreadermainwin.cpp #532940:532941
@@ -92,6 +92,10 @@
   setupAccel();
   setupGUI( ToolBar | Keys | StatusBar | Create, "kmreadermainwin.rc" );
   applyMainWindowSettings( KMKernel::config(), "Separate Reader Window" );
+  if( ! mReaderWin->message() ) { 
+    menuBar()->hide(); 
+    toolBar( "mainToolBar" )->hide(); 
+  } 
 
   connect( kmkernel, SIGNAL( configChanged() ),
            this, SLOT( slotConfigChanged() ) );
@@ -116,6 +120,7 @@
   mReaderWin->setMsg( msg, true );
   setCaption( msg->subject() );
   mMsg = msg;
+  menuBar()->show();
   toolBar( "mainToolBar" )->show();
 }
 
@@ -165,7 +170,7 @@
 void KMReaderMainWin::slotForwardMsg()
 {
    KMCommand *command = 0;
-   if ( mReaderWin->message()->parent() ) {
+   if ( mReaderWin->message() && mReaderWin->message()->parent() ) {
     command = new KMForwardCommand( this, mReaderWin->message(),
         mReaderWin->message()->parent()->identity() );
    } else {
@@ -178,7 +183,7 @@
 void KMReaderMainWin::slotForwardAttachedMsg()
 {
    KMCommand *command = 0;
-   if ( mReaderWin->message()->parent() ) {
+   if ( mReaderWin->message() && mReaderWin->message()->parent() ) {
      command = new KMForwardAttachedCommand( this, mReaderWin->message(),
         mReaderWin->message()->parent()->identity() );
    } else {
--- trunk/KDE/kdepim/kmail/replyphrases.kcfg #532940:532941
@@ -20,17 +20,14 @@
     <entry name="PhraseForward" type="String" key="phrase-forward">
       <label></label>
       <whatsthis></whatsthis>
-      <default>Forwarded Message</default>
     </entry>
     <entry name="PhraseReplySender" type="String" key="phrase-reply">
       <label></label>
       <whatsthis></whatsthis>
-      <default>On %D, you wrote:</default>
     </entry>
     <entry name="PhraseReplyAll" type="String" key="phrase-reply-all">
       <label></label>
       <whatsthis></whatsthis>
-      <default>On %D, %F wrote:</default>
     </entry>
 
   </group>
Comment 13 Will Stephenson 2006-09-08 10:09:11 UTC
The need to Apply then Ok is the actual bug.  The problem is reproducible with
en_* as the desktop language, but the problem is that Kmail doesn't recognise
its own settings change unless you click Accept then Ok.  If you just Ok the
original setting is persisted so your reply language stays German.  I'm looking
for the root cause now.
Comment 14 brazzmonkey 2007-02-01 12:14:32 UTC
i bump this bug because with new 1.9.6 kmail release, phrases feature seems to be replaced by templates. i don't have anything against this choice and i know many users wanted this feature.

however this causes me some troubles because i use an english KDE, but being french i set my phrases to use French so that when replying i'd get : "Le mercredi 31 Janvier 2007, vous avez écrit :".
Date was written in French and i was a happy guy, because i use kmail at work and mostly use French for professional emails. on the other hand, i'm used to an english GUI, and so far this mix worked quite well.

Now this template thing seems to have it all messed up : my phrases become frenchglish : "Le Wednesday 31 January 2007, vous avez écrit :". The only way i found to get all phrases in French is to globally select French as the GUI language in Kcontrol, but i'd rather use english for computing.

this is very annoying, so any advice is appriciated. if this is a bug, please fix.
Comment 15 Thomas McGuire 2007-07-17 13:38:56 UTC
Mass-changing component to "templates" and adding original template author to 
CC list.
Comment 16 Björn Ruberg 2009-12-21 20:07:48 UTC
The original bug has gone invalid because of the change for the template system. The problem described in #14 is described in bug #141200 and bug #81754