It is currently Sun Feb 12, 2012 7:04 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Two more reporting problems in Chinese
PostPosted: Wed Sep 02, 2009 3:18 pm 
Offline

Joined: Mon Jul 20, 2009 2:52 pm
Posts: 26
Location: Shanghai
Hi there,
While I am at it, I better share with you two other problems I encountered and, I am happy to report, overcame.

1. It seems that a setting for the format of Chinese dates as
Code:
%Y年%m月%d日
in Administration/Translations/Application Terms/Languages/Chinese gives problems when printing reports. The code can't seem to handle the Chinese characters. The work-around is to replace the format pattern by the perfectly acceptable
Code:
%Y.%m.%d
that solves the problem. Same goes mutatis mutandis for the time format.

2. When printing a purchase order the Date Required is printed as a full date-time string, overlapping in my case the Amount Required, not workable and time is not really required here anyhow. So I thought, well I just need to change the fiedd
Code:
[[ formatLang(line.date_planned,date_time=True)]]
in the order.rml file into:
Code:
[[formatLang(line.date_planned,date=True)]]
but nothing is as easy as it seems. The output stayed the same. I was not amused. Got to dig in the code again. Found the culprit in the file report_sxw.py in the directory openerp-server/report directory. The method formatLang needs to be adapted a bit. I changed this clause
Code:
            if not isinstance(value, time.struct_time):
                try:
                    date = mx.DateTime.strptime(str(value),parse_format)
                except:# sometimes it takes converted values into value, so we dont need conversion.
                    if date:
                        return str(value).split()[0]
                    else:
                        return str(value)

The original code did not make any difference between date=True and date_time=True in that particular clause so changing date_time=True into date=True in the rml file did not have any effect. Now it has.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 11, 2009 2:30 pm 
Offline

Joined: Thu Jun 25, 2009 6:19 am
Posts: 75
Location: Shanghai
Hi bhikkhu,
1. I made the date modification as you proposed but I still have the Chinese date format appearing in the forms. Is it normal?

2. Great : it solved one problem I had with code still appearing in the report.

3. Additionnal question: half the modules are not translated into Chinese : do you know where I can find a complete translation or do I have to do it myself?

regards
Eric


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 13, 2009 8:15 am 
Offline

Joined: Thu Jul 26, 2007 3:24 am
Posts: 73
hi elicoidal,

1. It should be normal as long as it didn't bring troubles. The Chinese date format presumably comes from your default locale setting.

3. One of our friend sponsored to get openerp (over 60 modules) translated into sim-Chinese through a language translation agency. Although the translation has been done, it contains plenty of mistranslations and inconsistent terms as it was translated away from the context. We are improving it. Once it gets better, we will surely port it into official openerp language repository.

For testing purpose, you may export it from demo.shine-it.net
use admin/admin to log in.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 13, 2009 8:45 am 
Offline

Joined: Thu Jun 25, 2009 6:19 am
Posts: 75
Location: Shanghai
1. My system setup is English but I noticed that as soon as I load an official translation in the server, the client regional setup change to the most recently loaded language.

3. I will have a look but I already fear what I will see... Indeed context is important. I dont yet how and when but I probably can give a hand somewhere as I would like to have openerp fully translated into Chinese. What would be the best method if I want to participate in the translation?

Eric


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 13, 2009 11:04 am 
Offline

Joined: Thu Jun 25, 2009 6:19 am
Posts: 75
Location: Shanghai
I tried to download the Chinese translation from the website (I assumed that PO file format was 采购订单 ;-)) but got the following error:

