Merge pull request #111419 from YeldhamDev/numbers_numbers_numbers

Add source lines to file locations on POT generation
This commit is contained in:
Thaddeus Crews
2025-10-13 19:29:01 -05:00
3 changed files with 14 additions and 9 deletions

View File

@ -84,7 +84,12 @@ void POTGenerator::generate_pot(const String &p_file) {
const String &msgctxt = (translation.size() > 1) ? translation[1] : String();
const String &msgid_plural = (translation.size() > 2) ? translation[2] : String();
const String &comment = (translation.size() > 3) ? translation[3] : String();
_add_new_msgid(translation[0], msgctxt, msgid_plural, file_path, comment);
const int source_line = (translation.size() > 4) ? translation[4].to_int() : 0;
String location = file_path;
if (source_line > 0) {
location += vformat(":%d", source_line);
}
_add_new_msgid(translation[0], msgctxt, msgid_plural, location, comment);
}
}