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

TapocoL’s picture

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

wpanssi’s picture

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 #?

mooffie’s picture

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.

What if I would like to all the string X replaced with the string Y regardless of where the strings X occure

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.

wpanssi’s picture

Ok, thanks!