List Info

Thread: International support for workbench




International support for workbench
user name
2007-11-24 22:08:37
Hello everyone,

    I use workbench in chinese, I encounter some problem
with gbk filename and 
comments, actually it will happen for any none ascii code.
So I looking 
through the codes, and do some change for the display
information, now it 
worked for me, but there's the lazy way to finish it, so I
wonder if anybody 
do the same work? if no otherelse do the work, I'd like to
do that, and 
commit the code after using a better way.

    Another work is international language support, I use a
chinese language 
resource file for all the menu( not with dialogs yet), and
load the string 
from the language file,  this work involved some other
files. 


		bingle
		2007-11-25


------------------------------------------------------------
----------------------------------
Confidentiality Notice: The information contained in this
e-mail and any accompanying attachment(s) is intended only
for the use of the intended recipient and may be
confidential and/or privileged of Neusoft Group Ltd., its
subsidiaries and/or its affiliates. If any reader of this
communication is not the intended recipient, unauthorized
use, forwarding, printing, storing, disclosure or copying is
strictly prohibited, and may be unlawful. If you have
received this communication in error, please immediately
notify the sender by return e-mail, and delete the original
message and all copies from your system. Thank you. 
------------------------------------------------------------
-----------------------------------

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


Re: International support for workbench
user name
2007-11-25 07:25:42
On Nov 25, 2007, at 04:08, bingle wrote:

> Hello everyone,
>
>     I use workbench in chinese, I encounter some
problem with gbk  
> filename and
> comments, actually it will happen for any none ascii
code. So I  
> looking
> through the codes, and do some change for the display
information,  
> now it
> worked for me, but there's the lazy way to finish it,
so I wonder  
> if anybody
> do the same work? if no otherelse do the work, I'd like
to do that,  
> and
> commit the code after using a better way.

Workbench is supposed to use unicode everywhere. None ASCII
is supposed
to work. What code did you need to fix? Do you have a patch
I can  
review and apply?

>
>     Another work is international language support, I
use a chinese  
> language
> resource file for all the menu( not with dialogs yet),
and load the  
> string
> from the language file,  this work involved some other
files.

I've been thinking about adding internationalization
support. At work we
did this for our product which has taught me what is
required for  
european
languages. I know that asian scripts may require more work
to deal with
direction of writting.

Did you use the gettext module that is part of python?

Barry

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


Re: International support for workbench
user name
2007-11-25 09:36:45
View Original Image
  
  
  
Re: International support for workbench
user name
2007-11-25 19:46:32
Barry Scott:

    I'm sorry about last mail, it seems something wrong with
my kmail deal 
with attachment.


    Shortly, wb throw exception for cannot convert a utf-8
filename with gbk
chars to ascii in the bottom status window, when wb try to
display the
filename in the status window or to open it use shell. Even
though I change

the default encoding to gbk in the site.py, wb also report
convert to gbk
failure sometimes. It only work well when I use utf8
encoding in the site.py.

    The errors was happened in my windows, I changed to
freebsd some days ago,
Now when I use wb1.5.2, the exception not happen in my
freebsd os. I think it
is related with the enviroment, I will check it in the next
days. I think the
problem is different of the filename encoding : svn server
use utf-8, os use
gbk/unicode.


    I'm newbie for python, I know nothing about gettext. I
just use the
troditional way in windows software: let the user choose the
language he like
(see attach wb-lang-menu). I implement it by put all strings
into a language
file(menu strings see language.en), and use a function to
get the strings
from the prefered language file instead of the build-in
string. The prefered
language saved in the preference file, when wb startup, load
the language
strings into a dict.

attach files:
wb_language:    Module used to get the strings from the
prefered language file
wb_frame: 	a modified version sample



	bingle
	2007-11-25

----------------  Original Message  ---------------
46rom: Barry Scott <barrybarrys-emacs.org>
To: devpysvn.tigris.org
CC:
Send: 2007-11-25 D0C7C6DAC8D5 21:25
Subject: Re: International support for workbench

