Skip Navigation

[Resolved] Translating plugin text to user

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to know the CRED text domain.

Solution:
I checked on this and was able to find the text in the helper function for Toolset Forms.

The text domain is actually wp-cred.

0% of people find this useful.

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 4 voices.

Last updated by takoL 6 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#912913
Screen Shot 2018-06-13 at 12.29.46.png
Screen Shot 2018-06-13 at 12.30.27.png

A front-end form entry gives error "Permission denied". I tried to translate this with php function (below) but none of the $domain I have tried will change the text to Finnish. Can you give me a hint as to which $domain it should be, which is giving this error
---
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Permission denied' :
$translated_text = __( 'Ei pääsyä ilman kirjautumista!', 'cred-frontend-editor' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
---

#912984

Try with "wp-cred".

That's the text domain for Toolset Forms and is the one used for that particular string.

#913067

Hi Beda,

Interestingly that did not help. In my experience this method works when the string is correct. Is there any chance the string "Permission denied" is written in some other way in the wp-cred domain?
Thanks,
Saku

#913103

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Saku,

Thank you for contacting our support forum.

This error is generated when or message is displayed when the user doesn't have access to a form correct?

Please let me know.
Thanks,
Shane

#913111

Hi Shane,

Yes, that is correct.
Saku

#913159

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Saku,

I checked on this and was able to find the text in the helper function for Toolset Forms.

The text domain is actually wp-cred as beda mentioned because it is defined like this in the code.

                            alert('" . esc_js( __( 'Permission denied', 'wp-cred' ) ) . "');

Thanks,
Shane

#1093748

HI, I am adding to this issue the following finding:

I am not (also) not able to translate the string 'Permission denied' with the php code.

As a debug I dumped the $translated_text var and found many strings, except the one mentioned in this thread: "Permission denied".

How can we translate this specific string if it is not available as a string inside the gettext filter?

#1097861

Update: I found out that the string we were looking for resides in the following file:

application/models/form/post.php

on line number 247:

return new WP_Error( 'cred-permission', 'Permission denied' );

This string does not seem translatable, as it does not make use of __() function?