You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Norbert Unterberg <ne...@gmx.net> on 2004/12/05 19:13:21 UTC

Localization of user replies

While doing some polishing work on the German translation, I noticed 
something which currently fails to localize: The user's response when 
subversion asks questions:

Example: in clients/cmdline/prompt.c:297 subversion asks the user:
(R)eject, accept (t)emporarily or accept (p)ermanently?
Obviously the possible replies are R, T, P which correspond to the first 
letters of some words in the question. These letters are hard coded in 
the source code and can not be localized. Can you imagine how hard is it 
to find adequate words in different languages that also contain these 
letters?

Here my suggestion:
Allow to localize the replies as well. This should not be too hard and 
coud be done like this:
Add an additional string that contains the possiblie user replies in 
upper and lower case:

const char *replies = _("RrTtPp");  /* allow l10n */ 

...

  svn_stringbuf_appendcstr

    (buf, _("(R)eject, accept (t)emporarily or accept (p)ermanently? "));

...

  SVN_ERR (prompt (&choice, buf->data, FALSE, ctx, pool));

  if (choice && (choice[0] == replies[2] || choice[0] == replies[3]))

   { ... }

  else if (may_save && choice && (choice[0] == replies[4] || choice[0] == replies[5]))

   { ... }


The person working on the translation would then translate the question 
and the replies string, and had the ability to find the best replies for 
his language.

What do you think?

Norbert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Sun, 5 Dec 2004, Norbert Unterberg wrote:

> While doing some polishing work on the German translation, I noticed
> something which currently fails to localize: The user's response when
> subversion asks questions:
>
> Example: in clients/cmdline/prompt.c:297 subversion asks the user:
> (R)eject, accept (t)emporarily or accept (p)ermanently?
> Obviously the possible replies are R, T, P which correspond to the first
> letters of some words in the question. These letters are hard coded in
> the source code and can not be localized. Can you imagine how hard is it
> to find adequate words in different languages that also contain these
> letters?
>
> Here my suggestion:
> Allow to localize the replies as well. This should not be too hard and
> coud be done like this:
> Add an additional string that contains the possiblie user replies in
> upper and lower case:
>
I think something like this is a good idea. You want to qualify it in some
way to not get duplicates. Have a string like SSL Server Trust
Prompt|aRrTtPp (jsut an example). Then the translator would translate the
letters after the |. The code would scan the translated string for the |
and use the letters there after. This is inspired from a section in the
gettext manual about hwo to handle short GUI items, where the same English
term will need different translations depending on context. YOu can look
there and get the idea. We can talk about the details, but I think the
main idea is good. What do others say?

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by Marc Haisenko <ha...@webport.de>.
On Wednesday 08 December 2004 20:01, Philip Martin wrote:
> Lübbe Onken <l....@rac.de> writes:
> > Øyvind A. Holm wrote:
> >>   Log message unchanged or not specified
> >>   a)bort, c)ontinue, e)dit
> >
> > de: (A)bbrechen, Weiterma(c)hen, B(e)arbeiten ;-)
>
> That's still a latin alphabet; what about, say, Chinese?  Is a/c/e
> still acceptable?

Yes, it is.

