• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Updated Where translate rating value in type of feedback used in the phrase 'xa_cas_you_recieved_feedback_fr

Bob

Developer
Staff member
Where translate rating value in type of feedback used in the phrase 'xa_cas_you_recieved_feedback_from_x'?

Selection_620.png
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
The field rating in the xf_xa_cas_feedback table is not something that you can translate, its an enum field in the database enum('positive', 'neutral', 'negative').

That phrase is only used by the template alert_cas_feedback_insert so you MIGHT be able to edit that template, add some conditionals to check the rating value and replace the rating value with a phrase for that value. Keep in mind, customization is not supported, so please don't take this as a supported solution. You'll have to fiddle around with it to see if you can get the outcome that you desire upload_2023-10-4_11-17-14.gif

Note: This has been fully tested and has been updated in core CAS addon.

Note: Keep in mind, the phrases for positive, neutral and negative are Uppercase, so you might want to create your own for lower case uses. I've added string helper |to_lower so that the phrases are passed in via lower case.

HTML:
<xf:if is="$content.rating == 'positive'">
    {{ phrase('xa_cas_you_recieved_feedback_from_x', {
        'username': username_link($user, false, {'defaultname': $alert.username}),
        'rating': phrase('xa_cas_positive')|to_lower,
        'feedbackLinkParams': 'href="' . link('cas/feedback', $content) . '" class="fauxBlockLink-blockLink"'
    }) }}
<xf:elseif is="$content.rating == 'negative'" />
    {{ phrase('xa_cas_you_recieved_feedback_from_x', {
        'username': username_link($user, false, {'defaultname': $alert.username}),
        'rating': phrase('xa_cas_negative')|to_lower,
        'feedbackLinkParams': 'href="' . link('cas/feedback', $content) . '" class="fauxBlockLink-blockLink"'
    }) }}
<xf:else />
    {{ phrase('xa_cas_you_recieved_feedback_from_x', {
        'username': username_link($user, false, {'defaultname': $alert.username}),
        'rating': phrase('xa_cas_neutral')|to_lower,
        'feedbackLinkParams': 'href="' . link('cas/feedback', $content) . '" class="fauxBlockLink-blockLink"'
    }) }}
</xf:if>
 
I've updated the alert_cas_feedback_insert template (shown above) to evaluate the rating and pass in applicable phrases so that the rating value (positive, neutral and negative) can be translated (using phrase that are already in CAS).

Selection_505.png
 
Back
Top