Closed cjuroz closed 1 year ago
Add to functions.php
:
// polylang missing string translates for other plugins/themes
add_action('init', function() {
// wp-useronline missing strings
pll_register_string('template-useronline', '<a href="%PAGE_URL%"><strong>%USERS%</strong> Online</a>', 'plugins/wp-useronline');
pll_register_string('naming-user', '1 User', 'plugins/wp-useronline');
pll_register_string('naming-user', '%COUNT% Users', 'plugins/wp-useronline');
});
Add pll__()
to https://github.com/lesterchan/wp-useronline/blob/master/template-tags.php#L9 and https://github.com/lesterchan/wp-useronline/blob/master/template-tags.php#L261
$template = pll__(UserOnline_Core::$options->templates['useronline']);
For example, whenever
users_online()
is called, it will use string stored in User(s) Online template (Settings > UserOnline). It would be great if text there could be load from po/mo files instead enabling multiple languages.