dyne / tomb

the Crypto Undertaker
https://dyne.org/software/tomb
GNU General Public License v3.0
1.32k stars 151 forks source link

Fixed tomb listing failure message: localization friendly. #506

Closed nerun closed 7 months ago

nerun commented 7 months ago

When listing tombs with tomb list, if there are no tombs open, this failure message is shown:

Line 2668:

_failure "I can't see any ::1 status:: tomb, may they all rest in peace." ${1:-open} }

The problem is that the ::1 status:: is always open. So the message shown will be always:

I can't see any open tomb, may they all rest in peace.

But the word open cannot be translated because it is a variable. In other languages, it sounds bad.

The phrase I can't see any open tomb, may they all rest in peace. is used twice along tomb script, in lines 2832 (index_tombs) and 2946 (search_tombs). So we can safely adopt this phrase also for list_tombs in line 2668.

Sakrecoer commented 7 months ago

hi and well met! Is this a transalation issue? If so: wich language are you reffering to?

nerun commented 7 months ago

Yes and no. Brazilian portuguese (pt_BR).

In pt-br, open is translated as aberto. But variables cannot be translated. So, in any other language not just pt-br, open will not be translated. That's the purpose of this PR. In english will not make difference.

Sakrecoer commented 7 months ago

Wait, are you saying the translation of the variable open stays "open", even if it's another language? (öppen, ouvert, abierto, offen..)

My daily language varies, but my robots speak strictly English. Sorry if i misunderstood.

Sakrecoer commented 7 months ago

I am so sorry. I shouldn't be practicing my fluorescent balck belt in derp-fu here. Yet, i remain triggered by language. (In my Aikido; the notification i got put me under the impression this was an issue, about language. But isee now it is a PR)

Neat unearthing, nevertheless! Let's hope it passes!

nerun commented 7 months ago

No. Please read the commit to understand it better.

::1 status:: is the variable used in the failure message, but it is always "open". But ::1 status:: is used in "po" files. What i suggest it to use "open" directly in the message, not a variable.

jaromil commented 7 months ago

shouldn't we change the .pot file then and update some translations? perhaps this can be done inside this PR

nerun commented 7 months ago

Yes, you're right! I will update the POT. This also raises other questions though.

As I explained in extras / translations / README ALL .po files are outdated (except pt_BR-2.10.po). They are for Tomb 2.3 not 2.10+. I created that tomb-2.10.pot for this reason in a very old PR already merged if you remember, but the old tomb.pot (for v2.3) was not deleted. I think we should delete that one too, and rename the tomb-2.10.pot to just tomb.pot. Will be a good idea to update the translation PO files with the new version, so translators can choose to update what is needed:

$ git rm tomb.pot
$ git rm tomb-2.10.pot
$ perl generate_translatable_strings.pl > tomb.pot
$ git add tomb.pot
$ git rm pt_BR.po
$ git mv pt_BR-2.10.po pt_BR.po
$ msgmerge --update *.po tomb.pot

What do you think?

nerun commented 7 months ago

Moved to PR #512