Do not, in general, use php $ variables inside the translation text directly.
Check the 3166/3167 Mercurial for sprintf for example workarounds. Otherwise the litteral varable name will be parsed instead. Make sure every possible variable value has a translation in the .po/.mo files.
The lines (they seem okay in hindsight):
label_cell(_($myrow["name"]));// here the _() is put
label_cell(_($parent_text));// here the _() is put
label_cell(_($bs_text));// here the _() is put
should possibly be (%d for numbers and %s for strings) where every possible value of :
label_cell(sprintf(_("%s"), $myrow["name"]));// here the _() is put
label_cell(sprintf(_("%s"), $parent_text));// here the _() is put
label_cell(sprintf(_("%s"), $bs_text));// here the _() is put
Even this may not work as intended since %s will be parsed as is and there is no preceeding or succeeding text to be translated. An eval() may have to be done on a cocatenated string containing the variable.
Try the following as well:
label_cell(_(sprintf("%s", $myrow["name"])));// here the _() is put
label_cell(_(sprintf("%s", $parent_text)));// here the _() is put
label_cell(_(sprintf("%s", $bs_text)));// here the _() is put
Maybe a check to see if $parent_text is empty before translation would be all that is needed:
label_cell($empty(trim($parent_text)) ? "" : _($parent_text));// here the _() is put