Issue 61007 - RFE: Make AutoCaption format localisable
Summary: RFE: Make AutoCaption format localisable
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.0.1
Hardware: All All
: P3 Trivial with 9 votes (vote)
Target Milestone: ---
Assignee: Oliver Specht
QA Contact: issues@sw
URL: http://specs.openoffice.org/writer/ca...
Keywords:
: 5514 41578 (view as issue list)
Depends on:
Blocks:
 
Reported: 2006-01-22 13:55 UTC by openskm
Modified: 2013-08-07 14:42 UTC (History)
11 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Corrected typedetection file. (820 bytes, text/xml)
2007-05-17 08:48 UTC, kami911
no flags Details
First spec draft fom kami (100.50 KB, application/vnd.oasis.opendocument.text)
2007-09-28 07:39 UTC, Oliver Specht
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description openskm 2006-01-22 13:55:31 UTC
In AutoCaption text first comes the type of the caption and the number comes
after it (e.g. Figure 1). This is not suitable for all languages. For example in
Hungarian "Figure 1" should be "1. ábra" not "Ãbra 1". The term "Ãbra 1" is
grammatically incorrect and look unprofessional in a Hungarian text.

The suggestion is to let the AutoCaption format be localisable, for example
there could be a translatable format string like "%s %d" which could be easily
translated as "%d. %s" in Hungarian.

In current Hungarian community builds an ad-hoc patch is used. Of course it is
not suitable for inclusion, because other languages need the original format and
this patch breaks that.

--- sw/source/ui/frmdlg/cption.cxx.orig	2005-09-11 17:24:55.000000000 +0200
+++ sw/source/ui/frmdlg/cption.cxx	2005-10-21 19:49:24.187500000 +0200
@@ -427,11 +427,6 @@
                                         aFormatBox.GetSelectEntryPos() );
         if( SVX_NUM_NUMBER_NONE != nNumFmt )
         {
-            // Kategorie
-            aStr += sFldTypeName;
-            if ( aStr.Len() > 0 )
-                aStr += ' ';
-
             SwWrtShell &rSh = rView.GetWrtShell();
             String sFldTypeName( aCategoryBox.GetText() );
             SwSetExpFieldType* pFldType = (SwSetExpFieldType*)rSh.GetFldType(
@@ -460,6 +455,10 @@
             //case ARABIC:
             default:                    aStr += '1'; break;
             }
+            // Kategorie
+            aStr += '.';
+            aStr += ' ';
+            aStr += sFldTypeName;
         }
 
         aStr += aSepEdit.GetText();
--- sw/source/core/doc/doclay.cxx.orig	2005-09-11 17:23:48.000000000 +0200
+++ sw/source/core/doc/doclay.cxx	2005-10-21 20:07:02.078125000 +0200
@@ -1566,8 +1566,9 @@
         String aTxt;
         if(pType)
         {
-            aTxt += pType->GetName();
+            aTxt += '.';
             aTxt += ' ';
+            aTxt += pType->GetName();
         }
 		xub_StrLen nIdx = aTxt.Len();
         aTxt += rSeparator;
@@ -1584,7 +1584,7 @@
         if(pType)
         {
             SwSetExpField aFld( (SwSetExpFieldType*)pType, aEmptyStr,
SVX_NUM_ARABIC);
-            pNew->Insert( SwFmtFld( aFld ), nIdx, nIdx );
+            pNew->Insert( SwFmtFld( aFld ), 0, 0 );
             if(rCharacterStyle.Len())
             {
                 SwCharFmt* pCharFmt = FindCharFmtByName( rCharacterStyle );
--- sw/source/ui/config/optload.cxx.orig	2005-11-12 18:59:30.000000000 +0100
+++ sw/source/ui/config/optload.cxx	2005-11-12 21:08:42.000000000 +0100
@@ -905,9 +905,6 @@
                                         aFormatBox.GetSelectEntryPos() );
         if( SVX_NUM_NUMBER_NONE != nNumFmt )
         {
-            // Kategorie
-            aStr += aCategoryBox.GetText();
-            aStr += ' ';
 
             SwWrtShell *pSh = ::GetActiveWrtShell();
             String sFldTypeName( aCategoryBox.GetText() );
@@ -940,6 +937,10 @@
                 //case ARABIC:
                 default:                    aStr += '1'; break;
             }
+            // Kategorie
+            aStr += '.';
+            aStr += ' ';
+            aStr += aCategoryBox.GetText();
         }
         aStr += aTextEdit.GetText();
     }
