IRC logs of #tryton for Friday, 2013-10-18

chat.freenode.net #tryton log beginning Fri Oct 18 00:00:02 CEST 2013
2013-10-18 12:09 <WUD> Hi, I need help with the model singleton class
2013-10-18 12:52 <WUD> Hi
2013-10-18 12:52 <WUD> I need some help with Singletons
2013-10-18 16:39 <lids> hello
2013-10-18 16:40 <lids> is there a way to extract strings from code and make them translatable, like gettext does ?
2013-10-18 16:42 <cedk> lids: https://code.google.com/p/tryton/wiki/HowtoTranslate
2013-10-18 16:46 <Pilou> lids: cls._error_messages could be used: http://hg.tryton.org/2.8/modules/calendar_scheduling/file/10f880edc13a/calendar_.py#l40
2013-10-18 16:48 <lids> cedk: i can't find a hint about inline strings translation there
2013-10-18 16:49 <lids> Pilou: well, i would prefer having the strings extracted and not call them error_messages..
2013-10-18 16:50 <lids> extracted automatically*
2013-10-18 16:54 <lids> cedk: i assume the feature is not in tryton. don't you think it would be useful ?
2013-10-18 16:58 <cedk> lids: not like that
2013-10-18 16:58 <cedk> lids: we just need a generalisation of error message
2013-10-18 17:00 <lids> cedk: how would it work?
2013-10-18 17:02 <cedk> lids: create record in XML and retrive them by id
2013-10-18 17:08 <lids> cedk: if i understand correctly, that would be renaming 'error' type of ir.translation.type into something like 'inline', and having an other model to store the string ?
2013-10-18 17:08 <lids> strings*
2013-10-18 17:12 <lids> just a new type maybe..
2013-10-18 17:12 <cedk> lids: just rename error into message for example
2013-10-18 17:12 <cedk> lids: and stop define them on Model but in XML
2013-10-18 17:13 <cedk> lids: and refactoring raise_error
2013-10-18 17:15 <lids> cedk: what's the rational not to use gettext instead of storing the string in xml files ?
2013-10-18 17:18 <lids> or just extracting them
2013-10-18 17:24 <cedk> lids: we have a DB
2013-10-18 17:25 <lids> cedk: that's ok, they could be extracted from the modules and stored in the db like other strings
2013-10-18 17:26 <lids> i think gettext can do that easily, that's why i'm referencing to it
2013-10-18 17:27 <cedk> lids: it will mean link to something and from experience sharing them will improve it
2013-10-18 17:27 <cedk> lids: also with xml id, we are sure about the message used instead of string matching
2013-10-18 17:27 <cedk> lids: indeed I don't know what you are talking about when using "gettext"
2013-10-18 17:30 <lids> cedk: i mean when the user do the 'Set translations', the code is parsed, strings get an id based on the filename, line number and the string, and it gets inserted in the db
2013-10-18 17:31 <cedk> lids: no, code is not parsed
2013-10-18 17:31 <lids> cedk: we don't need gettext to do that, but it's the library the most used to do such things
2013-10-18 17:32 <lids> cedk: s/parsed/loaded into python/
2013-10-18 17:33 <cedk> lids: still I don't know which gettext you are talking about
2013-10-18 17:34 <cedk> lids: if you mean the gnu-gettext, it is more DB than anything else
2013-10-18 17:34 <lids> cedk: moreover, there is in fact more chance to forget a deprecated string in xml than wen they are extracted
2013-10-18 17:35 <lids> cedk: yes i'm talking about gnu-gettext, i'm not saying we need to use it, i'm saying it has features that great :)
2013-10-18 17:36 <lids> are+
2013-10-18 17:40 <cedk> lids: for me it leads to bad message translation
2013-10-18 17:42 <lids> cedk: in what way ?
2013-10-18 17:42 <cedk> lids: it is base on string matching
2013-10-18 17:44 <lids> cedk: that's what the fuzzy flag is there for
2013-10-18 17:45 <cedk> lids: no it is not his purpose
2013-10-18 17:47 <lids> cedk: i don't understand the problem of string matching then.. most free software have pretty good translations with gettext
2013-10-18 17:47 <cedk> lids: same string in english could translated differently in other language
2013-10-18 17:47 <cedk> lids: ex: "Invoice", it could be the object or the verb
2013-10-18 17:48 <cedk> gettext is just a DB with string matching, Tryton has a DB and string matching is not good enough for your usage
2013-10-18 17:49 <lids> cedk: ah, the filename and line number of the string is used to differentiate different instances of the same string
2013-10-18 17:49 <cedk> lids: if so, how does it work when line change of position ?
2013-10-18 17:49 <lids> cedk: fuzzy becomes true iirc
2013-10-18 17:50 <lids> cedk: it must be a bit more clevver than that, because line numbers change often
2013-10-18 17:51 <cedk> lids: any way, we don't need such DB
2013-10-18 17:51 <cedk> lids: come with a good argument
2013-10-18 17:51 <cedk> lids: and more over gnu-gettext is not thread safe
2013-10-18 17:51 <lids> cedk: sure the db is already there.. i'm talking about extracting the strings
2013-10-18 17:52 <lids> 17:35 < lids> cedk: yes i'm talking about gnu-gettext, i'm not saying we need to use it, i'm saying it has features that great :)
2013-10-18 17:52 <cedk> lids: so it is not gettext !
2013-10-18 17:52 <cedk> lids: and I say it is not because string matcing
2013-10-18 17:58 <lids> cedk: http://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html
2013-10-18 17:58 <lids> cedk: i'm talking about such a feature
2013-10-18 17:59 <cedk> lids: thanks, I know this
2013-10-18 17:59 <lids> cedk: it's just not just string matching as i explained above
2013-10-18 17:59 <cedk> lids: no the tools is about string extracting
2013-10-18 18:01 <lids> cedk: this one in particular yes, another command handle the string update..
2013-10-18 18:02 <lids> well.. whatever..
2013-10-18 18:59 -!- vcardon(~vcardon@LNeuilly-152-23-15-185.w193-252.abo.wanadoo.fr) has left #tryton
2013-10-18 20:36 -!- katr(~m@80-123-52-145.adsl.highway.telekom.at) has left #tryton
2013-10-18 23:03 -!- beantech(~trevor@203-114-166-118.dsl.sta.inspire.net.nz) has left #tryton

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!