>
> On Nov 25, 2007, at 04:08, bingle wrote:
>
> > Hello everyone,
> >
> >     I use workbench in chinese, I encounter some
problem with gbk 
> > filename and
> > comments, actually it will happen for any none
ascii code. So I 
> > looking
> > through the codes, and do some change for the
display information, 
> > now it
> > worked for me, but there's the lazy way to finish
it, so I wonder 
> > if anybody
> > do the same work? if no otherelse do the work, I'd
like to do that, 
> > and
> > commit the code after using a better way.
>
> Workbench is supposed to use unicode everywhere. None
ASCII is supposed
> to work. What code did you need to fix? Do you have a
patch I can 
> review and apply?
>
> >
> >     Another work is international language
support, I use a chinese 
> > language
> > resource file for all the menu( not with dialogs
yet), and load the 
> > string
> > from the language file,  this work involved some
other files.
>
> I've been thinking about adding internationalization
support. At work we
> did this for our product which has taught me what is
required for 
> european
> languages. I know that asian scripts may require more
work to deal with
> direction of writting.
>
> Did you use the gettext module that is part of python?
>
> Barry
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
> For additional commands, e-mail: dev-helppysvn.tigris.org
>
>



------------------------------------------------------------
----------------------------------
Confidentiality Notice: The information contained in this
e-mail and any accompanying attachment(s) is intended only
for the use of the intended recipient and may be
confidential and/or privileged of Neusoft Group Ltd., its
subsidiaries and/or its affiliates. If any reader of this
communication is not the intended recipient, unauthorized
use, forwarding, printing, storing, disclosure or copying is
strictly prohibited, and may be unlawful. If you have
received this communication in error, please immediately
notify the sender by return e-mail, and delete the original
message and all copies from your system. Thank you. 
------------------------------------------------------------
-----------------------------------


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org
View Original Image
  
  
  
Re: International support for workbench
user name
2007-11-27 14:22:30

On Nov 26, 2007, at 01:46, bingle wrote:

Barry Scott:

    I'm sorry about last mail, it seems something wrong with my kmail deal 
with attachment.


    Shortly, wb throw exception for cannot convert a utf-8 filename with gbk
chars to ascii in the bottom status window, when wb try to display the
filename in the status window or to open it use shell. Even though I change

the default encoding to gbk in the site.py, wb also report convert to gbk
failure sometimes. It only work well when I use utf8 encoding in the site.py.

    The errors was happened in my windows, I changed to freebsd some days ago,
Now when I use wb1.5.2, the exception not happen in my freebsd os. I think it
is related with the enviroment, I will check it in the next days. I think the
problem is different of the filename encoding : svn server use utf-8, os use
gbk/unicode.

Do you mean that on Microsoft Windows you see the traceback but on FreeBSB
it works?

The Windows file system is Unicode. I would have assumed that Chinese
file names would just work. Can you send me the traceback so that I
can check what might be wrong.

What does it mean to use "gbk"?



    I'm newbie for python, I know nothing about gettext. I just use the
troditional way in windows software: let the user choose the language he like
(see attach wb-lang-menu). I implement it by put all strings into a language
file(menu strings see language.en), and use a function to get the strings
from the prefered language file instead of the build-in string. The prefered
language saved in the preference file, when wb startup, load the language
strings into a dict.

attach files:
wb_language:    Module used to get the strings from the prefered language file
wb_frame: a modified version sample



I'm only willing to accept gettext changes. Its easy to use gettext.

Example without gettext:

print 'Hello world'

Example with gettext:
print _('Hello world')

Of course there is some setup in main that is required to select the translation to use
but that I can do with a small amount of work.

See the python documentation on gettext and the GNU documentation, google for
gettext documentation. Also the poedit tool is great for doing the translation.

Barry

Re: International support for workbench
user name
2007-11-28 03:29:15
I'll add the gettext framework to workbench with a example
number of  
messages.
I will also write notes to guide the developer and
translator.

Then it will be easy for you to help internationalize
workbench and  
add chinese
support.

I start on this last night and will checkin on trunk in a
day or so.

What OS are you working on? It is easiest to start on Unix
systems.
Windows will take a bit longer (the gettext tools are not
installed on
windows so I'll have to find kits and document the
dependancy).

Barry


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


Re: International support for workbench
user name
2007-11-29 19:45:01
Barry Scott:

    I'm sorry for I'm on biz-trip last 3 days, I'll work on
this at this 
weekend.


	bingle
	2007-11-30

-----------------  Original Message  ---------------
From: Barry Scott <barrybarrys-emacs.org>
To: devpysvn.tigris.org
CC: 
Send: 2007-11-28 ÐÇÆÚÈý 04:22
Subject: Re: International support for workbench

