Bug 831887 - RFE: List available Translation Locales via REST API
RFE: List available Translation Locales via REST API
Status: CLOSED NEXTRELEASE
Product: Zanata
Classification: Community
Component: Component-Logic (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Isaac Rooskov
Zanata-QA Mailling List
:
: 956916 (view as bug list)
Depends On:
Blocks: 759983
  Show dependency treegraph
 
Reported: 2012-06-13 22:26 EDT by Lee Newson
Modified: 2015-08-06 01:54 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-23 20:51:57 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 2 Ding-Yi Chen 2012-10-29 00:39:17 EDT
Hi Lee,

Since all document in same project-verision share the same locale setting, is it sufficient to get the supported locales at version level instead of individual document level?
Comment 3 Ding-Yi Chen 2012-10-29 00:46:25 EDT
Bug 848988 is quite close to the needed functionality, however, using the statistics to get the supported locales is quite consuming, thus we still need the lighter-weight method to achieve this.

I would also like to extend the scope of this bug to following levels:

1) Version level
2) Project level
3) Server level (i.e. Similar to what we get from language list).
Comment 4 Lee Newson 2012-10-29 20:29:16 EDT
Hey Ding-Yi,

I talked it over with Matt and that would work fine, plus the added benefit of less calls. Also with the change Sean mentioned in comment #1 about no longer returning 404 for Translated Documents that haven't had translations done, that does seem like the better option.
Comment 5 Lee Newson 2012-10-29 20:30:20 EDT
I also made the first two comments private since the links were internal.
Comment 6 Isaac Rooskov 2013-02-18 20:49:53 EST
Add support through stats or REST service
Comment 7 Ding-Yi Chen 2013-06-27 03:41:02 EDT
*** Bug 956916 has been marked as a duplicate of this bug. ***
Comment 9 Ding-Yi Chen 2013-06-27 23:40:31 EDT
Original description is private, which cannot be view by outside stakeholder.
Thus, I repost it here with sensitive data removed.

Currently via the REST API there is no way to find what translations exist for a Source Document. As such you need to send a request for each translation to see if it exists. eg.

http://<zanataServer>/rest/projects/p/<proj>/iterations/i/<ver>/r/4767-48873/translations/pt-BR

Sean mentioned he believed the ITranslationResources.getResource() function would do this but it only makes a call to the URL above. So if you don't know what translations exist for each document then you are just sending requests that are going to return a 404 response or a 403 response if the locale isn't setup. eg.

404 response:
http://<zanataServer>/rest/projects/p/<proj>/iterations/i/<ver>/r/8816-134374/translations/pt-BR

403 response:
http://<zanataServer>/rest/projects/p/<proj>/iterations/i/<ver>/r/8816-134374/translations/ar

Currently using the ITranslationResources service and the Source Document all you can do is get the Translation Strings for that Document. eg.

http://<zanataServer>/rest/projects/p/<proj>/iterations/i/<ver>/r/8816-134374/

As such it would be handy and something that would save a number of requests, is if you could do a rest query to find out information about each Source Document or Translated Document. eg. What translations exist for the document, when it was last modified, etc..

An example query to list the available translations maybe something like:

http://<zanataServer>/rest/projects/p/<proj>/iterations/i/<ver>/r/8816-134374/translations
Comment 10 Michelle Kim 2015-02-23 20:51:57 EST
I believe this feature is implemented in the bug 1156236

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