If you’ve ever worked with Polylang you might’ve come across an instance in which you weren’t able to translate a certain plugin/theme string simply because it wasn’t registered in Polylang by the plugin/theme author.
This is frustrating because now we aren’t 100% able to translate our website. What if I tell you there’s actually a way to make Polylang work in these instances.
00:00 Introduction
00:32 Possibility to read the blogpost
00:46 Setting up the world and showing the problem
01:55 Writing a function to hook into the ‘gettext’ filter
03:23 Only run Polylang translate function when domain matches
04:11 Register the strings with Polylang (pll_register_string)
04:44 Handy tip regarding spaces in strings
05:50 Adding hook priorities
06:07 Translating the strings in WP dashboard
06:27 The results on the front-end