Skip to main content
improved formatting
Source Link
mickmackusa
  • 4.8k
  • 4
  • 18
  • 48

WantI want to add one more layer to complete the above 2 posts which are really good. If you want to go ahead and use the translation service from Joomla, you can do that too by doing the following  :-

  1. Step 1 AddAdd this in your php code  , I add this to my default.php file at the top

    JText::script('COM_YOURCOMPONENT_YOUR_MESSAGE');

    JText::script('COM_YOURCOMPONENT_YOUR_MESSAGE');
    
  2. In your JS file, add this code to the logic where your want to display the message

    var message = Joomla.JText._('COM_YOURCOMPONENT_YOUR_MESSAGE'); Joomla.JText.load({success: "Success"}); Joomla.renderMessages({'success': [message]});

    var message = Joomla.JText._('COM_YOURCOMPONENT_YOUR_MESSAGE');
    Joomla.JText.load({success: "Success"});
    Joomla.renderMessages({'success': [message]});
    
  3. In your Language/en-GB/en-GB.com_yourcomponent.ini file, add the translation

    COM_YOURCOMPONENT_YOUR_MESSAGE="your message"

    COM_YOURCOMPONENT_YOUR_MESSAGE="your message"
    

Want to add one more layer to complete the above 2 posts which are really good. If you want to go ahead and use the translation service from Joomla you can do that too by doing the following  :-

  1. Step 1 Add this in your php code  , I add this to my default.php file at the top

    JText::script('COM_YOURCOMPONENT_YOUR_MESSAGE');

  2. In your JS file add this code to the logic where your want to display the message

    var message = Joomla.JText._('COM_YOURCOMPONENT_YOUR_MESSAGE'); Joomla.JText.load({success: "Success"}); Joomla.renderMessages({'success': [message]});

  3. In your Language/en-GB/en-GB.com_yourcomponent.ini file add the translation

    COM_YOURCOMPONENT_YOUR_MESSAGE="your message"

I want to add one more layer to complete the above 2 posts which are really good. If you want to use the translation service from Joomla, you can do that by doing the following:

  1. Add this in your php code, I add this to my default.php file at the top

    JText::script('COM_YOURCOMPONENT_YOUR_MESSAGE');
    
  2. In your JS file, add this code to the logic where your want to display the message

    var message = Joomla.JText._('COM_YOURCOMPONENT_YOUR_MESSAGE');
    Joomla.JText.load({success: "Success"});
    Joomla.renderMessages({'success': [message]});
    
  3. In your Language/en-GB/en-GB.com_yourcomponent.ini file, add the translation

    COM_YOURCOMPONENT_YOUR_MESSAGE="your message"
    
Source Link

Want to add one more layer to complete the above 2 posts which are really good. If you want to go ahead and use the translation service from Joomla you can do that too by doing the following :-

  1. Step 1 Add this in your php code , I add this to my default.php file at the top

    JText::script('COM_YOURCOMPONENT_YOUR_MESSAGE');

  2. In your JS file add this code to the logic where your want to display the message

    var message = Joomla.JText._('COM_YOURCOMPONENT_YOUR_MESSAGE'); Joomla.JText.load({success: "Success"}); Joomla.renderMessages({'success': [message]});

  3. In your Language/en-GB/en-GB.com_yourcomponent.ini file add the translation

    COM_YOURCOMPONENT_YOUR_MESSAGE="your message"