git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gitk: Import msgcat for translation support
@ 2007-07-27 14:53 Christian Stimming
  2007-07-27 15:03 ` [PATCH 2/2] gitk: Markup many strings for translation Christian Stimming
  2007-07-27 23:53 ` [PATCH 1/2] gitk: Import msgcat for translation support Paul Mackerras
  0 siblings, 2 replies; 13+ messages in thread
From: Christian Stimming @ 2007-07-27 14:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git

Import tcl's msgcat package to have the [mc...] procedure for  
translation available.

However, in the current form gitk doesn't load any data a data  
directory or from anywhere; if it should load any translation  
catalogs, of course it needs to load them from a designated data  
directory. For testing, it uses the ./msgs/ subdirectory (marked as  
FIXME), but eventually a full-blown data directory needs to be added  
there instead.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
---
Actual translation markup will follow.

  gitk |    7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gitk b/gitk
index 39e452a..c01acfb 100755
--- a/gitk
+++ b/gitk
@@ -7463,6 +7463,13 @@ set fgcolor black
  set diffcolors {red "#00a000" blue}
  set selectbgcolor gray85

+## Internationalization (i18n) through msgcat and gettext. See
+## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
+package require msgcat
+namespace import ::msgcat::mc
+## FIXME: Need to define a suitable msgs/ directory here.
+::msgcat::mcload [file join . msgs]
+
  catch {source ~/.gitk}

  font create optionfont -family sans-serif -size -12
-- 
1.5.3.rc2.12.gbc280

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] gitk: Markup many strings for translation.
@ 2007-07-27 20:19 Brett Schwarz
  2007-07-28  2:40 ` Paul Mackerras
  0 siblings, 1 reply; 13+ messages in thread
From: Brett Schwarz @ 2007-07-27 20:19 UTC (permalink / raw)
  To: Christian Stimming, Paul Mackerras; +Cc: git

> 
> ----- Original Message ----
> From: Christian Stimming <stimming@tuhh.de>
> To: Paul Mackerras <paulus@samba.org>
> Cc: git@vger.kernel.org
> Sent: Friday, July 27, 2007 8:03:00 AM
> Subject: [PATCH 2/2] gitk: Markup many strings for translation.
> 
> Similar to the discussion in git-gui, all user-visible strings are  
> passed through the [mc ...] procedure to have them translated by msgcat.
> 
> Signed-off-by: Christian Stimming <stimming@tuhh.de>
> ---

<snip>

>   proc getcommitlines {fd view}  {
> @@ -273,7 +273,7 @@ proc chewcommits {view} {
>           #set ms [expr {[clock clicks -milliseconds] - $startmsecs}]
>           #puts "overall $ms ms for $numcommits commits"
>           } else {
> -        show_status "No commits selected"
> +        show_status [mc "No commits selected"]
>           }
>           notbusy layout
>           set phase {}
> @@ -378,7 +378,7 @@ proc getcommit {id} {
>       } else {
>       readcommit $id
>       if {![info exists commitinfo($id)]} {
> -        set commitinfo($id) {"No commit information available"}
> +        set commitinfo($id) {[mc "No commit information available"]}

I think this is probably a typo (on the original), and carrying that forward will probably result in what was not intended.

The original has the {} and "". I don't know if this was intended (it will keep the quotes).

The translated version, will result in a literal string [mc "No commit information available"], and unless it is explicitly eval'ed later, it will not result in the translated string.

So, if the quotes need to stay in the string, then the translation will have to be:

  set commitinfo($id) \"[mc "No commit information available"]\"

Or, if the quotes are not needed:

  set commitinfo($id) [mc "No commit information available"]


Regards,
    --brett


       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] gitk: Markup many strings for translation.
@ 2007-07-28  7:19 Brett Schwarz
  0 siblings, 0 replies; 13+ messages in thread
From: Brett Schwarz @ 2007-07-28  7:19 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Christian Stimming, git

> 
> 
> ----- Original Message ----
> From: Paul Mackerras <paulus@samba.org>
> To: Brett Schwarz <brett_schwarz@yahoo.com>
> Cc: Christian Stimming <stimming@tuhh.de>; git@vger.kernel.org
> Sent: Friday, July 27, 2007 7:40:20 PM
> Subject: Re: [PATCH 2/2] gitk: Markup many strings for translation.
> 
> Brett Schwarz writes:
> 
> > > -        set commitinfo($id) {"No commit information available"}
> > > +        set commitinfo($id) {[mc "No commit information available"]}
> >
> > I think this is probably a typo (on the original), and carrying that
> > forward will probably result in what was not intended.
> >
> > The original has the {} and "". I don't know if this was intended
> > (it will keep the quotes).
> 
> Yes it is what was intended - it is a list with one element, which is
> a string.

Ah, ok. Then the patch probably should look like this then:

  set commitinfo($id) [list [mc "No commit information available"]]


Regards,
    --brett




       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-10-23 10:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-27 14:53 [PATCH 1/2] gitk: Import msgcat for translation support Christian Stimming
2007-07-27 15:03 ` [PATCH 2/2] gitk: Markup many strings for translation Christian Stimming
2007-07-28  2:39   ` Paul Mackerras
2007-07-28  4:54     ` Junio C Hamano
2007-07-28  6:21       ` Paul Mackerras
2007-07-28  7:01         ` Junio C Hamano
2007-10-21 12:54     ` gitk still interested in translations? Christian Stimming
2007-10-23 10:17       ` Paul Mackerras
2007-07-27 23:53 ` [PATCH 1/2] gitk: Import msgcat for translation support Paul Mackerras
  -- strict thread matches above, loose matches on Subject: below --
2007-07-27 20:19 [PATCH 2/2] gitk: Markup many strings for translation Brett Schwarz
2007-07-28  2:40 ` Paul Mackerras
2007-07-28 12:40   ` Christian Stimming
2007-07-28  7:19 Brett Schwarz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).