Comment 1 michael.ruess 2006-01-23 08:04:11 UTC
Reassigned to requirements.
Comment 2 kami911 2006-05-28 18:25:42 UTC
What about to make AutoCaption format depending on paragraph language? We might
build a table for exceptions for example in case of Hungarian language... This
information may be handled via i18n.
Comment 3 kami911 2006-06-20 18:14:15 UTC
What about to include caption format in i18n framework like date format, etc.
Comment 4 kami911 2007-05-17 08:48:55 UTC
Created attachment 45179 [details]
Corrected typedetection file.
Comment 5 kami911 2007-05-17 08:51:39 UTC
Sorry wronly posted file
Comment 6 Oliver Specht 2007-09-12 11:02:10 UTC
Adding os to cc
Comment 7 Oliver Specht 2007-09-28 07:39:19 UTC
Created attachment 48567 [details]
First spec draft fom kami
Comment 8 Oliver Specht 2007-09-28 07:40:48 UTC
Added FL on cc
reassigned to me
Comment 9 Oliver Specht 2007-10-05 08:00:51 UTC
spec is available on 
http://specs.openoffice.org/writer/caption_dialog/Enhanced_Caption_Dialog_for_Hungarian_Langauge.odt
Thanks to fl
Comment 10 kami911 2007-10-05 19:27:32 UTC
We will discuss it in the HU NLC. Also we have to know if other languages are
affected.
Comment 11 kami911 2007-10-23 08:36:19 UTC
It seems no other languages affected...
Are there any news about implementation? As I promised I can help with QA.
Comment 12 Oliver Specht 2007-11-07 08:23:23 UTC
*** Issue 41578 has been marked as a duplicate of this issue. ***
Comment 13 Oliver Specht 2007-11-07 08:26:30 UTC
*** Issue 5514 has been marked as a duplicate of this issue. ***
Comment 14 Oliver Specht 2007-11-07 10:22:24 UTC
Fixed in
officecfg/registry/schema/org/openoffice/Office/Writer.xcs
sw/inc/doc.hxx
sw/inc/fesh.hxx
sw/inc/undobj.hxx
sw/inc/modcfg.hxx
sw/inc/SwCapObjType.hxx
sw/source/core/doc/doclay.cxx
sw/source/core/frmedt/fews.cxx
sw/source/core/undo/unins.cxx
sw/source/ui/config/caption.cxx
sw/source/ui/config/modcfg.cxx
sw/source/ui/config/optload.cxx
sw/source/ui/config/optload.hrc
sw/source/ui/config/optload.src
sw/source/ui/dochdl/gloshdl.cxx
sw/source/ui/frmdlg/cption.cxx
sw/source/ui/frmdlg/cption.hrc
sw/source/ui/frmdlg/cption.src
sw/source/ui/inc/caption.hxx
sw/source/ui/inc/cption.hxx
sw/source/ui/inc/optload.hxx
sw/source/ui/uiview/viewdlg2.cxx

Comment 15 kami911 2007-11-07 14:51:46 UTC
I can't wait to try out this enhanced functionality ;o)
Comment 16 Oliver Specht 2007-11-09 09:17:44 UTC
Reassigned for verification
Comment 17 kami911 2007-11-10 11:43:32 UTC
Hi OS!
It works near perfectly for me. I am waiting for the notification of Hungarian
folks too. I found that the Hungarian formatting string was was:

number[number separator]category[separator]Caption text

Currently your build produces in the preview windows:

number[number separator]category [separator]Caption text

Note the space between category and [separator]. But the insterted caption is
that we expected. Can you fix it, please?

Also I saw the Caption windows is changing based on selection of caption order.
Is this a good solution from the point of user experience? I am not an expert
here jus I have noticed it.
Comment 18 Oliver Specht 2007-11-12 07:07:57 UTC
Fixed in 
sw/source/ui/config/optload.cxx
sw/source/ui/frmdlg/cption.cxx

Comment 19 kami911 2007-11-14 16:51:22 UTC
Hi OS!
It seems ok to me. No more issue was found. Can you integrate it?
Comment 20 Oliver Specht 2007-11-15 06:18:19 UTC
Set to verified
Comment 21 thorsten.ziehm 2009-07-20 14:54:44 UTC
This issue is closed automatically and wasn't rechecked in a current version of
OOo. The fixed issue should be integrated in OOo since more than half a year. If
you think this issue isn't fixed in a current version (OOo 3.1), please reopen
it and change the field 'Target Milestone' accordingly.

If you want to download a current version of OOo =>
http://download.openoffice.org/index.html
If you want to know more about the handling of fixed/verified issues =>
http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues