Al 20/05/13 16:46, En/na Martin Pitt ha escrit:
> Olivier Tilloy [2013-05-17 14:54 -0000]:
>> The Ubuntu Touch QtCreator plugin exposes a "Translations" tool that has two 
>> options:
>>  1) Export ".pot" File
>>  2) Generate ".mo" File
>>
>> The first option invokes xgettext with the following arguments:
>>
>>     xgettext -o messages.pot --qt --c++ --add-comments=TRANSLATORS
>> --keyword=tr %PROJECTFILES%
> 
> Is this "translation tool" implemented in the build system, or is that
> separate logic in the GUI only?
> 

These are two menu entries in Qt Creator calling a script in the UI, so
a manual step pointing and clicking, disconnected from the build system.

> Is this invoked automatically anyway?

Not automatically, it's a manual step.

The challenge is that for simple SDK apps there is either no build
system or qmake, which can create Makefiles from *.pro snippets, but
it's a bit limited. An example is the Clock core app, where I ended up
using override_dh_install in debian/rules directly as per your guidance:

https://code.launchpad.net/~dpm/ubuntu-clock-app/translations-
packaging/+merge/162785

In Olivier's case, he is using CMake, which seems to be more flexible in
defining build targets/rules:

https://code.launchpad.net/~osomon/webbrowser-app/i18n/+merge/164276

> I. e. is the issue here that
> dh_translations overwrites an already correct .pot file with an
> incomplete one, and we just need to disable dh_translations for Ubuntu
> SDK packages?

There is actually no issue. The only thing is that we were writing our
own rules to generate the pot file, but most importantly to build and
install translations, and we were wondering if the best thing to do
would be to simply expand dh_translations to support SDK apps and use
the standard to do this.

> Or is the point of this bug to replace the GUI tool's
> export function with dh_translations?
> 

See the comment above. It's not as much as the export part, but rather
the build and install part, which the GUI cannot take care of when
installing an app.

> We can certainly call above xgettext command in dh_translations if we
> detect a project where this command is suitable. Do you have some
> guidance how to do this detection?
> 

I'm not sure about the best way of detecting this, but in general,
Ubuntu SDK projects:

- Import Ubuntu.Components
- Use the i18n.tr() calls for translations

>> The alternative, if I understand it correctly, would be to add a
>> "$domain.pot" target to the make rules (need to investigate how to do
>> that with cmake). Is that correct?
> 
> That would also work, yes. It depends a little bit how much you want
> these to work in a non-Debian(ish) environment, i. e. whether you have
> some notion of a non-packaged "upstream" release of these projects.
> 

I think it might make sense to define a standard set of targets for
translations in CMake anyway, in the way they are already defined for
autotools-based projects (the make $domain.pot is a good example).

Cheers,
David.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1181183

Title:
  Add support for the Ubuntu SDK apps to dh_translations

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pkgbinarymangler/+bug/1181183/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to