Traceback (most recent call last):
File "/home/digitalsatori/oe5/server/bin/netsvc.py", line 244, in dispatch
result = LocalService(service_name)(method, *params)
File "/home/digitalsatori/oe5/server/bin/netsvc.py", line 73, in __call__
return getattr(self, method)(*params)
File "/home/digitalsatori/oe5/addons/audittrail/audittrail.py", line 346, in execute
res = my_fct(db, uid, passwd, object, method, *args)
File "/home/digitalsatori/oe5/addons/audittrail/audittrail.py", line 336, in my_fct
return fct_src(db, uid, passwd, object, method, *args)
File "/home/digitalsatori/oe5/server/bin/service/web_services.py", line 583, in execute
res = service.execute(db, uid, object, method, *args)
File "/home/digitalsatori/oe5/server/bin/osv/osv.py", line 59, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/digitalsatori/oe5/server/bin/osv/osv.py", line 118, in execute
res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/digitalsatori/oe5/server/bin/osv/osv.py", line 110, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/digitalsatori/oe5/server/bin/addons/base/module/wizard/wizard_export_lang.py", line 53, in act_getfile
tools.trans_export(this.lang, mods, buf, this.format, dbname=cr.dbname)
File "/home/digitalsatori/oe5/server/bin/tools/translate.py", line 330, in trans_export
trans = trans_generate(lang, modules, dbname)
File "/home/digitalsatori/oe5/server/bin/tools/translate.py", line 539, in trans_generate
trad = getattr(obj, field_name) or ''
File "/home/digitalsatori/oe5/server/bin/osv/orm.py", line 229, in __getattr__
return self[name]
File "/home/digitalsatori/oe5/server/bin/osv/orm.py", line 190, in __getitem__
datas = self._table.read(self._cr, self._uid, ids, fffields, context=self._context, load="_classic_write")
File "/home/digitalsatori/oe5/server/bin/osv/orm.py", line 2119, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/digitalsatori/oe5/server/bin/osv/orm.py", line 2173, in _read_flat
self._order), sub_ids)
File "/home/digitalsatori/oe5/server/bin/sql_db.py", line 76, in wrapper
return f(self, *args, **kwargs)
File "/home/digitalsatori/oe5/server/bin/sql_db.py", line 120, in execute
res = self._obj.execute(query, params)
ProgrammingError: column "follow_up_msg" does not exist
LINE 1: ...name","parent_id","overdue_msg","timesheet_range","follow_up...
^
Any idea why?

Eric


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 15, 2009 2:54 am 
Offline

Joined: Thu Jul 26, 2007 3:24 am
Posts: 73
Quote:
I assumed that PO file format was 采购订单 Wink

That's embarrassing :oops:

The arisen error could be due to the reason that I didn't update the database accordingly after upgrade the openerp source code. Anyway, you may donwload it here: http://shine-it.net/viewthread.php?tid=663&extra=page%3D1

Quote:
What would be the best method if I want to participate in the translation?


Please register in the shine-it.net forum and drop a note to introduce yourself a bit. I'm setting up a translation collaboration server, you will be invited once the setup is done.

Tony


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 15, 2009 8:51 am 
Offline

Joined: Mon Jul 20, 2009 2:52 pm
Posts: 26
Location: Shanghai
Hi Eric,
I tried downloading one PO file from digitalsatori's site and did not have any problem. Perhaps you tried to download a malformed file, probably as part of a set of files. The malformed filed might have something to do with HR or projects (the error mentions 'timesheet').

As to translations, I am facing the same problem and need Open ERP translated into Chinese as well. I have made some contributions on Launchpad ) basing myself also on the July version of the translation digitalsatori is referring to. The newer version of September is much better but would still need review. Both versions can be found here. I will be updating Launchpad in the coming weeks. You might want to make a contribution there as well. I would recommend that everybody works in Launchpad which is the 'official' location and not elsewhere so that everybody can benefit. The system works quite well in my experience.

Cheers!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 15, 2009 10:34 am 
Offline

Joined: Thu Jun 25, 2009 6:19 am
Posts: 75
Location: Shanghai
I could download the file from the link given by digitalsatori.
I will try to have a look at it this week end. Concerning versioning, I want to avoid working in a file which is not up to date (and I assume Launch pad is the central place to make all uoptodate changes available for all) but I have no experience in using the lauchpad actually. I will have a look at it but any quick reference link would be appreciated.

Eric


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 18, 2009 7:24 am 
Offline

Joined: Thu Jul 26, 2007 3:24 am
Posts: 73
The initial thought to set up a separate translation collaboration server is because Launchpad is very slow to access from China, and it is not that intuitive to manipulate.

As I revisited launchpad today, I found that the speed is not a big issue now and the Rosetta translation platform is quite handy. We only need to give a little guidance for the contributors to work on launchpad.

So, I totally agree with you, bhikkhu. I will contribute directly on launchpad instead of creating another contribution platform, and I will encourage more people to do so.

@Eric : The Chinese translation on launchpad locates at:
https://translations.launchpad.net/open ... lang/zh_CN

Please sign up a launchpad account and join both "OpenERP & OpenObject Community" Team and "Open ERP Chinese" Team for contribution.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 18, 2009 10:20 am 
Offline

Joined: Thu Jun 25, 2009 6:19 am
Posts: 75
Location: Shanghai
I registered already but I dont know how to include myself in a team...
Is the translation in launchpad including the one in shine-it?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 19, 2009 5:30 am 
Offline

Joined: Thu Jul 26, 2007 3:24 am
Posts: 73
once log into launchpad, go to https://launchpad.net/~openerp-chinese-team and https://launchpad.net/~openerp-community and click the 'Join team' button at the right hand side.

Quote:
Is the translation in launchpad including the one in shine-it?

Not for the latest one, I will port the translations into launchpad in this week.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP