This project has moved and is read-only. For the latest updates, please go here.

How to use ResX Resource Manager with custom controls (descendant of UserControl class)

Oct 9, 2015 at 3:17 PM
Edited Oct 9, 2015 at 4:01 PM
[edit solved]

Hello,

First, thank you for this VS extension ! This my first international application and with ResX Resource Manager, it's very easy to do it.

But I had a problem with my own custom controls. When opening ResX Manager UI, there is no detection on custom control text fields which I have to translate. Only text fields of standard control was displayed.
Example : MyLabel.Text, MyButton.Text, ...

My own controls inherit from UserControl class.

Trick to do it :

From VS UI Designer, set Localizable property to true.
Each localizable field must be marked with [localizable(true)].

Example :
public partial class xeoPasswordBoxExtended : UserControl
  {
...

        public xeoTextBox tb { get { return this._tb; } }
        public Button btShowPassword { get { return this._btShowPassword; } }

        [Localizable(true)]
        public string TextHint 
        { 
            get { return this._tb.TextHint; } 
            set { this._tb.TextHint = value; } 
        }

        [Localizable(true)]
        public string ButtonToolTipText
        {   
            get { return this._ToolTip.GetToolTip(this._btShowPassword); }
            set { this._ToolTip.SetToolTip(this._btShowPassword, value); }
        }

...
(Sorry for my poor english level, I'm french !)

Regards.
Marked as answer by tomenglert on 10/15/2015 at 3:51 AM