Re: [poedit-users] keep obsolete strings when updating from pot file
Claudia Kosny <[email protected]>
| Newsgroups | gmane.editors.poedit.user |
|---|---|
| Message-ID | <[email protected]> |
> Vaclav Slavik wrote:
> Once again: how _exactly_ did you do the merge?
I opened the po file in poedit and then use the menu Catalog>Update from
POT file to load the new pot file with some new words.
The original po file contains some words that are not in the new pot
file. These words are listed in the update summary box that lists the
new and obsolete words. If I click on ok, the obsolete words disappear
from the po file.
>> Closely related to this - as the obsolete strings are commented out
>> they are not part of the mo file that is created by poedit. Is
>> there a way to make these strings 'unobsolete' (apart from editing
>> the text file directly) so that they are included in the mo file?
>
> I think you misunderstand the way gettext works -- if a string is not
> present in .pot file, it means it's not used by the program you're
> translating at all and so it *makes absolutely no sense* to include
> obsolete strings in the .mo file, they would never be used for
> anything.
The 'obsolete' strings are strings that I added manually earlier as they
are translations of variables and thus cannot be found automatically.
Example: my database stores the gender as 0 for male and 1 for female.
In my php code I use something like
_('gender_' . $result['gender'])
where $result['gender'] is either 0 or 1.
In the po file I have the proper translations for gender_0 or gender_1.
I have a base po file that contains the translations for such strings.
Then I create a pot file out of the translatable strings that can be
found by scanning the php code and merge the two.
So for me it makes sense to have these 'obsolete' strings in the merged
file (and the resulting mo file) even if they are obsolete from a
gettext point of view.
I have not used gettext or poedit much so I don't know whether there is
a better way to achieve this (maybe using multiple catalogues?). If
there is one I would appreciate either some tips or link with more
information.
> But if you insist, you can easily uncomment them using any half-decent
> text editor.
Yes, that is the way I am doing this right now. I just wanted to make
sure that I didn't miss something.
Thanks for your help
Claudia
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/