YouTube labels and categories are not localized

Bug #1359153 reported by Víctor R. Ruiz on 2014-08-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Rest Scopes
Undecided
Unassigned
Ubuntu Translations
High
Unassigned
unity-scope-youtube (Ubuntu)
Medium
James Henstridge
unity8 (Ubuntu)
Undecided
Unassigned

Bug Description

YouTube scope shows untranslated categories and labels.

Test case.
- Switch Ubuntu Phone to Spanish, reboot.
- Go to YouTube scope.

Expected result.
- Labels and categories must be displayed in Spanish.

Actual result.
- "Best of YouTube" and its categories are displayed in English.
- "Sports", "Gaming", number of "views" and other labels are displayed also in English.

Adolfo Jayme (fitojb) on 2014-09-14
Changed in ubuntu-translations:
status: New → Triaged
importance: Undecided → High
Facundo Batista (facundo) wrote :

Hi! YouTube is not a remote scope.

Changed in ubuntu-rest-scopes:
status: New → Invalid
Albert Astals Cid (aacid) wrote :

Nothing to do with unity8, I don't even think it's a unity-scope-youtube bug, simply there are no translations to Spanish in https://translations.launchpad.net/unity-scope-youtube

no longer affects: unity8
Changed in unity8 (Ubuntu):
status: New → Invalid
Albert Astals Cid (aacid) wrote :

Actually there may be a bug in unity-scope-youtube since for example "Popular on YouTube" does not appear for translation in https://translations.launchpad.net/unity-scope-youtube

David Planella (dpm) wrote :

So there seem to be 2 issues here:

- Missing translatable strings: might be either because they're not marked for translation in the code, or because the .pot file is not up-to-date
- Translations not committed: (and perhaps not shipped). Someone with permissions needs to:
  1. Go to https://translations.launchpad.net/unity-scope-youtube/14.10/+link-translations-branch
  2. Set the value to ~unity-api-team/unity-scope-youtube/14.10

David Planella (dpm) on 2014-09-30
Changed in unity-scope-youtube (Ubuntu):
status: New → Triaged
importance: Undecided → High
Thomas Strehl (strehl-t) on 2014-09-30
tags: added: touch-2014-10-16
Changed in unity-scope-youtube (Ubuntu):
assignee: nobody → James Henstridge (jamesh)
tags: added: touch-2014-10-30
removed: touch-2014-10-16
James Henstridge (jamesh) wrote :

Note that these strings don't appear in the PO template because they don't actually exist in the source code: they are provided by the YouTube API.

So the bug is either (a) we aren't correctly passing locale information to the YouTube API, or (b) YouTube is not providing localised names for these general channels. Hopefully it is (a), because that's something we could actually fix.

I'll add more info as I dig in further.

James Henstridge (jamesh) wrote :

So I've dug a bit further into this problem. I've confirmed that the untranslated strings are coming from the API rather than embedded in the scope, so it isn't a simple matter of adding some gettext() calls and rerunning "make pot".

The department list is determined by a call to the youtube.guideCategories.list endpoint:

https://developers.google.com/youtube/v3/docs/guideCategories/list

This endpoint takes hl (human language) and regionCode parameters that the scope is filling in from the locale and location data respectively. I notice that even when I use hl=es_ES, some of the guide categories are returned in English (including "Best of YouTube").

The category list for the surfacing page of each department (including the top level "Best of YouTube" one) are formed by a call to the youtube.channels.list endpoint:

https://developers.google.com/youtube/v3/docs/channels/list

The id from the guideCategories output is passed as the categoryId parameter to this API. There doesn't seem to be any parameters to set language or region here, so the results all seem to come back in English.

Also, it looks like the guide returns identical category IDs for all languages, so it can't use that to determine the language to show for results.

I'll do a bit more poking around, but I don't see an obvious documented way to pass in the desired language here.

James Henstridge (jamesh) wrote :

I'm not having much luck after playing around with the API. The channels list operation ignores the "hl" parameter if you pass it in. The "Accept-Language" HTTP request header doesn't alter the response either.

Localized category lists:
https://developers.google.com/youtube/2.0/reference#Localized_Category_Lists

«You can also retrieve localized category lists that specify category
labels for classifying video content in particular languages. You can
download these lists from
http://gdata.youtube.com/schemas/2007/categories.cat?hl=<LANGUAGE>,
where you replace the term LANGUAGE in the URL with the appropriate
language value from the following list»

Example: http://gdata.youtube.com/schemas/2007/categories.cat?hl=es-ES

James Henstridge (jamesh) wrote :

Note that that is for the deprecated 2.0 API, which we aren't using. The equivalent v3 API would be either the guideCategories.list API we are using, or possibly videoCategories.list: both of which support localisation as I described above (and clearly visible in the departments list of the scope).

The problem occurs when we've picked one of these categories and want to display the content held within that category: I don't see how to request localised results from that API.

James Henstridge (jamesh) wrote :

The YouTube developers site points at StackOverflow for its "Ask a Question" link, so I've done that here: http://stackoverflow.com/q/26133830/721283

I also found a low quality bug report from about a year ago that seems to be describing the same issue: https://code.google.com/p/gdata-issues/issues/detail?id=4932

James Henstridge (jamesh) wrote :

Here's the response I got from the StackOverflow question from a member of Google's Developer Relations team:

"""
Internationalization in the Data API v3 is something YT started supporting recently, and it's limited now. But there is a work going on to bring this support to the all functionalities in the API really soon.
"""

So it isn't clear how we can progress on this until something changes in the API. I'm lowering the importance to take this into account. Please change it again if you disagree.

Changed in unity-scope-youtube (Ubuntu):
importance: High → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.