Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By wpanssi on
What does it mean when .po files have these numbers like 216 below. Are they needed? Does it work without that number..?
#: modules/watchdog/watchdog.module:216
msgid "Location"
msgstr "Sijainti"
Comments
216 is the line number that
216 is the line number that the translate function (t) is called.
So, if you goto modules/watchdog/watchdog.module and goto line 216, You should see
t('Location')
on that line.-Craig Jackson
-Web Developer
What if I would like to all
What if I would like to all the srings X replaced with the string Y regardless of where the strings X occure (in which module, in which line) ?
Does it matter what I put to the line beginning with #?
...
This line has next to no meaning for Drupal. Drupal stores it for bookkeeping, but it doesn't do much with it. You could delete those '#' lines and Drupal won't care.
That's already the case.
These line numbers are meaningful to other programs:
1. Translation software let the human translator view the source file and line(s) to better understand the meaning/context of the string.
2. When the source file gets updated and the strings in the pot file change, some programs can use the line numbers as hints to figure out which strings have changed or partially changed and alert the translator.
Ok, thanks!
Ok, thanks!