The problem for the store here (using the Camera example) is that no translations have been added to the metadata. The phone will send an `Accept-Language` header with the request to indicate the language in use on the device, and we will search using the terms entered by the user against that language and the default, untranslated metadata, scoring packages that match the translated fields more highly.
The solution that will work today is for the uploader to add the translations. A possible future improvement would be to try to extract the translations from, say, a `.desktop` file in the package, but that's problematic for various reasons:
* What about packages that only ship scopes (no `.desktop` file)?
* What about packages that ship several apps (several `.desktop` files)?
* What about snap packages that are targeting IoT/Ubuntu Core (zero or more `.desktop` files, but not referenced in the manifest)?
The problem for the store here (using the Camera example) is that no translations have been added to the metadata. The phone will send an `Accept-Language` header with the request to indicate the language in use on the device, and we will search using the terms entered by the user against that language and the default, untranslated metadata, scoring packages that match the translated fields more highly.
As an example:
``` /search. apps.ubuntu. com/api/ v1/search? q=otp%20transit &fields= title,descripti on,keywords, translations' | jq . :package" : [
"description" : "Calculate your public transport itineraries in Île de France using Mobile OTP Transit Planner for Paris!\nCalculate your trips in public transport using Mobile OTP Transit Planner for Paris, the mobile webapp version of http:// plannerparis. acolytesanonyme s.org.\r\n\r\nThis webapp currently supports the following transportation networks: RATP, RER, Transilien, TER and Intercités. OPTILE network should follow soon.\r\n\r\nThis app is based on https:/ /github. com/HSLdevcom/ navigator- proto, and makes use of OpenTripPlanner (https:/ /github. com/OpenTripPla nner/OpenTripPl anner) for routing.",
"translations" : {
"keywords" : [
"déplacements" ,
"transports en commun",
"transilien" ,
"metro" ,
"RER",
"Paris" ,
"tramway" ,
"OPTILE" ,
"SNCF",
"RATP",
"TER",
"Intercités"
"website" : "http:// plannerparis. acolytesanonyme s.org",
"support_ url": "mailto:<email address hidden>",
"descripti on": "Déplacez-vous en transports en commun facilement sur l'Île de France grâce à MOTPP, la version mobile de http:// plannerparis. acolytesanonyme s.org.\r\n\r\nCette webapp réalise actuellement ses calculs d'itinéraires en région parisienne en prenant en compte les réseaux suivants : RATP (bus, tramways, métros), RER, Transilien, TER et Intercités. Le support OPTILE est prévu pour mi-octobre.",
"title" : "Planificateur de trajets en transports en commun pour Paris" /search. apps.ubuntu. com/api/ v1/package/ mobileotptransi tplan.kalon33"
"transit" ,
"transilien" ,
"tramway" ,
"Intercités" /search. apps.ubuntu. com/api/ v1/search? q=planificateur ' | jq . /wiki.ubuntu. com/AppStore/ Interfaces/ ClickPackageInd ex#reltype_{rel}",
"templated" : true /search. apps.ubuntu. com/api/ v1/search? q=planificateur &page=1" /search. apps.ubuntu. com/api/ v1/search? q=planificateur &page=1" /search. apps.ubuntu. com/api/ v1/search? q=planificateur &page=1" /search. apps.ubuntu. com/api/ v1/search? q=planificateur ' -H 'Accept-Language: fr' | jq . :package" : [
"publisher" : "Nicolas DERIVE",
"ratings_ average" : 5, itplan. kalon33" , /myapps. developer. ubuntu. com/site_ media/appmedia/ 2015/10/ gnome-maps. png", /search. apps.ubuntu. com/api/ v1/package/ mobileotptransi tplan.kalon33"
"architecture" : [ /wiki.ubuntu. com/AppStore/ Interfaces/ ClickPackageInd ex#reltype_{rel}",
"templated" : true /search. apps.ubuntu. com/api/ v1/search? q=planificateur &page=1" /search. apps.ubuntu. com/api/ v1/search? q=planificateur &page=1" /search. apps.ubuntu. com/api/ v1/search? q=planificateur &page=1"
$ curl -s 'https:/
{
"_embedded": {
"clickindex
{
"title": "Mobile OTP Transit Planner for Paris",
"fr": {
],
}
},
"_links": {
"self": {
"href": "https:/
}
},
"keywords": [
"public transport",
"metro",
"RER",
"Paris",
"OPTILE",
"SNCF",
"RATP",
"TER",
]
},
...
$ curl -s 'https:/
{
"_links": {
"curies": [
{
"href": "https:/
"name": "clickindex",
}
],
"self": {
"href": "https:/
},
"last": {
"href": "https:/
},
"first": {
"href": "https:/
}
}
}
$ curl -s 'https:/
{
"_embedded": {
"clickindex
{
"name": "mobileotptrans
"title": "Planificateur de trajets en transports en commun pour Paris",
"icon_url": "https:/
"price": 0,
"sequence": 3,
"content": "application",
"alias": null,
"version": "0.3",
"_links": {
"self": {
"href": "https:/
}
},
"all"
],
"prices": {},
"revision": 3
}
]
},
"_links": {
"curies": [
{
"href": "https:/
"name": "clickindex",
}
],
"self": {
"href": "https:/
},
"last": {
"href": "https:/
},
"first": {
"href": "https:/
}
}
}
```
The solution that will work today is for the uploader to add the translations. A possible future improvement would be to try to extract the translations from, say, a `.desktop` file in the package, but that's problematic for various reasons:
* What about packages that only ship scopes (no `.desktop` file)?
* What about packages that ship several apps (several `.desktop` files)?
* What about snap packages that are targeting IoT/Ubuntu Core (zero or more `.desktop` files, but not referenced in the manifest)?