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

chat.freenode.net #tryton log beginning Fri Oct 18 00:00:02 CEST 2013
WUDHi, I need help with the model singleton class12:09
WUDHi12:52
WUDI need some help with Singletons12:52
lidshello16:39
lidsis there a way to extract strings from code and make them translatable, like gettext does ?16:40
cedklids: https://code.google.com/p/tryton/wiki/HowtoTranslate16:42
Piloulids: cls._error_messages could be used: http://hg.tryton.org/2.8/modules/calendar_scheduling/file/10f880edc13a/calendar_.py#l4016:46
lidscedk: i can't find a hint about inline strings translation there16:48
lidsPilou: well, i would prefer having the strings extracted and not call them error_messages..16:49
lidsextracted automatically*16:50
lidscedk: i assume the feature is not in tryton. don't you think it would be useful ?16:54
cedklids: not like that16:58
cedklids: we just need a generalisation of error message16:58
lidscedk: how would it work?17:00
cedklids: create record in XML and retrive them by id17:02
lidscedk: 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 ?17:08
lidsstrings*17:08
lidsjust a new type maybe..17:12
cedklids: just rename error into message for example17:12
cedklids: and stop define them on Model but in XML17:12
cedklids: and refactoring raise_error17:13
lidscedk: what's the rational not to use gettext instead of storing the string in xml files ?17:15
lidsor just extracting them17:18
cedklids: we have a DB17:24
lidscedk: that's ok, they could be extracted from the modules and stored in the db like other strings17:25
lidsi think gettext can do that easily, that's why i'm referencing to it17:26
cedklids: it will mean link to something and from experience sharing them will improve it17:27
cedklids: also with xml id, we are sure about the message used instead of string matching17:27
cedklids: indeed I don't know what you are talking about when using "gettext"17:27
lidscedk: 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 db17:30
cedklids: no, code is not parsed17:31
lidscedk: we don't need gettext to do that, but it's the library the most used to do such things17:31
lidscedk: s/parsed/loaded into python/17:32
cedklids: still I don't know which gettext you are talking about17:33
cedklids: if you mean the gnu-gettext, it is more DB than anything else17:34
lidscedk: moreover, there is in fact more chance to forget a deprecated string in xml than wen they are extracted17:34
lidscedk: yes i'm talking about gnu-gettext, i'm not saying we need to use it, i'm saying it has features that great :)17:35
lidsare+17:36
cedklids: for me it leads to bad message translation17:40
lidscedk: in what way ?17:42
cedklids: it is base on string matching17:42
lidscedk: that's what the fuzzy flag is there for17:44
cedklids: no it is not his purpose17:45
lidscedk: i don't understand the problem of string matching then.. most free software have pretty good translations with gettext17:47
cedklids: same string in english could translated differently in other language17:47
cedklids: ex: "Invoice", it could be the object or the verb17:47
cedkgettext is just a DB with string matching, Tryton has a DB and string matching is not good enough for your usage17:48
lidscedk: ah, the filename and line number of the string is used to differentiate different instances of the same string17:49
cedklids: if so, how does it work when line change of position ?17:49
lidscedk: fuzzy becomes true iirc17:49
lidscedk: it must be a bit more clevver than that, because line numbers change often17:50
cedklids: any way, we don't need such DB17:51
cedklids: come with a good argument17:51
cedklids: and more over gnu-gettext is not thread safe17:51
lidscedk: sure the db is already there.. i'm talking about extracting the strings17:51
lids17: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 :)17:52
cedklids: so it is not gettext !17:52
cedklids: and I say it is not because string matcing17:52
lidscedk: http://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html17:58
lidscedk: i'm talking about such a feature17:58
cedklids: thanks, I know this17:59
lidscedk: it's just not just string matching as i explained above17:59
cedklids: no the tools is about string extracting17:59
lidscedk: this one in particular yes, another command handle the string update..18:01
lidswell.. whatever..18:02
-!- vcardon(~vcardon@LNeuilly-152-23-15-185.w193-252.abo.wanadoo.fr) has left #tryton18:59
-!- katr(~m@80-123-52-145.adsl.highway.telekom.at) has left #tryton20:36
-!- beantech(~trevor@203-114-166-118.dsl.sta.inspire.net.nz) has left #tryton23:03

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!