Re: PATCH InfoInset

2010-11-01 Thread Stephan Witt
Am 01.11.2010 um 15:58 schrieb Pavel Sanda:

> Stephan Witt wrote:
>>> Stephan Witt wrote:
 setText(_("Unknown buffer info"));
 to
 setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));
 
 setText(bformat(_("%1$s unknown[[BufferInfo]]"), from_utf8(name_)));
 seems more correct then.
>>> 
>>> why to put [[BufferInfo]] there? 
>> 
>> I don't know. I didn't introduce the [[..]] construct.
> 
> okok :) please kill it, its only for specific translating needs.

I did it.

Hopefully you see it like me... 
...the from_utf8 can safely be replaced by from_ascii.
So I did that too.

Stephan


Re: PATCH InfoInset

2010-11-01 Thread Pavel Sanda
Stephan Witt wrote:
> > Stephan Witt wrote:
> >> setText(_("Unknown buffer info"));
> >> to
> >> setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));
> >> 
> >> setText(bformat(_("%1$s unknown[[BufferInfo]]"), from_utf8(name_)));
> >> seems more correct then.
> > 
> > why to put [[BufferInfo]] there? 
> 
> I don't know. I didn't introduce the [[..]] construct.

okok :) please kill it, its only for specific translating needs.
pavel


Re: PATCH InfoInset

2010-11-01 Thread Stephan Witt
Am 01.11.2010 um 15:34 schrieb Pavel Sanda:

> Stephan Witt wrote:
>> setText(_("Unknown buffer info"));
>> to
>> setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));
>> 
>> setText(bformat(_("%1$s unknown[[BufferInfo]]"), from_utf8(name_)));
>> seems more correct then.
> 
> why to put [[BufferInfo]] there? 

I don't know. I didn't introduce the [[..]] construct.

Stephan


Re: PATCH InfoInset

2010-11-01 Thread Pavel Sanda
Stephan Witt wrote:
> setText(_("Unknown buffer info"));
> to
> setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));
> 
> setText(bformat(_("%1$s unknown[[BufferInfo]]"), from_utf8(name_)));
> seems more correct then.

why to put [[BufferInfo]] there? 

pavel


Re: PATCH InfoInset

2010-10-31 Thread Stephan Witt
Am 31.10.2010 um 20:10 schrieb Richard Heck:

> On 10/31/2010 11:10 AM, Stephan Witt wrote:
>> 
>> Currently I'm a bit surprised that I cannot use the "info" dialog anymore.
>> It crashes at line 217 of InsetCommandParams.cpp
>> (LASSERT in default of switch missing the INFO_CODE case)
>> What happens here?
>> I guess the latest changes to the dialog code were not as trivial as one 
>> thought...
>> 
>>   
> Found the cause of this one
> 

After your change (r35952) LyX doesn't link anymore.

Did you forget any part of your change set?

Stephan

Re: PATCH InfoInset

2010-10-31 Thread Richard Heck

On 10/31/2010 11:10 AM, Stephan Witt wrote:


Currently I'm a bit surprised that I cannot use the "info" dialog anymore.
It crashes at line 217 of InsetCommandParams.cpp
(LASSERT in default of switch missing the INFO_CODE case)
What happens here?
I guess the latest changes to the dialog code were not as trivial as one 
thought...

   

Found the cause of this one

rh



Re: PATCH InfoInset

2010-10-31 Thread Stephan Witt
Am 31.10.2010 um 10:11 schrieb Vincent van Ravesteijn:

> It is caused by the brackets. Wasn't this the way to indicate the context of 
> a string? I think you now have an empty string in the  context [[...]]. This 
> is again translated as an empty string.

Thanks, now I see. So it was a bad idea to change (r34187)
setText(_("Unknown buffer info"));
to
setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));

setText(bformat(_("%1$s unknown[[BufferInfo]]"), from_utf8(name_)));
seems more correct then.

Currently I'm a bit surprised that I cannot use the "info" dialog anymore.
It crashes at line 217 of InsetCommandParams.cpp 
(LASSERT in default of switch missing the INFO_CODE case)
What happens here? 
I guess the latest changes to the dialog code were not as trivial as one 
thought...

Stephan

> 
> Vincent
> 
> 
>> Op 31 okt 2010 08:51 schreef "Stephan Witt" :
>> 
>> Am 30.10.2010 um 15:59 schrieb Stephan Witt:
>> 
>> > I've got a crash when place "info-insert buffer vcs-date" into CVS 
>> > controlled file.
>> > The attache...
>> 
>> I rephrase my question...
>> 
>> The crash is the ASSERT in bformat().
>> The translation of the format arg below results in an empty string.
>> 
>> > setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));
>> 
>> This code construct is quite common.
>> I think, if the translation fails, the untranslated string is the result, 
>> isn't it?
>> What's the problem here?
>> 
>> Stephan
> 



Re: PATCH InfoInset

2010-10-31 Thread Vincent van Ravesteijn
It is caused by the brackets. Wasn't this the way to indicate the context of
a string? I think you now have an empty string in the  context [[...]]. This
is again translated as an empty string.

Vincent

Op 31 okt 2010 08:51 schreef "Stephan Witt" :

Am 30.10.2010 um 15:59 schrieb Stephan Witt:


> I've got a crash when place "info-insert buffer vcs-date" into CVS
controlled file.
> The attache...
I rephrase my question...

The crash is the ASSERT in bformat().
The translation of the format arg below results in an empty string.

> setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));

This code construct is quite common.
I think, if the translation fails, the untranslated string is the result,
isn't it?
What's the problem here?

Stephan


Re: PATCH InfoInset

2010-10-31 Thread Stephan Witt
Am 30.10.2010 um 15:59 schrieb Stephan Witt:

> I've got a crash when place "info-insert buffer vcs-date" into CVS controlled 
> file.
> The attached patch helps, but I'm not sure if there's some more elegant 
> solution.
> Any opinions?

I rephrase my question...

The crash is the ASSERT in bformat().
The translation of the format arg below results in an empty string.

> setText(bformat(_("[[%1$s unknown]]"), from_utf8(name_)));

This code construct is quite common. 
I think, if the translation fails, the untranslated string is the result, isn't 
it?
What's the problem here?

Stephan

PATCH InfoInset

2010-10-30 Thread Stephan Witt
I've got a crash when place "info-insert buffer vcs-date" into CVS controlled 
file.
The attached patch helps, but I'm not sure if there's some more elegant 
solution.
Any opinions?

Stephan
Index: src/insets/InsetInfo.cpp
===
--- src/insets/InsetInfo.cpp(Revision 35929)
+++ src/insets/InsetInfo.cpp(Arbeitskopie)
@@ -437,9 +437,12 @@
else if (name_ == "vcs-date")
itype = LyXVC::Date;
string binfo = buffer().lyxvc().revisionInfo(itype);
-   if (binfo.empty())
-   setText(bformat(_("[[%1$s unknown]]"), 
from_utf8(name_)));
-   else
+   if (binfo.empty()) {
+   docstring fmt = _("[[%1$s unknown]]");
+   if (fmt.empty())
+   fmt = from_ascii("[[%1$s unknown]]");
+   setText(bformat(fmt, from_utf8(name_)));
+   } else
setText(from_utf8(binfo));
break;
}