After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 167126 - Janitoring i18n strings
Janitoring i18n strings
Status: VERIFIED FIXED
Product: meld
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Stephen Kennedy
Stephen Kennedy
Depends on: 97061
Blocks:
 
 
Reported: 2005-02-11 22:01 UTC by Benoît Dejean
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ngettext love (2.18 KB, patch)
2005-06-21 19:36 UTC, Benoît Dejean
none Details | Review
updated patch for dirdiff.py (1.81 KB, patch)
2005-06-22 08:18 UTC, Benoît Dejean
none Details | Review

Description Benoît Dejean 2005-02-11 22:01:21 UTC
Meld has 276 i18n strings.

Some strings look like duplicate :

#: ../glade2/filediff.glade.h:11
msgid "Save _As..."
AND
#: ../filediff.py:111
msgid "_Save As..."

#: ../glade2/filediff.glade.h:6
msgid "Find"
AND
#: ../filediff.py:124
msgid "_Find"

#: ../filediff.py:597
#, python-format
msgid ""
"Could not open '%s' for reading.\n"
"\n"
"The error was:\n"
"%s"
AND
#: ../glade.py:360
#, python-format
msgid ""
"Could not open '%s'.\n"
"%s"




Some look a bit cryptic:

#: ../filediff.py:267
msgid "INS,OVR"



Some look useless:

#: ../filediff.py:1334 ../findreplace.py:106
#, python-format
msgid "%s"

#: ../glade2/cvsview.glade.h:1 ../glade2/dirdiff.glade.h:1
#: ../glade2/meldapp.glade.h:3
msgid "*"

#: ../glade2/cvsview.glade.h:2
msgid "..."

#: ../glade2/meldapp.glade.h:93
msgid "utf8 iso8859"


Some strings may be merged:

#: ../meld:59
msgid "Meld requires a recent version of pygtk."
AND
#: ../meld:60
#, c-format
msgid "pygtk-%s or higher is recommended."
AND
#: ../meld:70
#, c-format
msgid "Meld requires pygtk-%s or higher. (found %s)"


Some have strange spacing:
#: ../glade2/meldapp.glade.h:60
msgid "Solid   Filled Quadilaterals"

#: ../glade2/meldapp.glade.h:1
msgid " spaces."

(string surgery ?)


Though I'm no i18n guru, i think Meld's strings need some love.
Comment 1 Stephen Kennedy 2005-02-18 16:06:08 UTC
Full resolution will need some help from intltool or glade or both,
for excessive markup items but many other items are fixable.
Comment 2 Danilo Segan 2005-06-20 18:30:21 UTC
None of this seems related to bug #97061.

I'm adding more buggy and confusing strings here:

#: ../filediff.py:140 ../filediff.py:141
msgid "Copy selected text"

Maybe one should be "Cut selected text" (same text is used for both "Cut" and
"Copy" actions)

#: ../filediff.py:295
msgid "Insert,Overwrite"

Separate this out (code will even be cleaner if you just use
[_("Insert"),_("Overwrite")][view.get_overwrite()], but be sure to also add
comment for translators about what these are about


#: ../meldapp.py:347
msgid "folder"

#: ../meldapp.py:348
msgid "file"

#: ../meldapp.py:349
msgid "nonexistant"

String composition the way it's done in append_diff sucks.

#: ../meldapp.py:482
msgid "Save snapshot to file,x,y,w,h"

What's this "file,x,y,w,h" about at all?  I suppose it's about versioning files
in VC systems, but a comment explaining that to translators would be needed (and
you'd probably need quotes around "file,x,y,w,h" if it's supposed to be treated
as single filename).


#: ../glade2/meldapp.glade.h:49
msgid "When loading, try these codecs in order. (e.g. utf8, iso8859)"

#: ../glade2/meldapp.glade.h:62
msgid "utf8 iso8859"

AFAIK, "iso8859" is not an encoding, it's a collection of encodings (iso8859-1,
iso8859-2,...).  A comment for translators would be appreciated to explain what
should they translate this to (Glade supports such comments).


I'll report another bug about technical strings which could probably be made
less technical.
Comment 3 Stephen Kennedy 2005-06-21 18:45:50 UTC
I've janitored the strings mentioned in Benoits original report.

Danilo, whats a good way to give a meaningful error message like in append_diff
without resorting to some kind of surgery?

Re: codecs, the encodings are passed directly to python so I'd imagine
iso8859 is a commonly used alias for iso8859-1. Is there a way to add comments
to strings in glade files?
Comment 5 Benoît Dejean 2005-06-21 19:36:52 UTC
Created attachment 48123 [details] [review]
ngettext love

i reworked this bit of code to make proper use of gettext. untested (although
import dirdiff does not raise any error) as i haven't gnomeprint.

As gettext doesn't have N_ to mark string for translation, i had to use so
lambda-fu :)
I also s/div/n as div is a builtin function.
Comment 6 Danilo Segan 2005-06-22 07:19:19 UTC
On Benoit's changes.

Is there really a reason not to use full strings in ngettext calls instead (this
is important for languages where this might turn out to be "seconds %s%i")?

For example,
times = ( # translators: %s is for sign ("-" or empty for positive number)
  (60, ngettext("%s%i second", "%s%i seconds", n)),
  (60, ngettext("%s%i minute", "%s%i minutes", n)),
  ...
)

The same is true for append_diff: if you can't put it in one string (which it
seems it can't be put, because you don't know the size of it beforehand), then
what you want to do is to allow those building parts to be translated as well,
and add a suitable comment explaining all this to translators, eg.:
                # translators: this is used as type in "(%s)\t`%s'" message
                _("folder")... _("file") ... _("nonexistant")

                # translators: first "%s" is for type ("file", "folder" or
"nonexistant"), and second "%s" is for referring path
                extra.append( _("(%s)\t`%s'") % (what, paths[i]) )

Note that this is only a suggestion.  You might also want to use Python
%(variablename)s instead of simple %s to make it easier for translators to move
them around.
Comment 7 Benoît Dejean 2005-06-22 08:18:23 UTC
Created attachment 48139 [details] [review]
updated patch for dirdiff.py
Comment 8 Stephen Kennedy 2005-06-23 18:11:04 UTC
I've committed a patch based on Benoit's for the ngettext.

I've removed the dodgy append_diff string as it's not too importatnt
and exeedingly rarely seen.

AFAICS thats the last of the reported issues. There are a few more
things I'd like to clean up (such as \n\t in strings) but they're
very minor and can wait for the next release.
Comment 10 Stephen Kennedy 2006-11-19 11:05:32 UTC
Batch close of old bugs.