Re: TranslationMemory usage question
Vaclav Slavik <[email protected]>
| Newsgroups | gmane.editors.poedit.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I replied personally by mistake, so here's a summary of the thread in case it is useful for other users... Vaclav ---------- FWD ---------- Subject: Re: [poedit-users] TranslationMemory usage question Date: Mon, 5 Aug 2002 19:38:28 +0200 From: Vaclav Slavik <[email protected]> To: Arne Christian Hårseth <arnechaa-f/[email protected]> Hi, [sorry for late reply] Arne Christian Hårseth wrote: > The po files are generated from html-dictionary files we have made > as preparation for the translation.These files are more or less > complete with translation of words and simple phrases from english > to norwegian. Is this file what you will be translating or is it something else? > The pot files seems to be generated po files from > source files (don't know where the postfix 'pot' comes from). I think it stands for "PO template"... > I have tried to set up TM in poedit to generate a TM database from > the project database catalog. > I point the TM database setup to a newly generated catalog called > poeDB (I accidentily skipped the default DB catalog). What do you mean? Do you mean that you changed "Path to DB:" in File/Preferences/Translation Memory? What do you mean by saying that "poeDB" is a catalog? The entry in "Path to DB:" should be an (empty) directory, not a file ("catalog" = .po file). And it should be outside any project of yours because it is independent of the catalog you are translating, it can be used when translating any catalog. > I set 'nb' as my language. > I press "Generate database". > I am then asked for a search path and point this to the project > database catalog (as described above). Sorry, where exactly do you point it to? You must point it to a directory, not a catalog. Furthermore, it must be a directory that contains (lots of) .mo or .po file(s) and that conforms to certain directory structure (which helps to recognize the language), as per the manual: ------------ cut here ------------ If you decide to add your own directories to the search, it's important to understand how the lookup works. poEdit builds one database per language (choosen by you) and so it has to recognize catalog's language somehow. There's unfortunately no way of telling the language of PO or MO file, because gettext searches catalogs based on their name. This is what poEdit does, too. Make sure all catalogs you want to scan match one of these wildcards (this is just an example, substitute "cs" with any ISO 639 code, "CZ" with any country code, "po" with "po" or "mo", "foo" can be replaced with anything): cs.po */cs.po */cs/LC_MESSAGES/foo.po */cs/foo.po */cs_CZ.po */cs_CZ/LC_MESSAGES/foo.po */cs_CZ/foo.po ------------ cut here ------------ If you have access to an Unix machine, you will see that this structure matches /usr/share/locale directory tree. You can do this (I'll assume you use Windows, you can easily translate the instructions into their Unix equivalent if you don't): 1. Create a directory that will hold existing _translated_ catalogs (not neccessary translated by you), e.g. c:\tmdata 2. Create c:\tmdata\nb\LC_MESSAGES directory 3. Copy all *translated* .po and .mo files you can find into this directory (that is, *not* the catalog you are editing, but as many already translated catalogs as you can find -- any Linux installation is a good source of them). The more catalogs you copy in, the better TM will be. 4. Click on "Generate database" and add "c:\tmdata" as the only search path (if you are using Unix, you will definitely want to have /usr/share/locale and /usr/local/share/locale here as well). 5. Wait till poEdit finishes generating TM and then delete c:\tmdata. > When I open a *.pot file and right click a 'Original string' > string I expect to get some suggestions but only get an empty list. Because your TM is empty. > At least I expect to get some suggestions when I try to translate a > string which is almost identical to a string I have just > translated. Yes, that will work -- but you must save the catalog before the change is reflected in TM (this is because the translation is not considered correct unless you decide to save it). > The first time I right click a 'Original string' I am asked to > 'select catalog's language. Is this the original string language or > the destination language? Destination one -- original string language is always English in gettext (if it is not in the app, it is treated as if it were). You will not be asked again if you fill in the "Language" entry in Catalog/Settings. > What am I doing wrong? Not feeding the TM with data. Let me know if the instructions above don't help. (I hope it will ;) > I suppose I do not want to use the update catalog functionality > since I am not translating source code but pregenerated pot-files > and anyway prefere not to have the text automatically translated? Sorry? HTH, Vaclav ---------- FWD ---------- Subject: Re: [poedit-users] TranslationMemory usage question Date: Tue, 6 Aug 2002 23:54:13 +0200 From: Arne Christian Hårseth <arnechaa-f/[email protected]> To: "Vaclav Slavik" <[email protected]> Vaclav wrote: > [sorry for late reply] No problem, thank you for your extensive reply! >Arne Christian Hårseth wrote: >> The po files are generated from html-dictionary files we have made >> as preparation for the translation.These files are more or less >> complete with translation of words and simple phrases from english >> to norwegian. > >Is this file what you will be translating or is it something else? No, these are the translated files I want to have in translation memory. >> The pot files seems to be generated po files from >> source files (don't know where the postfix 'pot' comes from). > >I think it stands for "PO template"... Which is? Anyway these are the files I want to translate. >> I have tried to set up TM in poedit to generate a TM database from >> the project database catalog. >> I point the TM database setup to a newly generated catalog called >> poeDB (I accidentily skipped the default DB catalog). > >What do you mean? Do you mean that you changed "Path to DB:" in >File/Preferences/Translation Memory? What do you mean by saying that >"poeDB" is a catalog? The entry in "Path to DB:" should be an > (empty) directory, not a file ("catalog" = .po file). And it should > be outside any project of yours because it is independent of the > catalog you are translating, it can be used when translating any > catalog. Sorry for the terminology confusion. Without thinking I wrote 'catalog' when I meant 'directory' (I use these two terms as though they vere synonyms in my everyday language). >> I set 'nb' as my language. >> I press "Generate database". >> I am then asked for a search path and point this to the project >> database catalog (as described above). > >Sorry, where exactly do you point it to? You must point it to a >directory, not a catalog. Furthermore, it must be a directory that >contains (lots of) .mo or .po file(s) and that conforms to certain >directory structure (which helps to recognize the language), as per >the manual: >------------ cut here ------------ > ... >1. Create a directory that will hold existing _translated_ catalogs >(not neccessary translated by you), e.g. c:\tmdata >2. Create c:\tmdata\nb\LC_MESSAGES directory >3. Copy all *translated* .po and .mo files you can find into this >directory (that is, *not* the catalog you are editing, but as many >already translated catalogs as you can find -- any Linux > installation is a good source of them). The more catalogs you copy > in, the better TM will be. >4. Click on "Generate database" and add "c:\tmdata" as the only > search path (if you are using Unix, you will definitely want to > have /usr/share/locale and /usr/local/share/locale here as well). > 5. Wait till poEdit finishes generating TM and then delete > c:\tmdata. I have made this tmdata\nb\LC_MESSAGES directory and this time when generating the TM database I see the progress bar and get resulting db-files with sensible size. When I open a .pot file I want to translate, right click an original string with a word which I know is in the TM database (or should be since it was in the translated *.pot files I used to generate the TM databse) I get no suggestions. > ... > >> At least I expect to get some suggestions when I try to translate >> a string which is almost identical to a string I have just >> translated. > >Yes, that will work -- but you must save the catalog before the > change is reflected in TM (this is because the translation is not > considered correct unless you decide to save it). What is a catalog in this context? The file I am working on translating (a catalog file) or a catalog manager catalog (directory of catalog files)? I have saved the .pot file (the file I am translating) but still get no suggestions for a simalar origin string? >> What am I doing wrong? > >Not feeding the TM with data. Let me know if the instructions above >don't help. (I hope it will ;) Partly, yes thank you but still no suggestions. >> I suppose I do not want to use the update catalog functionality >> since I am not translating source code but pregenerated pot-files >> and anyway prefere not to have the text automatically translated? > > Sorry? Here I am talking about the Catalog Manager Catalog Update functionality which in the help documentation is described as something you may not want to use and which I think I do not want to use (if I have understood the conequenses correctly). One last question: In the catalog manager and when using Open File *.pot files do not show up. Is this a problem? It is at least anoying since I can not open a pot file in catalog manager. Arne ---------- FWD ---------- Subject: Re: [poedit-users] TranslationMemory usage question Date: Thu, 8 Aug 2002 12:56:09 +0200 From: Arne Christian Hårseth <arnechaa-f/[email protected]> To: "Vaclav Slavik" <[email protected]> > ... working on translation of pot files... > You don't, see above. You want to copy it to nb.po and edit that. Which mean I can only work on one *.pot nb.po copy at the time? >(you'll certainly agree >with me that TM that suggests word-by-word translation would perform >poorly). Yes, but it would still be usefull to be presented with a list of word by word translations so that I don't have to look up manually the words I don't remember the translation of. Even if I do remember a working translation we have made a list of "recomended" translation and it would be usefull to be reminded of what the recomended translation of that word. >> I have saved the .pot file (the file I am translating) but still >> get no suggestions for a simalar origin string? > >Weird. Is it the same if you save the file as "nb.po" and "nb" is >filled in as the language in Catalog/Settings? I think the former >doesn't matter, but the latter does: TM won't be updated if poEdit >doesn't know catalog's language. I have now saved one .pot file as nb.po, deleted the sentence I translated an inserted it again and saved the file. I still see no suggestions. "Norwegian bokmål" (which is the long term for 'nb') is now set as language in Catalog/Settings. The sentence I tranlated was: "Activate this check box if you want to rotate the dimensions by 180 degrees" which I translated to: "Aktiver denne sjekkboksen hvis du ønsker å rotere dimensjonene 180 grader" I then right click on the origin string: "Activate this check box if you want the drawing elements arranged on the background to be displayed in the workplace." These string have the same beginning so TM could have suggested something like: "Aktiver denne sjekkboksen hvis du ønsker ..." Or are these two strings still to fra appart? >If TM still doesn't work, how big are your "tmdata" directory and > the .pot file you are going to translate? If they can be packed > into a reasonably-sized ZIP archive, I can have a look at it myself > (if you could send the ZIP to me as an attachment -- privately, so > that we don't bother other poedit-users members -- or, preferably, > upload it somewhere on the web). I think the files can be retrieved anonymously from the CVS repository at cvs.skolelinux.no. So you could set up a CVSROOT something like: :pserver:anoncvs-HUwm/[email protected]:/var/lib/cvs and then checkout "skolelinux/i18n/other/nb/openoffice". Arne ---------- FWD ---------- Subject: Re: [poedit-users] TranslationMemory usage question Date: Thu, 8 Aug 2002 20:43:42 +0200 From: Vaclav Slavik <[email protected]> To: Arne Christian Hårseth <arnechaa-f/[email protected]> Hi, Arne Christian Hårseth wrote: > > ... working on translation of pot files... > > You don't, see above. You want to copy it to nb.po and edit that. > > Which mean I can only work on one *.pot nb.po copy at the time? Sorry? > >(you'll certainly agree > >with me that TM that suggests word-by-word translation would > > perform poorly). > > Yes, but it would still be usefull to be presented with a list of > word by word translations so that I don't have to look up manually > the words I don't remember the translation of. I see. But how to do it from user interface point of view? > "Activate this check box if you want to rotate the dimensions by > 180 degrees" > > which I translated to: > > "Aktiver denne sjekkboksen hvis du ønsker å rotere dimensjonene 180 > grader" > > I then right click on the origin string: > > "Activate this check box if you want the drawing elements arranged > on the background to be displayed in the workplace." > > These string have the same beginning so TM could have suggested > something like: > > "Aktiver denne sjekkboksen hvis du ønsker ..." > > Or are these two strings still to fra appart? They are *very* far apart, the difference is "the drawing elements arranged on the background to be displayed in the workplace." poEdit currently cannot recognize common prefixes, although it would be a useful feature it seems. Please see "File/Preferences/Translation Memory" dialog, there are two options that fine-tune TM's lookup algorithm (the numbers in "Configuration" box). Try what will poEdit offer for e.g. "Activate this check box if you want to rotate the picture by 90 degrees" > I think the files can be retrieved anonymously from the CVS > repository at > > cvs.skolelinux.no. So you could set up a CVSROOT something like: > :pserver:anoncvs-HUwm/[email protected]:/var/lib/cvs and then checkout > > "skolelinux/i18n/other/nb/openoffice". I'll try. Vaclav From [email protected] Fri Aug 9 23:35:26 2002