OpenDevelopmentMekong / opendev-wptheme

Version 1.0 of Open Development frontend - JEO child theme
0 stars 1 forks source link

The related dataset from CKAN should be filtered by the languages on front-end #213

Open Huyeng opened 9 years ago

Huyeng commented 9 years ago

Currently, the related datasets added from the CKAN for the topic page is no multilingual support. Suggestion: Enhanced the related dataset box to filter the dataset by the languages on front-end page.

ChandaraKhun commented 8 years ago

Multi-lingual fields don't work yet. So the difficulties might exist with searching and uploading new laws/agreements. This may happen with library items as well. ODC editor team might have challenges with this since they need to upload related laws and publications with topical pages. law-agreements-policy_ckan law-agreements-policy_ckan kh

kathi-aeviator commented 8 years ago

@acorbi please comment in this issue.

acorbi commented 8 years ago

@Huyeng @chris-aeviator @ChandaraKhun Currently in the laws section in CKAN data.opendevelopmentmekong.net/laws_record there are 2 groups of laws:

  1. Those imported by the scripts which have both titles in EN and KM. See the metadata (through API call) of an example of those https://data.opendevelopmentmekong.net/api/3/action/package_show?id=prakas-no-106-on-the-prohibition-of-hazardous-child-labour
  2. Those added manually by the data entry staff which as I have been checking are ONLY in English. IMPORTANT! The language field on this records has been wrongly marked as Khmer, when their metadata has been entered in English. See the metadata (through API call) of an example of those https://data.opendevelopmentmekong.net/api/3/action/package_show?id=sub-decree-no-162-05-04-2013-pdf

As you can see there is in both examples a title_translated field, which is what we are willing to look at for this Issue.

Now, the way to fix this issue consists on adapting the logic on the related-resources-widget https://github.com/OpenDevelopmentMekong/opendev-wptheme/blob/master/inc/related-resources-widget.php so instead of displaying the field title it displays the field title_translated which has the form of a JSON string with one key for each of the available languages.

So the way to go would be:

  1. Adapt the call to the shortcode [wpckan_related_datasets] on https://github.com/OpenDevelopmentMekong/opendev-wptheme/blob/master/inc/related-resources-widget.php#L29 and include the parameter include_fields_extra , documented on https://github.com/OpenDevelopmentMekong/wpckan/
  2. Instead of ouputting title, output title_translated
kathi-aeviator commented 8 years ago

@chris-aeviator please comment on this issue if you can!

chris-aeviator commented 8 years ago

@acorbi @Huyeng got a big p1 list, have to downvote to p2 or @Huyeng are you able to work on this?

ChandaraKhun commented 8 years ago

News Container/Explorer on Open Development Cambodia don't have a filter. So, when there is no consistency between the number of English and Khmer versions, it does not look good. If I may suggest, a filter is necessary for a presentation of only Khmer version. khmer filter