Localizable Attribute And Translation

I have following class

public class Test
{
   
    public string Test{get;set;}
}

public class Usage
{

    public void UsageTest()
    {
            var test = new Test();
            // Here there shouldn't be a localizable warning, because I said
that the Property is not localizable ;)
            test.Test = "not localizable";
    }
}



__________ Information from ESET Smart Security, version of virus signature database 4531 (20091022) __________

The message was checked by ESET Smart Security.

http://www.eset.com




4 comments
Comment actions Permalink

Thank you for this feedback. I will fix it ASAP.

0
Comment actions Permalink

I can't reproduce it.

I copy our code and R# shows me two errors:
1. Localizable - Cannot resolve symbol 'Localizable', Used QF "Import type  System.ComponentModel.LocalizableAttribute"
2. Member names cannot be the same as their enclosing type, Renamed to Text;

I have the next code after error fixes:

public class Test
{
  [System.ComponentModel.Localizable(false)]
  public string Text { get; set; }
}

public class Usage
{
  public void UsageTest()
  {
    var test = new Test();
    // Here there shouldn't be a localizable warning, because I said that the Property is not localizable ;-)
    test.Text = "not localizable";
  }
}


R# shows only one suggestion:
    Use object initializer

0
Comment actions Permalink

I tried to reproduce it, but I couldn't.
With the newest nightly it works. ( I think id had something to do with
referenced assemblies that weren't compiled (The localizable was writtin in
source code but not in the assembly)).

But I found following "feature" in testing. In a project that has resx Files
but no string resources the localization warning doesn't come up.
Only if I add the first string resource entry the localization warning comes
up.

Is this intended or not?

For testing it I created an empty winforms project.
and added following line MessageBox.Show("test");
the "test" wasn't marked  as localized. Only after I added the first
resource into the resources.resx file.

Sincerly Thomas Stocker


"Alexander Nesterenko" <no_reply@jetbrains.com> wrote in message
news:21971807.115001256233128809.JavaMail.clearspace@app8.labs.intellij.net...
>I can't reproduce it.
>

I copy our code and R# shows me two errors:
1. Localizable - Cannot resolve symbol 'Localizable', Used QF "Import type
System.ComponentModel.LocalizableAttribute"
2. Member names cannot be the same as their enclosing type, Renamed to
Text;

>

I have the next code after error fixes:

 {
> [System.ComponentModel.Localizable(false)]
> public string Text { get; set; }
> }
>
> public class Usage
> {
> public void UsageTest()
> {
> var test = new Test();
> // Here there shouldn't be a localizable warning, because I said that the 
> Property is not localizable ;-)
> test.Text = "not localizable";
> }
> }]]>

>

R

  1. shows only one suggestion:

Use object initializer

>

---
Original message URL:
http://www.jetbrains.net/devnet/message/5247776#5247776

>

__________ Information from ESET Smart Security, version of virus
signature database 4535 (20091023) __________

>

The message was checked by ESET Smart Security.

>

http://www.eset.com

>
>




__________ Information from ESET Smart Security, version of virus signature database 4535 (20091023) __________

The message was checked by ESET Smart Security.

http://www.eset.com




0
Comment actions Permalink

Hello Thomas,

Yes, localization support checks if you have at least something in your resx
file, and it is by design. The reason is that many project templates creates
(empty) resx file (e.g. VB project always have resource file), just in case
you want to use it. This gives lots of false positive warnings in projects
that are not localized.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


TS> I tried to reproduce it, but I couldn't.
TS> With the newest nightly it works. ( I think id had something to do
TS> with
TS> referenced assemblies that weren't compiled (The localizable was
TS> writtin in
TS> source code but not in the assembly)).
TS> But I found following "feature" in testing. In a project that has
TS> resx Files
TS> but no string resources the localization warning doesn't come up.
TS> Only if I add the first string resource entry the localization
TS> warning comes
TS> up.
TS> Is this intended or not?
TS>
TS> For testing it I created an empty winforms project.
TS> and added following line MessageBox.Show("test");
TS> the "test" wasn't marked  as localized. Only after I added the first
TS> resource into the resources.resx file.
TS> Sincerly Thomas Stocker
TS>
TS> "Alexander Nesterenko" <no_reply@jetbrains.com> wrote in message
TS> news:21971807.115001256233128809.JavaMail.clearspace@app8.labs.intel
TS> lij.net...
TS>
>> I can't reproduce it.
>>
>> I copy our code and R# shows me two errors:
>> 1. Localizable - Cannot resolve symbol 'Localizable', Used QF "Import
>> type
>> System.ComponentModel.LocalizableAttribute"
>> 2. Member names cannot be the same as their enclosing type, Renamed
>> to
>> Text;
>> I have the next code after error fixes:
>>

> {
>> [System.ComponentModel.Localizable(false)]
>> public string Text { get; set; }
>> }
>> public class Usage
>> {
>> public void UsageTest()
>> {
>> var test = new Test();
>> // Here there shouldn't be a localizable warning, because I said that
>> the
>> Property is not localizable ;-)
>> test.Text = "not localizable";
>> }
>> }]]>

>> R# shows only one suggestion:
>> Use object initializer
>> ---
>> Original message URL:
>> http://www.jetbrains.net/devnet/message/5247776#5247776
>> __________ Information from ESET Smart Security, version of virus
>> signature database 4535 (20091023) __________
>>
>> The message was checked by ESET Smart Security.
>>
>> http://www.eset.com
>>
TS> __________ Information from ESET Smart Security, version of virus
TS> signature database 4535 (20091023) __________
TS>
TS> The message was checked by ESET Smart Security.
TS>
TS> http://www.eset.com
TS>


0

Please sign in to leave a comment.