I don't know how simple chinese is entered, but I do know that writing 
japanese either involves a special keyboard (haven't seen one yet) or have 
special input methods where you enter text in Romanji (transcription of 
japanese words with latin letters) and it then gets translated into Kanji or 
Kana (where you can choose between several letters). (I'm currently learning 
Japanese)

E.g. in Linux to enter はい (hai = yes) I press <shift>+<space>, a small window 
containing a Hiragana "a" appears to show that I've enabled the Kanji/Kana 
input mode and then I enter "hai<enter>" and disable the input mode again 
with <shift>+<space>. I won't describe it any further, but just wanted to 
show you that without a special Japanese keyboard one has to enter several 
letters just to get one Kanji or Kana (I guess even then you'd have to switch 
between Latin and Japanese mode).

Just to test it, I've installed the Japanese i18n package of KDE and switched 
to Japanese. After most menu entries you see a latin letter in parenthesis 
for the shortcuts, same for buttons in dialogs (e.g. if open kwrite, write 
some text and try to close the window then I get a message and three buttons, 
and after each is either a "(S)", "(D)" or "(C)" which come from save, 
discard and cancel. So other software is doing this as well (and KDE has 
pretty good I18N support !)

C'ya,
	Marc

-- 
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: haisenko@webport.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by Philip Martin <ph...@codematters.co.uk>.
Lübbe Onken <l....@rac.de> writes:

> Øyvind A. Holm wrote:
>>   Log message unchanged or not specified
>>   a)bort, c)ontinue, e)dit
> de: (A)bbrechen, Weiterma(c)hen, B(e)arbeiten ;-)

That's still a latin alphabet; what about, say, Chinese?  Is a/c/e
still acceptable?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by Lübbe Onken <l....@rac.de>.
Øyvind A. Holm wrote:
> On 2004-12-05 20:13:21 Norbert Unterberg wrote:
> 
>>While doing some polishing work on the German translation, I noticed 
>>something which currently fails to localize: The user's response when 
>>subversion asks questions:
>>
>>Example: in clients/cmdline/prompt.c:297 subversion asks the user:
>>(R)eject, accept (t)emporarily or accept (p)ermanently?
Well and our translation is a good example on how to find a good 
solution using the same characters :-)

en: (R)eject, accept (t)emporarily or accept (p)ermanently?
de: Ve(r)werfen, (t)emporär akzeptieren oder (p)ermanent akzeptieren?

> Oh no, please don't. This will lead to potential problems and accidents 
No, please don't we had this discussion already a while ago. You also 
don't translate the 'svn cp (copy)' command to 'svn kp' in German.

> when using svn under different locales, or if the locale for some reason 
> changes into C or something else. An example would be the
> 
>   Log message unchanged or not specified
>   a)bort, c)ontinue, e)dit
de: (A)bbrechen, Weiterma(c)hen, B(e)arbeiten ;-)

> I believe a consistent command set across the languages would be the 
> safest and easiest way to go, even if it means creating solutions like 
> using parentheses containing the reply to use.
Yes, so do I. Translate the explanation, but not the action.

Cheers
- Lübbe

--
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by Marc Haisenko <ha...@webport.de>.
On Monday 06 December 2004 11:40, Øyvind A. Holm wrote:
> On 2004-12-05 20:13:21 Norbert Unterberg wrote:
> > Here my suggestion:
> > Allow to localize the replies as well.
>
> Oh no, please don't. This will lead to potential problems and accidents
> when using svn under different locales, or if the locale for some reason
> changes into C or something else. An example would be the
>
>   Log message unchanged or not specified
>   a)bort, c)ontinue, e)dit
>
> prompt. If you're used to press "a" to abort a commit, and this keypress
> instead results in an accidental commit, it would be a Bad Thing indeed.
> I believe a consistent command set across the languages would be the
> safest and easiest way to go, even if it means creating solutions like
> using parentheses containing the reply to use.
>
> Regards,
> Øyvind A. Holm

Yup, I totally agree. It's better to mark it another way. E.g. a German 
version could look something like this:

  [a] Abbrechen, [c] Weiter, [e] Editieren

or whatever... just find a way to not localize the key to press ! I normally 
have all my systems set to english although I'm a German. All other people I 
know have their systems set to german. So when I sit down on their systems 
I'd not only have curse about them having a german keyboard layout, I'd also 
have to pay attention to not enter the wrong reply keys which would make it 
unnecessary hard for me (or anyone who sits down on MY system ;-)

And if in some language the obvious (or even only) choices would lead to the 
letter 'a' being continue that would really be a bad thing, like in:

 a)lter message, c)ancel, e)rrr... whatever, go on ;-)

