Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Representing multiple languages #65

Open
siwhitehouse opened this issue Feb 7, 2013 · 10 comments
Open

Representing multiple languages #65

siwhitehouse opened this issue Feb 7, 2013 · 10 comments
Labels

Comments

@siwhitehouse
Copy link

An example here is the CIDA activity which is here in the API

http://data.aidinfolabs.org/xquery/woapi.xq?SectorCategory=112&Funder=CA&ID=CA-1-A034782001&search=&start-date=&end-date=&groupby=&start=1&pagesize=20&result=full&callback=&corpus=main&test=yes

with its datasheet in AidView here

http://aidview-dev.herokuapp.com/activity/CA-1-A034782001

As they are Canadian files they are being published in both French and English. There are a couple of questions I'd raise:

  1. AidView is showing the activity title in French. How is it selecting this? Is it just on the basis of it being the first element for in the file?
  2. Project description is not being pulled through at all.

I know we dropped the support for multiple languages part of the Phase 2 development, but I think we agreed to default to English where multiple languages are used.

@siwhitehouse
Copy link
Author

Looking at this a little bit more, if I browse to just about any Sector Category (leaving the sort in the top right-hand corner on A-Z) then Canadian activities are sorted to the top. This means that the first time most users encounter the bubbles for individual activities they are all in French.

eg.s
http://aidview-dev.herokuapp.com/activities?SectorCategory=111
http://aidview-dev.herokuapp.com/activities?SectorCategory=220

@benfoxall
Copy link
Contributor

Ah, contrary to our conversation yesterday, looks like the double titles are being served depending on the result type:

http://data.aidinfolabs.org/xquery/woapi.xq?ID=CA-1-A034782001&result=details (1 title, fr)
http://data.aidinfolabs.org/xquery/woapi.xq?ID=CA-1-A034782001&result=full (2 titles, fr + en)

@KitWallace - is it possible to get both title elements back in the details result?

@benfoxall
Copy link
Contributor

aidview now supports multiple title elements (commit to follow) - I'll leave this issue open though

@KitWallace
Copy link

all titles returned in the details result

@siwhitehouse
Copy link
Author

I think we're nearly there. When I look at the first 20 results currently returned by the APi they are Canadian International Development Agency (CIDA) ones.

http://data.aidinfolabs.org/xquery/woapi.xq?SectorCategory=111&ID=&search=&start-date=&end-date=&start=1&pagesize=20&result=details&callback=&corpus=main&test=yes

Each of these has two title elements, the first in French the second in English.

So, if I then look at these 20 in Aidview I still see 20 activities with titles in French

http://aidview-dev.herokuapp.com/activities?SectorCategory=111

But, when I click through to each one's individual activity datasheet then the titles are in English, as per

http://aidview-dev.herokuapp.com/activity/CA-1-A021431002

Is it possible that you've amended the code for individual data sheets but not for the Filtering subsets, Ben? I see similar behaviour when I filter by Country (well, for Canada anyway)

http://aidview-dev.herokuapp.com/activities?Funder=CA

and countries where CIDA are working, such as Afghanistan:

http://aidview-dev.herokuapp.com/activities?Country=AF

@benfoxall
Copy link
Contributor

Ah, these pages use the values rather than details result:

http://data.aidinfolabs.org/xquery/woapi.xq?SectorCategory=111&format=json&pagesize=20&result=values&start=1

Looks like this gives the first title element : https://github.com/KitWallace/AIDVIEW-DB/blob/master/db/db/apps/iati/lib/api.xqm#L764 (I'm not totally sure).

@KitWallace would it be possible to return the title elements in addition on this result?

@KitWallace
Copy link

Currently values result is computed as
element iati-activity {
element code {$activity/iati-identifier/string()},
element name {$activity/title[1]/string()},
element value {$activity/@iati-ad:project-value/string()}
so if multiple titles are present should this return multiple names? no problem to do but can you say how you want it to returned.

@benfoxall
Copy link
Contributor

Hi @KitWallace,

Sorry for the delay in replying.

If it was possible to replace name with the full title tags, then aidview should be able to deal with it:

for example:

<!-- current -->
<iati-activity>
<code>CA-1-A021431002</code>
<name>Améliorer l'éducation de base aux enfants autochtones/ruraux-Sud des Andes et Amazonie, Pérou- Suivi</name>
<value>194137</value>
</iati-activity>


<!-- could we have: -->
<iati-activity>
<code>CA-1-A021431002</code>
<title xml:lang="fr">
    Améliorer l'éducation de base aux enfants autochtones/ruraux-Sud des Andes et Amazonie, Pérou- Suivi
</title>
<title xml:lang="en">
    Improving Basic Education for Indigenous/Rural Children in S. Andean and Amazonian Peru - Monitoring
</title>
<value>194137</value>
</iati-activity>

@benfoxall benfoxall reopened this Mar 7, 2013
@KitWallace
Copy link

OK done

@KitWallace
Copy link

longer term it would be better to do this on the server because it not only the explicitly coded text which needs to be returned in in the native language, its the text value of codes as well. We don't have much in the way of language-specific code lists at the moment although this rewrite would regularize code names right now. So my preferred solution would be to add a language code to the API.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants