Skip to content

Commit 2d8de78

Browse files
committed
Add a translation for 'other styles'
1 parent 4bb6404 commit 2d8de78

8 files changed

Lines changed: 26 additions & 2 deletions

File tree

js/learn/learnConfig.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66

77
'use strict';
88

9+
import {
10+
defineMessages,
11+
} from 'react-intl';
12+
13+
const messages = defineMessages({
14+
otherStylesTitle: {
15+
id: 'tutorialVideos.otherStylesTitle',
16+
defaultMessage: 'Other Styles',
17+
description: 'Name of the tutorial category for miscellaneous dance styles',
18+
},
19+
});
20+
921
export const defaultTutorials = [
1022
{
1123
title: 'Bboy / Bgirl',
@@ -140,6 +152,7 @@ export const defaultTutorials = [
140152
},
141153
{
142154
title: 'Other Styles',
155+
titleMessage: messages.otherStylesTitle,
143156
thumbnail: require('./images/styles/other.png'),
144157
tutorials: [
145158
require('./tutorials/misc/yakfilms.json'),

js/learn/playlistModels.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import moment from 'moment';
1010

1111
export class Playlist {
1212
title: string;
13+
titleMessage: ?{id: string};
1314
subtitle: string;
1415
author: string;
1516
style: string;
@@ -19,6 +20,7 @@ export class Playlist {
1920

2021
constructor(json: any) {
2122
this.title = json.title;
23+
this.titleMessage = json.titleMessage;
2224
this.subtitle = json.subtitle;
2325
this.author = json.author;
2426
this.style = json.style;

js/learn/playlistViews.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ class _PlaylistStylesView extends React.Component {
165165
const imageWidth = boxWidth - 30;
166166
const durationSeconds = style.tutorials.reduce((prev, current) => prev + current.getDurationSeconds(), 0);
167167
const length = formatDuration(this.props.intl.formatMessage, durationSeconds);
168+
let styleTitle = style.title;
169+
console.log(style.title, style.titleMessage);
170+
if (style.titleMessage) {
171+
styleTitle = this.props.intl.formatMessage(style.titleMessage);
172+
}
168173
return <TouchableHighlight
169174
onPress={() => {
170175
this.props.onSelected(style, this.state.stylePlaylists[style]);
@@ -182,7 +187,7 @@ class _PlaylistStylesView extends React.Component {
182187
alignItems: 'center',
183188
}}>
184189
<Image source={style.thumbnail} resizeMode="contain" style={{width: imageWidth, height: imageWidth}}/>
185-
<Text style={{fontWeight: 'bold'}}>{style.title}</Text>
190+
<Text style={{fontWeight: 'bold'}}>{styleTitle}</Text>
186191
<Text>{this.props.intl.formatMessage(messages.numTutorials, {count: style.tutorials.length})}</Text>
187192
<Text>{this.props.intl.formatMessage(messages.totalTime, {time: length})}</Text>
188193
</View>

js/learn/tutorials/waack/mizuki.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"title": "Mizuki's Waacking/Punking",
2+
"title": "Mizuki: Waacking/Punking",
33
"subtitle": "RISING Dance School",
44
"author": "Mizuki",
55
"style": "waack",

js/messages/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"tutorialVideos.navigatorTitle": "Learn: Tutorials",
7676
"tutorialVideos.numTutorials": "{count} Tutorials",
7777
"tutorialVideos.numVideosWithDuration": "{count} videos: {duration}",
78+
"tutorialVideos.otherStylesTitle": "Other Styles",
7879
"tutorialVideos.styleHeader": "Choose a style you'd like to learn:",
7980
"tutorialVideos.styleTutorialTitle": "{style} Tutorials",
8081
"tutorialVideos.timeHoursMinutes": "{hours}h {minutes}m",

js/messages/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"tutorialVideos.navigatorTitle": "Apprendre : Tutoriels",
7676
"tutorialVideos.numTutorials": "{count} Tutoriels",
7777
"tutorialVideos.numVideosWithDuration": "{count} vidéos : {duration}",
78+
"tutorialVideos.otherStylesTitle": "D'autres Styles",
7879
"tutorialVideos.styleHeader": "Choisir un style de danse :",
7980
"tutorialVideos.styleTutorialTitle": "Tutoriels de {style}",
8081
"tutorialVideos.timeHoursMinutes": "{hours}h {minutes}m",

js/messages/ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"tutorialVideos.navigatorTitle": "学ぶ: チュートリアル",
7676
"tutorialVideos.numTutorials": "{count}本のチュートリアル",
7777
"tutorialVideos.numVideosWithDuration": "{count}本の動画: {duration}",
78+
"tutorialVideos.otherStylesTitle": "他のダンススタイル",
7879
"tutorialVideos.styleHeader": "勉強したいダンススタイルを選択:",
7980
"tutorialVideos.styleTutorialTitle": "{style}のチュートリアル",
8081
"tutorialVideos.timeHoursMinutes": "{hours}時間 {minutes}分",

js/messages/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"tutorialVideos.navigatorTitle": "學習: 課程",
7676
"tutorialVideos.numTutorials": "{count}部課程",
7777
"tutorialVideos.numVideosWithDuration": "{count}個短片: {duration}",
78+
"tutorialVideos.otherStylesTitle": "其他的舞蹈風格",
7879
"tutorialVideos.styleHeader": "選擇你想學習舞蹈風格:",
7980
"tutorialVideos.styleTutorialTitle": "{style} 課程",
8081
"tutorialVideos.timeHoursMinutes": "{hours}小時{minutes}分",

0 commit comments

Comments
 (0)