1. Home
  2. Docs
  3. Llamachant Framework Modules
  4. Extended Functionality
  5. ActionLocalization Attribute

ActionLocalization Attribute

Similar to our Localization Attribute, the ActionLocalization attribute allows you to localize properties of an action within a controller.

				
					[LocalizedText("MyExceptionText", "I told you this doesn't do anything...")]
    public class ActionLocalizationSampleController : ViewController
    {
        [ActionLocalization(Caption = "My Action Caption", ConfirmationMessage = "This button doesn't do anything. Do you want to continue?", ToolTip = "I'm boring!")] //Default Text
        [ActionLocalization(Caption = "Moja Etykieta Akcji", ConfirmationMessage = "Ten przycisk nic nie robi. Czy chcesz kontynuować?", ToolTip = "Jestem nudny!", Language = "pl-PL")] //Polish Localization
        [ActionLocalization(Caption = "Titulo de mi acción", ConfirmationMessage = "Este boton no hace nada. Desea continuar?", ToolTip = "Estoy aburrido!", Language = "es")] //Spanish Localization
        public SimpleAction MyAction { get; private set; }

        public ActionLocalizationSampleController()
        {
            MyAction = new SimpleAction(this, nameof(MyAction), DevExpress.Persistent.Base.PredefinedCategory.Unspecified);
            MyAction.Execute += MyAction_Execute;
        }

        private void MyAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            throw new UserFriendlyException(this.GetLocalizedText("MyExceptionText"));
        }
    }
				
			
Automatically Updated Localization Values
Was this article helpful to you? Yes 2 No

How can we help?