Translation script challenges
I think this is mainly of interest to KATO-san, Akihiro-san, Alex, and infra folks but wanted to send it here to have it recorded. This is about the scripting we use in project-config to push content to zanata. I just did two changes to fix problems I noticed with release notes translation and with python projects that use more than one module (keystone): https://review.openstack.org/303727 https://review.openstack.org/303722 But now I see have another problem: Since keystone went from one to two modules, the srcdir setting changed and thus it's not anymore keystone but keystone/locale/keystone as resource name. Compare: https://translate.openstack.org/iteration/view/keystone/master/documents https://translate.openstack.org/iteration/view/keystone/stable-mitaka/docume... The rename deleted the old content and created new files ;( We can fix this with downloading the translation of mitaka files and pushing them to master. But this will hit us every time a project moves from one to multiple modules. Now, checking releasenotes push for python projects: It still does not work due to the ../.. zanata-cli does not see files outside of the srcdir. For reference: We need to push nova/locale/nova.pot and releasenotes/locale/releasenotes.pot zanata.xml contains: <rules> <rule pattern="**/*.pot">{locale_with_underscore}/LC_MESSAGES/{filename}.po</rule> <rule pattern="../../releasenotes/source/locale/releasenotes.pot">../../releasenotes/source/locale/{locale_with_underscore}/LC_MESSAGES/releasenotes.po</rule> </rules> So, I'm proposing to set sourcedir and transdir *everywhere* to "." instead of "$module/locale" - like done for multiple modules: <rules> <rule pattern="**/*.pot">{path}/{locale_with_underscore}/LC_MESSAGES/{filename}.po</rule> <rule pattern="releasenotes/source/locale/releasenotes.pot">releasenotes/source/locale/{locale_with_underscore}/LC_MESSAGES/releasenotes.po</rule> </rules> Does anybody have a better idea on how to fix these two problems? Or a better way to write the rules above for this? Alex, is there a way to not lose the content when this change is done since it will rename the translation files? Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Thanks for raising this. Although I don't have enough time to dig into problems as I said before in the list, I would like to comment some. For zanata.xml srcdir, I believe it was a mistake to use <modulename>/locale instead of a top directory of each repository. My vote is to change "srcdir" to ".". It allows us to handle POT file in any place. Hopefully Zanata allows us to rename the path of resources so that we don't lose our history when renaming resources. Akihiro 2016-04-10 3:38 GMT+09:00 Andreas Jaeger <aj@suse.com>:
I think this is mainly of interest to KATO-san, Akihiro-san, Alex, and infra folks but wanted to send it here to have it recorded. This is about the scripting we use in project-config to push content to zanata.
I just did two changes to fix problems I noticed with release notes translation and with python projects that use more than one module (keystone):
https://review.openstack.org/303727 https://review.openstack.org/303722
But now I see have another problem:
Since keystone went from one to two modules, the srcdir setting changed and thus it's not anymore keystone but keystone/locale/keystone as resource name.
Compare: https://translate.openstack.org/iteration/view/keystone/master/documents https://translate.openstack.org/iteration/view/keystone/stable-mitaka/docume...
The rename deleted the old content and created new files ;( We can fix this with downloading the translation of mitaka files and pushing them to master. But this will hit us every time a project moves from one to multiple modules.
Now, checking releasenotes push for python projects: It still does not work due to the ../.. zanata-cli does not see files outside of the srcdir.
For reference: We need to push nova/locale/nova.pot and releasenotes/locale/releasenotes.pot
zanata.xml contains: <rules> <rule pattern="**/*.pot">{locale_with_underscore}/LC_MESSAGES/{filename}.po</rule> <rule pattern="../../releasenotes/source/locale/releasenotes.pot">../../releasenotes/source/locale/{locale_with_underscore}/LC_MESSAGES/releasenotes.po</rule> </rules>
So, I'm proposing to set sourcedir and transdir *everywhere* to "." instead of "$module/locale" - like done for multiple modules:
<rules> <rule pattern="**/*.pot">{path}/{locale_with_underscore}/LC_MESSAGES/{filename}.po</rule> <rule pattern="releasenotes/source/locale/releasenotes.pot">releasenotes/source/locale/{locale_with_underscore}/LC_MESSAGES/releasenotes.po</rule> </rules>
Does anybody have a better idea on how to fix these two problems? Or a better way to write the rules above for this?
Alex, is there a way to not lose the content when this change is done since it will rename the translation files?
Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
_______________________________________________ OpenStack-I18n mailing list OpenStack-I18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
Does anybody have a better idea on how to fix these two problems? Or a better way to write the rules above for this?
zanata-cli does not look outside of srcdir. So the solution would be target whichever directory that is in higher structure. I think your solution is the best approach so far to solve this issue.
Alex, is there a way to not lose the content when this change is done since it will rename the translation files?
The renaming of files will definitely lose their translation content (Zanata will mark the document obsolete). If renaming of files happens, then we will need to do zanata:pull, rename all files and zanata:push as you suggested. This process shouldn't be a problem if there's constant syncing of translation files (as backup) and we can always attached the last pulled translation files.
From Zanata point of view, there is actually a feature to copy translations however I don't recommend to use it unless you're really sure.
http://docs.zanata.org/en/release/user-guide/translation-reuse/copy-trans/ --------------------------------------------- Alex Eng Senior Software Engineer Globalisation Tools Engineering DID: +61 3514 8262 <callto:+61+3514+8262> Mobile: +614 2335 3457 <callto:+614+2335+3457> Red Hat, Asia-Pacific Pty Ltd Level 1, 193 North Quay Brisbane 4000 Office: +61 7 3514 8100 <callto:+61+7+3514+8100> Fax: +61 7 3514 8199 <callto:+61+7+3514+8199> Website: www.redhat.com
On 04/11/2016 02:31 AM, Alex Eng wrote:
Does anybody have a better idea on how to fix these two problems? Or a better way to write the rules above for this?
zanata-cli does not look outside of srcdir. So the solution would be target whichever directory that is in higher structure. I think your solution is the best approach so far to solve this issue.
Alex, is there a way to not lose the content when this change is done since it will rename the translation files?
The renaming of files will definitely lose their translation content (Zanata will mark the document obsolete). If renaming of files happens, then we will need to do zanata:pull, rename all files and zanata:push as you suggested.
And this will loose statistics, won't it? In that case we should take statistics before the big rename - and then afterwards start from zero for these. Or do you have a better proposal? Andreas
This process shouldn't be a problem if there's constant syncing of translation files (as backup) and we can always attached the last pulled translation files.
From Zanata point of view, there is actually a feature to copy translations however I don't recommend to use it unless you're really sure.
http://docs.zanata.org/en/release/user-guide/translation-reuse/copy-trans/
-- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
And this will loose statistics, won't it? In that case we should take statistics before the big rename - and then afterwards start from zero for these. Or do you have a better proposal?
Not really. User statistics remains even in obsolete documents. It will only be affected if the version or the project is being deleted. --------------------------------------------- Alex Eng Senior Software Engineer Globalisation Tools Engineering DID: +61 3514 8262 <callto:+61+3514+8262> Mobile: +614 2335 3457 <callto:+614+2335+3457> Red Hat, Asia-Pacific Pty Ltd Level 1, 193 North Quay Brisbane 4000 Office: +61 7 3514 8100 <callto:+61+7+3514+8100> Fax: +61 7 3514 8199 <callto:+61+7+3514+8199> Website: www.redhat.com On Mon, Apr 11, 2016 at 3:55 PM, Andreas Jaeger <aj@suse.com> wrote:
On 04/11/2016 02:31 AM, Alex Eng wrote:
Does anybody have a better idea on how to fix these two problems? Or
a
better way to write the rules above for this?
zanata-cli does not look outside of srcdir. So the solution would be target whichever directory that is in higher structure. I think your solution is the best approach so far to solve this issue.
Alex, is there a way to not lose the content when this change is done since it will rename the translation files?
The renaming of files will definitely lose their translation content (Zanata will mark the document obsolete). If renaming of files happens, then we will need to do zanata:pull, rename all files and zanata:push as you suggested.
And this will loose statistics, won't it? In that case we should take statistics before the big rename - and then afterwards start from zero for these. Or do you have a better proposal?
Andreas
This process shouldn't be a problem if there's constant syncing of translation files (as backup) and we can always attached the last pulled translation files.
From Zanata point of view, there is actually a feature to copy translations however I don't recommend to use it unless you're really sure.
http://docs.zanata.org/en/release/user-guide/translation-reuse/copy-trans/
-- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
On 2016-04-11 23:39, Alex Eng wrote:
And this will loose statistics, won't it? In that case we should take statistics before the big rename - and then afterwards start from zero for these. Or do you have a better proposal?
Not really. User statistics remains even in obsolete documents. It will only be affected if the version or the project is being deleted.
Thanks, then let's do the change, Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
participants (3)
-
Akihiro Motoki
-
Alex Eng
-
Andreas Jaeger