-- 
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: haisenko@webport.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by "Øyvind A. Holm" <su...@sunbase.org>.
On 2004-12-05 20:13:21 Norbert Unterberg wrote:
> While doing some polishing work on the German translation, I noticed 
> something which currently fails to localize: The user's response when 
> subversion asks questions:
>
> Example: in clients/cmdline/prompt.c:297 subversion asks the user:
> (R)eject, accept (t)emporarily or accept (p)ermanently?
> Obviously the possible replies are R, T, P which correspond to the 
> first letters of some words in the question. These letters are hard 
> coded in the source code and can not be localized. Can you imagine how 
> hard is it to find adequate words in different languages that also 
> contain these letters?
>
> Here my suggestion:
> Allow to localize the replies as well.

Oh no, please don't. This will lead to potential problems and accidents 
when using svn under different locales, or if the locale for some reason 
changes into C or something else. An example would be the

  Log message unchanged or not specified
  a)bort, c)ontinue, e)dit

prompt. If you're used to press "a" to abort a commit, and this keypress
instead results in an accidental commit, it would be a Bad Thing indeed. 
I believe a consistent command set across the languages would be the 
safest and easiest way to go, even if it means creating solutions like 
using parentheses containing the reply to use.

Regards,
Øyvind A. Holm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Tue, 7 Dec 2004, [UTF-8] Branko �^Libej wrote:

> Peter N. Lundblad wrote:
>
> >string. Something like:
> >svn_error_t *
> >svn_utf_next_char(unsigned &code, const char **follow, const char *pos);
> >
> >
> You're going to break your head ate verey turn if you try to handle
> multibyte sequences like that. The only reasonable solution here is to
> use wide chars instead of UTF-8 in such places. Which, after a while,
> meanse everywhere (and convert to UTF-8 when doing network I/O)
>
The unsigned in my example was intended to be a wide char. I don't see why
it is a bad idea to extract complete characters from a multi-byte string.
How do you think other software that handle UTF8 internally handle this?
And no, I odn't think we should go over to using UCS-4 internally.

BR,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Localization of user replies

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>Branko ÄŒibej <br...@xbc.nu> writes:
>
>  
>
>>Peter N. Lundblad wrote:
>>
>>    
>>
>>>It most probably doesn't. We need code to get UTF8 *characters* from a
>>>string. Something like:
>>>svn_error_t *
>>>svn_utf_next_char(unsigned &code, const char **follow, const char *pos);
>>>
>>>      
>>>
>>You're going to break your head ate verey turn if you try to handle
>>multibyte sequences like that. The only reasonable solution here is to
>>use wide chars instead of UTF-8 in such places. Which, after a while,
>>meanse everywhere (and convert to UTF-8 when doing network I/O)
>>    
>>
>
>In this particular case could we not simply use null-terminated
>strings and strcmp instead of single bytes?
>
>    const char *reject[] = {"R", "r"};
>    const char *temp[] = {"T", "t"};
>    const char *perm[] = {"P", "p"};
>    const char *choice;
>    SVN_ERR (prompt (&choice, ...));
>    if (!strcmp (choice, reject[0])  || !strcmp (choice, reject[1]))
>       ...
>    else if (!strcmp (choice, temp[0])  || !strcmp (choice, temp[1]))
>       ...
>    else if (!strcmp (choice, perm[0])  || !strcmp (choice, perm[1]))
>  
>
Yes, much better. It would work quite nicely.

-- Brane



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> Peter N. Lundblad wrote:
>
>>It most probably doesn't. We need code to get UTF8 *characters* from a
>>string. Something like:
>>svn_error_t *
>>svn_utf_next_char(unsigned &code, const char **follow, const char *pos);
>>
> You're going to break your head ate verey turn if you try to handle
> multibyte sequences like that. The only reasonable solution here is to
> use wide chars instead of UTF-8 in such places. Which, after a while,
> meanse everywhere (and convert to UTF-8 when doing network I/O)

In this particular case could we not simply use null-terminated
strings and strcmp instead of single bytes?

    const char *reject[] = {"R", "r"};
    const char *temp[] = {"T", "t"};
    const char *perm[] = {"P", "p"};
    const char *choice;
    SVN_ERR (prompt (&choice, ...));
    if (!strcmp (choice, reject[0])  || !strcmp (choice, reject[1]))
       ...
    else if (!strcmp (choice, temp[0])  || !strcmp (choice, temp[1]))
       ...
    else if (!strcmp (choice, perm[0])  || !strcmp (choice, perm[1]))
       ...

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by Branko Čibej <br...@xbc.nu>.
Peter N. Lundblad wrote:

>On Sun, 5 Dec 2004, Philip Martin wrote:
>
>  
>
>>Norbert Unterberg <ne...@gmx.net> writes:
>>
>>    
>>
>>>const char *replies = _("RrTtPp");  /* allow l10n */
>>>
>>>...
>>>
>>>  svn_stringbuf_appendcstr
>>>
>>>    (buf, _("(R)eject, accept (t)emporarily or accept (p)ermanently? "));
>>>
>>>...
>>>
>>>  SVN_ERR (prompt (&choice, buf->data, FALSE, ctx, pool));
>>>
>>>  if (choice && (choice[0] == replies[2] || choice[0] == replies[3]))
>>>
>>>   { ... }
>>>      
>>>
>>I think it assumes that the replies are represented by single bytes.
>>While that may be acceptable for western languages does it apply to
>>things like Chinese?  Hmm, our prompt code doesn't appear to handle
>>multiple byte replies either :(
>>
>>
>>    
>>
>It most probably doesn't. We need code to get UTF8 *characters* from a
>string. Something like:
>svn_error_t *
>svn_utf_next_char(unsigned &code, const char **follow, const char *pos);
>  
>
You're going to break your head ate verey turn if you try to handle 
multibyte sequences like that. The only reasonable solution here is to 
use wide chars instead of UTF-8 in such places. Which, after a while, 
meanse everywhere (and convert to UTF-8 when doing network I/O)

But this is a really huge amount of work.


-- Brane



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Sun, 5 Dec 2004, Philip Martin wrote:

> Norbert Unterberg <ne...@gmx.net> writes:
>
> > const char *replies = _("RrTtPp");  /* allow l10n */
> >
> > ...
> >
> >   svn_stringbuf_appendcstr
> >
> >     (buf, _("(R)eject, accept (t)emporarily or accept (p)ermanently? "));
> >
> > ...
> >
> >   SVN_ERR (prompt (&choice, buf->data, FALSE, ctx, pool));
> >
> >   if (choice && (choice[0] == replies[2] || choice[0] == replies[3]))
> >
> >    { ... }
>
> I think it assumes that the replies are represented by single bytes.
> While that may be acceptable for western languages does it apply to
> things like Chinese?  Hmm, our prompt code doesn't appear to handle
> multiple byte replies either :(
>
>
It most probably doesn't. We need code to get UTF8 *characters* from a
string. Something like:
svn_error_t *
svn_utf_next_char(unsigned &code, const char **follow, const char *pos);

This is needed (in some form) for *real* character (not byte)
classification functions, which we also need. I've been thinking about
tackling this, but ceratinly not before locking is done. So, if I will do
it, it will probably be in 1.3. Anyone, feel free to do it before that,
ofcourse.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Mon, 6 Dec 2004, plasma wrote:

> On Sun, Dec 05, 2004 at 08:45:36PM +0000, Philip Martin wrote:
> > Norbert Unterberg <ne...@gmx.net> writes:
> >
> > I think it assumes that the replies are represented by single bytes.
> > While that may be acceptable for western languages does it apply to
> > things like Chinese?  Hmm, our prompt code doesn't appear to handle
> > multiple byte replies either :(
>
> That's OK for Chinese.  We are used to find a key that is not related
> to the translation.  And you might know that we have to hit various
> keys to compose a character.  That is not efficient to hit 'qss ' (the
> first character for 'reject' using Chang Jei method) instead of 'r'.
>

> No matter wheter it's an 'R' in German or other language for 'Reject',
> I'll just stick with 'R'. :)
>
I think this is ugly (in general, I understand the reasons for Chinese).
If I have a program saying "Some Swedish question? (Y/N", I get annoyed,
since "Ja" (yes) starts with J, so that's the natural thing to type. But
if most non-English users don't want this, I'm going to drop it. There are
more important things to concentrate on:-) BTW, there is an issue for this
at the moment: #2155.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by plasma <pl...@ms9.hinet.net>.
On Sun, Dec 05, 2004 at 08:45:36PM +0000, Philip Martin wrote:
> Norbert Unterberg <ne...@gmx.net> writes:
> 
> > const char *replies = _("RrTtPp");  /* allow l10n */
> >
> > ...
> >
> >   svn_stringbuf_appendcstr
> >
> >     (buf, _("(R)eject, accept (t)emporarily or accept (p)ermanently? "));
> >
> > ...
> >
> >   SVN_ERR (prompt (&choice, buf->data, FALSE, ctx, pool));
> >
> >   if (choice && (choice[0] == replies[2] || choice[0] == replies[3]))
> >
> >    { ... }
> 
> I think it assumes that the replies are represented by single bytes.
> While that may be acceptable for western languages does it apply to
> things like Chinese?  Hmm, our prompt code doesn't appear to handle
> multiple byte replies either :(

That's OK for Chinese.  We are used to find a key that is not related
to the translation.  And you might know that we have to hit various
keys to compose a character.  That is not efficient to hit 'qss ' (the
first character for 'reject' using Chang Jei method) instead of 'r'.

No matter wheter it's an 'R' in German or other language for 'Reject',
I'll just stick with 'R'. :)


plasma
Translator of zh_TW.po.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by kf...@collab.net.
"Peter N. Lundblad" <pe...@famlundblad.se> writes:
> > Laudable as this ambition is, I wonder if the complexity required to
> > implement this is worth it?
>
> I don't think it is very complex (see my other mail) and it makes the
> response more intuitive. I think it is woth it.

If you're willing to take it on, I certainly won't stand in the way,
then.  Good luck!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Sun, 5 Dec 2004 kfogel@collab.net wrote:

> Philip Martin <ph...@codematters.co.uk> writes:
> It does not work for Chinese, and many other languages (no matter the
> encoding, by the way -- it's impossible to represent all Chinese
> characters in a single byte).
>
> Laudable as this ambition is, I wonder if the complexity required to
> implement this is worth it?
>
I don't think it is very complex (see my other mail) and it makes the
response more intuitive. I think it is woth it.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by kf...@collab.net.
Philip Martin <ph...@codematters.co.uk> writes:
> I think it assumes that the replies are represented by single bytes.
> While that may be acceptable for western languages does it apply to
> things like Chinese?  Hmm, our prompt code doesn't appear to handle
> multiple byte replies either :(

It does not work for Chinese, and many other languages (no matter the
encoding, by the way -- it's impossible to represent all Chinese
characters in a single byte).

Laudable as this ambition is, I wonder if the complexity required to
implement this is worth it?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Localization of user replies

Posted by Philip Martin <ph...@codematters.co.uk>.
Norbert Unterberg <ne...@gmx.net> writes:

> const char *replies = _("RrTtPp");  /* allow l10n */
>
> ...
>
>   svn_stringbuf_appendcstr
>
>     (buf, _("(R)eject, accept (t)emporarily or accept (p)ermanently? "));
>
> ...
>
>   SVN_ERR (prompt (&choice, buf->data, FALSE, ctx, pool));
>
>   if (choice && (choice[0] == replies[2] || choice[0] == replies[3]))
>
>    { ... }

I think it assumes that the replies are represented by single bytes.
While that may be acceptable for western languages does it apply to
things like Chinese?  Hmm, our prompt code doesn't appear to handle
multiple byte replies either :(

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org