Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move title and subtitle translations from service config to Ares payload #2947

Merged
merged 12 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions data/afaanoromoo/bbc_afaanoromo_radio/liveradio.json

This file was deleted.

31 changes: 31 additions & 0 deletions data/afaanoromoo/bbc_afaanoromoo_radio/liveradio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"metadata": {
"id": "urn:bbc:ares::asset:afaanoromo/bbc_afaanoromo_radio/liveradio",
"tags": {}
},
"content": {
"title": "Dhaggeeffadhaa",
"subtitle": "Sagantaawwan keenya",
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Afaanoromo Live Radio",
"uri": "/afaanoromo/bbc_afaanoromo_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
56 changes: 29 additions & 27 deletions data/amharic/bbc_amharic_radio/liveradio.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"metadata": {
"id": "urn:bbc:ares::asset:amharic/bbc_amharic_radio/liveradio",
"tags": {}
},
"content": {
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
}
"metadata": {
"id": "urn:bbc:ares::asset:amharic/bbc_amharic_radio/liveradio",
"tags": {}
},
"content": {
"title": "ያድምጡ",
"subtitle": "ዝግጅቶቻችንን",
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Amharic Live Radio",
"uri": "/amharic/bbc_amharic_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Amharic Live Radio",
"uri": "/amharic/bbc_amharic_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
56 changes: 29 additions & 27 deletions data/indonesia/bbc_indonesian_radio/liveradio.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"metadata": {
"id": "urn:bbc:ares::asset:indonesia/bbc_indonesian_radio/liveradio",
"tags": {}
},
"content": {
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
}
"metadata": {
"id": "urn:bbc:ares::asset:indonesia/bbc_indonesian_radio/liveradio",
"tags": {}
},
"content": {
"title": "BBC Indonesia Radio",
"subtitle": "Berita dunia, ulasan, berita olahraga dan majalah mingguan dari BBC Indonesia Radio.",
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Indonesia Live Radio",
"uri": "/indonesia/bbc_indonesian_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Indonesia Live Radio",
"uri": "/indonesia/bbc_indonesian_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
56 changes: 29 additions & 27 deletions data/korean/bbc_korean_radio/liveradio.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"metadata": {
"id": "urn:bbc:ares::asset:korean/bbc_korean_radio/liveradio",
"tags": {}
},
"content": {
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
}
"metadata": {
"id": "urn:bbc:ares::asset:korean/bbc_korean_radio/liveradio",
"tags": {}
},
"content": {
"title": "BBC 코리아 라디오",
"subtitle": "세계와 한반도 뉴스를 공정하고 객관적으로 전달해 드립니다",
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Korean Live Radio",
"uri": "/korean/bbc_korean_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Korean Live Radio",
"uri": "/korean/bbc_korean_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
56 changes: 29 additions & 27 deletions data/tigrinya/bbc_tigrinya_radio/liveradio.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"metadata": {
"id": "urn:bbc:ares::asset:tigrinya/bbc_tigrinya_radio/liveradio",
"tags": {}
},
"content": {
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
}
"metadata": {
"id": "urn:bbc:ares::asset:tigrinya/bbc_tigrinya_radio/liveradio",
"tags": {}
},
"content": {
"title": "ስምዑ",
"subtitle": "መደባትና",
"blocks": [
{
"id": "liveradio",
"type": "media",
"format": "audio",
"title": "TODO",
"caption": "TODO",
"versions": [
{
"versionId": "liveradio"
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Tigrinya Live Radio",
"uri": "/tigrinya/bbc_tigrinya_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
}
]
},
"promo": {
"subType": "IDX",
"name": "TODO: Tigrinya Live Radio",
"uri": "/tigrinya/bbc_tigrinya_radio/liveradio",
"id": "TODO",
"type": "simple"
}
}
13 changes: 7 additions & 6 deletions src/app/containers/MediaPageMain/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ import React, { Fragment, useContext } from 'react';
import { string, shape, object } from 'prop-types';
import { Headline } from '@bbc/psammead-headings';
import Paragraph from '@bbc/psammead-paragraph';
import pathOr from 'ramda/src/pathOr';

import MetadataContainer from '../Metadata';
import { Grid, GridItemConstrainedMedium } from '../../lib/styledGrid';
import { ServiceContext } from '../../contexts/ServiceContext';

const MediaPageMain = props => {
const { pageData, service, match } = props;
const { serviceId, mediaId } = match.params;
const { script, translations } = useContext(ServiceContext);

const { title, subtitle } = pathOr(null, ['media', serviceId], translations);
const { script } = useContext(ServiceContext);
const {
content: { title, subtitle },
promo,
metadata,
} = pageData;

return (
<Fragment>
<MetadataContainer metadata={pageData.metadata} promo={pageData.promo} />
<MetadataContainer metadata={metadata} promo={promo} />
<main role="main">
<Grid>
<GridItemConstrainedMedium>
Expand Down
4 changes: 4 additions & 0 deletions src/app/containers/MediaPageMain/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const liveRadioScaffoldProps = {
id: 'bbc_amharic_radio',
tags: {},
},
content: {
title: 'ያድምጡ',
subtitle: 'ዝግጅቶቻችንን',
},
promo: {
subType: 'IDX',
name: 'BBC Amharic Radio',
Expand Down
8 changes: 0 additions & 8 deletions src/app/lib/config/services/afaanoromoo.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ const service = {
audio: 'Sagalee',
photogallery: 'Kuusaa Fakkii',
video: 'Viidiyoo',
bbc_oromo_radio: {
title: 'Dhaggeeffadhaa',
subtitle: 'Sagantaawwan keenya',
},
bbc_afaanoromoo_radio: {
title: 'Dhaggeeffadhaa',
subtitle: 'Sagantaawwan keenya',
},
},
},
brandSVG,
Expand Down
4 changes: 0 additions & 4 deletions src/app/lib/config/services/amharic.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ const service = {
audio: 'ድምጽ',
photogallery: 'የምስል ቋት',
video: 'ተንቀሳቃሽ ምስል',
bbc_amharic_radio: {
title: 'ያድምጡ',
subtitle: 'ዝግጅቶቻችንን',
},
},
},
brandSVG,
Expand Down
5 changes: 0 additions & 5 deletions src/app/lib/config/services/indonesia.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ const service = {
audio: 'Audio',
photogallery: 'Galeri Foto',
video: 'Video',
bbc_indonesian_radio: {
title: 'BBC Indonesia Radio',
subtitle:
'Berita dunia, ulasan, berita olahraga dan majalah mingguan dari BBC Indonesia Radio.',
},
},
},
brandSVG,
Expand Down
4 changes: 0 additions & 4 deletions src/app/lib/config/services/korean.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ const service = {
audio: '오디오',
photogallery: '이미지 갤러리',
video: '비디오',
bbc_korean_radio: {
title: 'BBC 코리아 라디오',
subtitle: '세계와 한반도 뉴스를 공정하고 객관적으로 전달해 드립니다',
},
},
},
brandSVG,
Expand Down
Loading