Bug 959834 - [zanata.xml] Project-type for gettext should be gettext, not podir
Summary: [zanata.xml] Project-type for gettext should be gettext, not podir
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Logic
Version: 2.3
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.1
Assignee: David Mason
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-06 05:06 UTC by Ding-Yi Chen
Modified: 2013-11-27 03:36 UTC (History)
2 users (show)

Fixed In Version: 3.1-SNAPSHOT (20130923-0037)
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-27 03:23:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Ding-Yi Chen 2013-05-06 05:06:21 UTC
Description of problem:
The project-type of server-genertate zanata.xml for gettext projects have been change to podir to permit multiple pot file upload.

This setting, however, will break the build script of gettext projects, because the directory structures are different.


Version-Release number of selected component (if applicable):
Zanata version 2.3.0 (20130426-0119)

How reproducible:
Always

Steps to Reproduce:
1. Create a version with project-type "Gettext"
2. Click "Config", an zanata.xml is generated.
3. Open the generated zanata.xml.
  
Actual results:
zanata.xml contains:
  <!-- NB project-type set to 'podir' to allow uploads, but original was 'gettext' -->
  <project-type>podir</project-type>


Expected results:
zanata.xml contains:
  <project-type>gettext</project-type>


Additional info:

Comment 1 David Mason 2013-07-02 06:31:42 UTC
Note: the substitution of 'podir' in the place of 'gettext' is expected from the Documents (locale) page when clicking 'Offline Translation Config File', but the substitution appears to be incorrectly happening from the main version page.

Comment 2 Ding-Yi Chen 2013-07-03 00:18:08 UTC
I am not sure it is a good idea to change the project-type. Consider following use case:

A project maintainer working on a gettext project, he speaks both English and Mandarin (zh-CN) and translate the zh-CN himself.

1. He go to the locale zh-CN and start translating.
2. He need to catch a bus 15 minutes later so he need offline translation
3. He download the offline zanata.xml on zh-CN page, and do some translation on the bus.
*4. He build the project and put the file he translated to the source tree, he found that he need to change filename to make the change apply.
5. On next day, he back to office and push he translation.
*6. Thinking zanata.xml is already in the local hard disk, he pull the translation from server and found that he need to rename dozens of translation files to apply the translations.

Step 4 and 6 are more likely to cause confusion.

If you do need to change project-type, please make the filename different (e.g. zanata-offline.xml), as they do contain different content.

Moreover, if both zanata.xml and zanata-download.xml exist, client need to "ask" user whether he need to submit as a translator or a project maintainer.

Comment 3 Ding-Yi Chen 2013-09-17 02:40:53 UTC
I think this bug will annoy the new project maintainers.

This bug is under radar for quite some time, as veteran project maintainers usually copy working zanata.xml around.

However, new project maintainers don't have the existing working zanata.xml to copy from, thus they cannot push or pull their project properly.

Comment 4 David Mason 2013-09-17 03:32:48 UTC
I am not convinced that it is a bug when a user downloads an offline translation config then tries to use it for something other than offline translation.

Assuming we want to support offline translation as we do now, perhaps we could look at using a different name for an offline translation config file so that users will be less likely to get confused - this would require having the client look for the extra config file as a fallback if zanata.xml is not found, or perhaps a different client that uses the different config and is limited to the functionality that is needed for offline translation.

I think the best option long-term is to change how offline translation is supported, ideally by providing a tool that can automatically deal with the pulling and pushing of files without user intervention.

Comment 5 Ding-Yi Chen 2013-09-17 04:37:26 UTC
There are translators and project maintainers.

Translators don't need to care the exact file names for push and pull, as long as they have something to work with.

Project maintainers however, requires those translation files to in certain path and filename need to be in certain format.

For example, when push freeciv translation to Zanata, a project maintainer expect that all .po  files in po/, i.e. de.po, en_GB.po and zh_CN.po are pushed without any problem.

He/she also expects that after translation are pulled, all the .po files are download to po/ so he/she can build it without any further step. zanata.xml download from zanata server cannot let he/she do this.

Comment 6 David Mason 2013-09-17 05:13:48 UTC
Ah, I did not read the bug carefully enough. I agree, the config file downloaded from the version page should not have the project type changed. This must be a legacy from before offlinepo project type was added.

Comment 7 David Mason 2013-09-20 06:11:26 UTC
Fixed in 3.1-SNAPSHOT

See: https://github.com/zanata/zanata-server/commit/14d8093e6125e5820370bdd0b4766426f911b1c1

Expected behaviour for config download is now:

Project type:

 - config from version page always has project type of version if it is set.
 - config from version page for version that does not have a project type will have a commented-out project type element showing all the project type options.
 - config from documents page for a locale may have a rewritten project type:-
   - version with 'podir' will use project type 'podir'.
   - version with 'gettext' will use project type 'podir' and have a comment indicating the original project type.
   - version with anything other than 'podir' or 'gettext' will use project type 'offlinepo' and will have a comment indicating the original project type.

Locales:

 - config from version page always has all enabled locales for that version
 - config from documents page for a locale always has only the locale of the page from which it is downloaded.

Config files within downloaded zip files (from locale documents page) will have the same contents as a separate config file downloaded from the same page.

Comment 8 Ding-Yi Chen 2013-09-23 01:00:15 UTC
VERIFIED with Zanata version 3.1-SNAPSHOT (20130923-0037)

Comment 9 Sean Flanigan 2013-11-27 03:13:50 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 10 Sean Flanigan 2013-11-27 03:15:45 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 11 Sean Flanigan 2013-11-27 03:19:22 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 12 Sean Flanigan 2013-11-27 03:23:41 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 13 Sean Flanigan 2013-11-27 03:34:06 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 14 Sean Flanigan 2013-11-27 03:36:17 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.


Note You need to log in before you can comment on or make changes to this bug.