Plugin translation not detected in .pot file
-
Hey,
I’m working with this paid plugin called “Booked” and in their php source code they have two similar translations as follows:line:939 echo '<h2><span>' . sprintf( _n( esc_html(_x( 'Available Appointment on %s', 'Single Appointment', 'booked' )), esc_html(_x( 'Available Appointments on %s', 'Multiple Appointments', 'booked' )), $total_available ), '</span><strong>'.$date_display.'</strong><span>') . '</span></h2>';
and
line:1296 echo '<h2'.(!$showing_prev ? ' class="booked-no-prev"' : '').'><span>'.sprintf(_n('Available Appointment on %s','Available Appointments on %s',$total_available,'booked'),'</span><strong>'.$date_display.'</strong>').'</h2>';
When I sync the main language template in Loco, i’m only detecting the second occurrence on line:1296. I’m trying to translate it in German (Formal) System language.
When I check the following path /wp-content/languages/plugins/booked/booked-de_DE_formal.po, i’m only finding this#: includes/functions.php:1296 #, php-format msgid "Available Appointment on %s" msgid_plural "Available Appointments on %s" msgstr[0] "VerfГ?gbarer Termin am %s" msgstr[1] "VerfГ?gbare Termine am %s"
so the lines below which I can see in the Booked plugin .pot file seem to be treated as obsolete/can’t be located by Loco?
#: includes/functions.php:938 #, php-format msgctxt "Single Appointment" msgid "Available Appointment on %s" msgstr "" #: includes/functions.php:938 #, php-format msgctxt "Multiple Appointments" msgid "Available Appointments on %s" msgstr ""
Does anyone have an idea how can I make it so they’re being detected?
P.S. Reading a bit more through the FAQ and checking a bit more of the plugin’s .pot file, it seems that there’s a mismatch between the lines of the Booked plugin’s .php file containing the translatable strings and the Booked plugin’s .pot file that tells the software which strings are available. Does that mean that the author hasn’t updated their .pot file? It seems that if i don’t perform the sync template action from Loco, the translations appear. But it’s still a bit weird bcs it seems that some translations with mismatched lines in the files are picked up by Loco while others are not
- The topic ‘Plugin translation not detected in .pot file’ is closed to new replies.