> 
> On Nov 26, 2007, at 01:46, bingle wrote:
> 
> > Barry Scott:
> >
> >     I'm sorry about last mail, it seems something
wrong with my  
> > kmail deal
> > with attachment.
> >
> >
> >     Shortly, wb throw exception for cannot convert
a utf-8 filename  
> > with gbk
> > chars to ascii in the bottom status window, when
wb try to display the
> > filename in the status window or to open it use
shell. Even though  
> > I change
> >
> > the default encoding to gbk in the site.py, wb
also report convert  
> > to gbk
> > failure sometimes. It only work well when I use
utf8 encoding in  
> > the site.py.
> >
> >     The errors was happened in my windows, I
changed to freebsd  
> > some days ago,
> > Now when I use wb1.5.2, the exception not happen
in my freebsd os.  
> > I think it
> > is related with the enviroment, I will check it in
the next days. I  
> > think the
> > problem is different of the filename encoding :
svn server use  
> > utf-8, os use
> > gbk/unicode.
> 
> Do you mean that on Microsoft Windows you see the
traceback but on  
> FreeBSB
> it works?
> 
> The Windows file system is Unicode. I would have
assumed that Chinese
> file names would just work. Can you send me the
traceback so that I
> can check what might be wrong.
> 
> What does it mean to use "gbk"?
> 
> >
> >
> >     I'm newbie for python, I know nothing about
gettext. I just use  
> > the
> > troditional way in windows software: let the user
choose the  
> > language he like
> > (see attach wb-lang-menu). I implement it by put
all strings into a  
> > language
> > file(menu strings see language.en), and use a
function to get the  
> > strings
> > from the prefered language file instead of the
build-in string. The  
> > prefered
> > language saved in the preference file, when wb
startup, load the  
> > language
> > strings into a dict.
> >
> > attach files:
> > wb_language:    Module used to get the strings
from the prefered  
> > language file
> > wb_frame: 	a modified version sample
> >
> >
> 
> I'm only willing to accept gettext changes. Its easy to
use gettext.
> 
> Example without gettext:
> 
> 	print 'Hello world'
> 
> Example with gettext:
> 	print _('Hello world')
> 
> Of course there is some setup in main that is required
to select the  
> translation to use
> but that I can do with a small amount of work.
> 
> See the python documentation on gettext and the GNU
documentation,  
> google for
> gettext documentation. Also the poedit tool is great
for doing the  
> translation.
> 
> Barry
> 
> 



------------------------------------------------------------
----------------------------------
Confidentiality Notice: The information contained in this
e-mail and any accompanying attachment(s) is intended only
for the use of the intended recipient and may be
confidential and/or privileged of Neusoft Group Ltd., its
subsidiaries and/or its affiliates. If any reader of this
communication is not the intended recipient, unauthorized
use, forwarding, printing, storing, disclosure or copying is
strictly prohibited, and may be unlawful. If you have
received this communication in error, please immediately
notify the sender by return e-mail, and delete the original
message and all copies from your system. Thank you. 
------------------------------------------------------------
-----------------------------------

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


Re: International support for workbench
user name
2007-12-01 01:33:54
I have Mac and Unix support for i18n done.

If you work on FreeBSD with the latest sources from /trunk
you will  
see that
the linux.mak makefile now runs some scripts to build the
message  
catalogs.

./make-pot-file.sh will create a pot file that can be turned
into  
a .po file using
./make-po-file.sh

./make-mo-file.sh turns the po file into a mo file that is
used at  
run time.

For Chinese you will need to:

edit make-mo-file.sh to add "cn". then you can:

To work on the translation you will:

1. Edit workbench source to add T_, S_ and U_ wrappers
around messages
2. ./make-pot-file.sh
     create a new pot file
3. ./make-po-file.sh cn
     merges existing translations with new messages
4. cp I18N/pysvn_workbench_cn.current.po
I18N/pysvn_workbench_cn.po
    if you do not do this your work will be over written!
5. edit the po file to add translations
   use poedit tool
6. ./make-mo-file.sh
   create the mo file to allow testing
7. ./wb.sh
   test workbench

There are three wrappers functions used for translation.

T_('string')
marks a message for translation.

P_('singular', 'plural', count)
marks a message that needs plural forms

U_('string')
marks a message for translation but does not translate it.
This is required for messages setup at the module level.
A later call to T() will do the translation.

See wb_frame.py that has title marked on line 42.

