Apache OpenOffice (AOO) Bugzilla – Issue 61007
RFE: Make AutoCaption format localisable
Last modified: 2013-08-07 14:42:49 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(); }
Reassigned to requirements.
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.
What about to include caption format in i18n framework like date format, etc.
Created attachment 45179 [details] Corrected typedetection file.
Sorry wronly posted file
Adding os to cc
Created attachment 48567 [details] First spec draft fom kami
Added FL on cc reassigned to me
spec is available on http://specs.openoffice.org/writer/caption_dialog/Enhanced_Caption_Dialog_for_Hungarian_Langauge.odt Thanks to fl
We will discuss it in the HU NLC. Also we have to know if other languages are affected.
It seems no other languages affected... Are there any news about implementation? As I promised I can help with QA.
*** Issue 41578 has been marked as a duplicate of this issue. ***
*** Issue 5514 has been marked as a duplicate of this issue. ***
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
I can't wait to try out this enhanced functionality ;o)
Reassigned for verification
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.
Fixed in sw/source/ui/config/optload.cxx sw/source/ui/frmdlg/cption.cxx
Hi OS! It seems ok to me. No more issue was found. Can you integrate it?
Set to verified
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