What am I missing? (Blog Module Actions Alerts)

I am trying to make a simple change to a blog action alert.

In the blog module there is:

'sure_label' => _t('_Are you sure?'),

In the language keys there is:

_Are you sure? with the text "Are you sure?"

In the actions there is:

if (confirm('{sure_label}')) window.open ('{work_url}?action=delete_blog&DeleteBlogID={blog_id}','_self');

 

I wanted to leave that one in place and add a new one:

'sure_label_delete' => _t('_blog_delete_Are you sure?'),

created the language key _blog_delete_Are you sure? with my new message.

In the actions:

if (confirm('{sure_label_delete}')) window.open ('{work_url}?action=delete_blog&DeleteBlogID={blog_id}','_self');

Cleared the caches and hard reloaded the page and the alert box states {sure_label_delete}

 

So what am I missing here?  Are the language keys for this stored in a different place; are they added somewhere else other than the language manager in the backend?  Or is it something else entirely?

Geeks, making the world a better place
Quote · 21 Dec 2013

 

So what am I missing here? 

 Besides moving down under and correcting everything... lol

There are so many members here that know what we really want.. where is Andrew?

Oh wait, Skype just said "Andrew Boon" is online, perhaps a link to this.. wait a link to the forums would be better.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 21 Dec 2013

Of course I can just put the text directly into the alert; however, I want to learn this.

Geeks, making the world a better place
Quote · 21 Dec 2013

Perhaps no one has done this before.  I think that "Are you sure?" may be used in more than one area.  I had someone to lose their blog, the whole thing, and I am sure they accidentally clicked on the "Delete Blog" button.  For now I went ahead and changed it in the action to telling them that they are going to delete all their blog posts.

Geeks, making the world a better place
Quote · 21 Dec 2013

change the sure_label_delete back to sure_label

That is a template key that is replaced with the contents of the language key. You do not need to change that label. The change in the name of the language key is enough.

If you insist on changing the template key as well, then you also need to change the template. But if that template is used elsewhere then it will break everything else that uses it, so as i mentioned. The change in the language key should be all you need to do.


https://www.deanbassett.com
Quote · 21 Dec 2013

 

change the sure_label_delete back to sure_label

That is a template key that is replaced with the contents of the language key. You do not need to change that label. The change in the name of the language key is enough.

If you insist on changing the template key as well, then you also need to change the template. But if that template is used elsewhere then it will break everything else that uses it, so as i mentioned. The change in the language key should be all you need to do.


And if that label is used other places than just deleting the blog, then it will pass an incorrect message.  And I did not change the sure_label, I was trying to add a new key that would only be used for the blog delete button.  How can I add my own language key to the template if what I have shown is not the way?

Geeks, making the world a better place
Quote · 21 Dec 2013

Actually, I was going to need two language keys.  Take a look at my Blog Delete double check to understand why.

Geeks, making the world a better place
Quote · 21 Dec 2013

I am no longer sure. After looking at the code that appears to be a action label and not a template key, but i would have to actually take time to test things to come up with a solution. To which i have no time right now.

However, perhaps you edited the wrong location. There is another spot in the code that has that language key. _t('_Are you sure?')

The one you changed in in the getActionsBlock function. There is another one in the GenMemberDescrAndCat function.



https://www.deanbassett.com
Quote · 21 Dec 2013

I am not sure.  Probably something that a Boonex Developer needs to explain.

Geeks, making the world a better place
Quote · 22 Dec 2013

Did you get this working ? If you did everything as you mentioned in your first message and cleared cache, it should have worked unless you cache has not really cleared.

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 24 Dec 2013

 

Did you get this working ? If you did everything as you mentioned in your first message and cleared cache, it should have worked unless you cache has not really cleared.

Yes, cleared caches, including the file caches.  I sat this aside as I had Christmas stuff to deal with.  I will return to it later.

Geeks, making the world a better place
Quote · 24 Dec 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.