I suggest you get one message translated to make sure the
procedure  
is working
for you. Make sure that you have your locale set to Chinese
otherwise  
the english
translation will be used.

Barry

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


Re: International support for workbench
user name
2007-12-06 14:12:37
On Nov 30, 2007, at 01:45, bingle wrote:

> Barry Scott:
>
>     I'm sorry for I'm on biz-trip last 3 days, I'll
work on this at  
> this
> weekend.
>
>

No problem. I have just committed show I18N changes from
Giulio Paci  
who is
interested in adding an Italian translation.

Let me have  any patches to add the T_ etc as you go and
I'll commit  
to trunk.

Barry


> 	bingle
> 	2007-11-30
>
> -----------------  Original Message  ---------------
> From: Barry Scott <barrybarrys-emacs.org>
> To: devpysvn.tigris.org
> CC:
> Send: 2007-11-28 ÐÇÆÚÈý 04:22
> Subject: Re: International support for workbench
>
>>
>> On Nov 26, 2007, at 01:46, bingle wrote:
>>
>>> Barry Scott:
>>>
>>>     I'm sorry about last mail, it seems
something wrong with my
>>> kmail deal
>>> with attachment.
>>>
>>>
>>>     Shortly, wb throw exception for cannot
convert a utf-8 filename
>>> with gbk
>>> chars to ascii in the bottom status window,
when wb try to  
>>> display the
>>> filename in the status window or to open it use
shell. Even though
>>> I change
>>>
>>> the default encoding to gbk in the site.py, wb
also report convert
>>> to gbk
>>> failure sometimes. It only work well when I use
utf8 encoding in
>>> the site.py.
>>>
>>>     The errors was happened in my windows, I
changed to freebsd
>>> some days ago,
>>> Now when I use wb1.5.2, the exception not
happen in my freebsd os.
>>> I think it
>>> is related with the enviroment, I will check it
in the next days. I
>>> think the
>>> problem is different of the filename encoding :
svn server use
>>> utf-8, os use
>>> gbk/unicode.
>>
>> Do you mean that on Microsoft Windows you see the
traceback but on
>> FreeBSB
>> it works?
>>
>> The Windows file system is Unicode. I would have
assumed that Chinese
>> file names would just work. Can you send me the
traceback so that I
>> can check what might be wrong.
>>
>> What does it mean to use "gbk"?
>>
>>>
>>>
>>>     I'm newbie for python, I know nothing about
gettext. I just use
>>> the
>>> troditional way in windows software: let the
user choose the
>>> language he like
>>> (see attach wb-lang-menu). I implement it by
put all strings into a
>>> language
>>> file(menu strings see language.en), and use a
function to get the
>>> strings
>>> from the prefered language file instead of the
build-in string. The
>>> prefered
>>> language saved in the preference file, when wb
startup, load the
>>> language
>>> strings into a dict.
>>>
>>> attach files:
>>> wb_language:    Module used to get the strings
from the prefered
>>> language file
>>> wb_frame: 	a modified version sample
>>>
>>>
>>
>> I'm only willing to accept gettext changes. Its
easy to use gettext.
>>
>> Example without gettext:
>>
>> 	print 'Hello world'
>>
>> Example with gettext:
>> 	print _('Hello world')
>>
>> Of course there is some setup in main that is
required to select the
>> translation to use
>> but that I can do with a small amount of work.
>>
>> See the python documentation on gettext and the GNU
documentation,
>> google for
>> gettext documentation. Also the poedit tool is
great for doing the
>> translation.
>>
>> Barry
>>
>>
>
>
>
>
------------------------------------------------------------
---------- 
> ------------------------
> Confidentiality Notice: The information contained in
this e-mail  
> and any accompanying attachment(s) is intended only for
the use of  
> the intended recipient and may be confidential and/or
privileged of  
> Neusoft Group Ltd., its subsidiaries and/or its
affiliates. If any  
> reader of this communication is not the intended
recipient,  
> unauthorized use, forwarding, printing, storing,
disclosure or  
> copying is strictly prohibited, and may be unlawful. If
you have  
> received this communication in error, please
immediately notify the  
> sender by return e-mail, and delete the original
message and all  
> copies from your system. Thank you.
>
------------------------------------------------------------
---------- 
> -------------------------
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
> For additional commands, e-mail: dev-helppysvn.tigris.org
>
>

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org


[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )