-
Author
-
July 9, 2014 at 18:50 #22152Tiger007xyParticipant
Hello,
I want to translate the notifications and messages tab in Buddypress in your theme in German.
My Code in functions.php:
function cg_current_user_notification_count() {
//$notifications = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
$notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id(), $format = ‘string’ );
$count = !empty($notifications) ? count($notifications) : 0;echo $count;
}function my_rename_em_nav() {
global $bp;
$bp->bp_nav[‘notifications’][‘name’] = ‘Benachrichtigungen <span id=”ab-pending-notifications” class=”pending-count”>’ . print(cg_current_user_notification_count()) . ‘</span>’;$bp->bp_nav[‘messages’][‘name’] = ‘Nachrichten <span id=”message-count” class=”message-count”>’ . print(messages_get_unread_count()) . ‘</span>’;
}But the count of the unread notifications and the unread messages is different in my translated version to your version. How do I translate these tabs right with the right count?
Regards,
DavidJuly 15, 2014 at 14:21 #22633CatalinModeratorHello,
Have a look on this plugin:
https://wordpress.org/plugins/codestyling-localization/
Let me know if this helps.
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 17, 2014 at 17:06 #22886collandiParticipantI translate bbPress etc. and create a .mo File.
All works fine, only the Notifications show jet count and no-count and not a number.
What is gone wrong.Thanks for Help
AndyAttachments:
You must be logged in to view attached files.July 24, 2014 at 18:46 #23502CatalinModeratorHello,
Please send me a link to the page you are referring to.
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 26, 2014 at 12:55 #23694Tiger007xyParticipantYou can solve it in the header.php with jQuery. It is not the best solution, but it works:
jQuery(document).ready(function(){
var count = jQuery(“#user-notifications .count”).html();
if (typeof count != ‘undefined’) {
var count = “Mitteilungen<span id=’count’>” + count + “</span>”;
} else {
var count = “Mitteilungen<span id=’count’>” + 0 + “</span>”;
}
jQuery(“#user-notifications”).html(count);});
August 1, 2014 at 16:16 #24347CatalinModeratorHello,
Please send me admin credentials for your site to be able to replicate your issue. Reply as private for security reason.
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 7, 2014 at 16:46 #25014CatalinModeratorHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.