From ae1c8dacc85fed6d28c430cc83cb086b5cddc165 Mon Sep 17 00:00:00 2001 From: viinkelvin Date: Mon, 18 Jun 2018 11:05:11 +0900 Subject: [PATCH] Localization - Summary page localization - Hiragana & katakana list page Validation localization --- app/config/localization.js | 33 +++++++++++++++++++++------- app/screens/Login/username.js | 4 ++-- app/screens/Quiz/quizHiraganaList.js | 18 +++++++-------- app/screens/Quiz/quizKatakanaList.js | 16 +++++++------- app/screens/Summary/studyPick.js | 9 ++++++-- app/screens/Summary/studySummary.js | 14 +++++++++--- app/screens/Summary/summaryLearn.js | 15 ++++++++----- 7 files changed, 71 insertions(+), 38 deletions(-) diff --git a/app/config/localization.js b/app/config/localization.js index 9c28fb1..97cc20f 100644 --- a/app/config/localization.js +++ b/app/config/localization.js @@ -90,8 +90,10 @@ export let strings = new LocalizedStrings({ EXPLAINATION_LEARN : 'Explanation card', SUMMARY_LEFT : 'Days Left', CHECK_ALL : "Check All", + UNCHECK_ALL : "Uncheck All", PROCEED : "Proceed >", QUIZLIST : "Quizlist", + HIRAGANA_KATAKANA_LIST_VALIDATION : "You need to choose at least 1 row", //login part SIGN_IN : "Sign In", @@ -128,7 +130,13 @@ export let strings = new LocalizedStrings({ SUMMARY_KANJI : "Kanji", SUMMARY_WORD_LEARN : "\nWord\nLearned", SUMMARY_SUMMARY_MESSAGE : "Let's Review\n What have you learn?", - + SUMMARY_HEADER : "Summary", + SUMMARY_TITLE : "TITLE", + SUMMARY_CORRECT : "CORRECT", + SUMMARY_MISTAKE : "MISTAKE", + SUMMARY_TOTAL :"TOTAL", + + WARNING : "Warning", }, ja: { loginGuest: "ログイン", @@ -214,10 +222,11 @@ export let strings = new LocalizedStrings({ PROFILE_MODAL_CLOSE : "キャンセル", TITLE_LEARN : '学ぶ', EXPLAINATION_LEARN : '説明カード', - CHECK_ALL : "すべてチェック", + CHECK_ALL : "全選択", + UNCHECK_ALL : "全解除", PROCEED : "持続する >", QUIZLIST : "クイズリスト", - + HIRAGANA_KATAKANA_LIST_VALIDATION : "少なくとも1行を選択する必要です", //login part SIGN_IN : "サインイン", @@ -251,11 +260,19 @@ export let strings = new LocalizedStrings({ PROFILE_LOGOUT : "ログアウト", //summary part - SUMMARY_VOCABULARY : "語彙", - SUMMARY_GRAMMAR: "文法", - SUMMARY_KANJI : "漢字", - SUMMARY_WORD_LEARN : "\n学ぶ\n言葉", - SUMMARY_SUMMARY_MESSAGE : "復習しましょう\n何が学びました?", + SUMMARY_VOCABULARY : "語彙", + SUMMARY_GRAMMAR: "文法", + SUMMARY_KANJI : "漢字", + SUMMARY_WORD_LEARN : "\n学ぶ\n言葉", + SUMMARY_SUMMARY_MESSAGE : "復習しましょう\n何が学びました?", + SUMMARY_HEADER : "概要", + SUMMARY_TITLE : "タイトル", + SUMMARY_CORRECT : "正しい", + SUMMARY_MISTAKE : "間違い", + SUMMARY_TOTAL :"合計", + + WARNING : "警告", + } }); \ No newline at end of file diff --git a/app/screens/Login/username.js b/app/screens/Login/username.js index 1be0a3f..ee8db83 100644 --- a/app/screens/Login/username.js +++ b/app/screens/Login/username.js @@ -102,7 +102,7 @@ import { let error = ''; if(data.success==false) error = strings['SIGN_IN_VALIDATION_FAILED']; if (error) { - Alert.alert('Warning', error); + Alert.alert(strings['WARNING'], error); return true; } else{ @@ -116,7 +116,7 @@ import { if (!username) error = strings['SIGN_IN_VALIDATION_USERNAME']; else if (!password) error = strings['SIGN_IN_VALIDATION_PASSWORD']; if (error) { - Alert.alert('Warning', error); + Alert.alert(strings['WARNING'], error); return true; } else{ diff --git a/app/screens/Quiz/quizHiraganaList.js b/app/screens/Quiz/quizHiraganaList.js index 9d4d607..6f010e0 100644 --- a/app/screens/Quiz/quizHiraganaList.js +++ b/app/screens/Quiz/quizHiraganaList.js @@ -27,7 +27,7 @@ import { strings } from '../../config/localization'; }; state = { - checkAllText: "Check All", + checkAllText: strings['CHECK_ALL'], statusCheckAll: false, stsList : "", statusPerRow: false, @@ -55,7 +55,7 @@ import { strings } from '../../config/localization'; { this.checkAll() }} > - { strings['CHECK_ALL']} + {this.state.checkAllText} ( this.checkItems[key] = true, @@ -183,7 +183,7 @@ import { strings } from '../../config/localization'; this.checkRows[key] = true, this.setState({ statusPerRow: this.checkRows }) ))}; - this.setState({ checkAllText: "Uncheck All" }) + this.setState({ checkAllText: strings['UNCHECK_ALL'] }) } }; @@ -219,10 +219,10 @@ import { strings } from '../../config/localization'; checkAllStatus = () => { if(this.checkRows.every(this.checkRowStatus)){ this.setState({statusCheckAll: true}) - this.setState({ checkAllText: "Uncheck All" }) + this.setState({ checkAllText: strings['UNCHECK_ALL'] }) }else{ this.setState({statusCheckAll: false}) - this.setState({ checkAllText: "Check All" }) + this.setState({ checkAllText: strings['CHECK_ALL'] }) } } diff --git a/app/screens/Quiz/quizKatakanaList.js b/app/screens/Quiz/quizKatakanaList.js index e258442..7b83528 100644 --- a/app/screens/Quiz/quizKatakanaList.js +++ b/app/screens/Quiz/quizKatakanaList.js @@ -26,7 +26,7 @@ import { strings } from '../../config/localization'; }; state = { - checkAllText: "Check All", + checkAllText: strings['CHECK_ALL'], statusCheckAll: false, stsList : false, statusPerRow: false, @@ -62,7 +62,7 @@ import { strings } from '../../config/localization'; - Proceed > + {strings['PROCEED']} @@ -107,11 +107,11 @@ import { strings } from '../../config/localization'; for(i=0;i( this.checkItems[key] = true, @@ -185,7 +185,7 @@ import { strings } from '../../config/localization'; this.checkRows[key] = true, this.setState({ statusPerRow: this.checkRows }) ))}; - this.setState({ checkAllText: "Uncheck All" }) + this.setState({ checkAllText: strings['UNCHECK_ALL'] }) } }; checkRow(key){ @@ -217,10 +217,10 @@ import { strings } from '../../config/localization'; checkAllStatus = () => { if(this.checkRows.every(this.checkRowStatus)){ this.setState({statusCheckAll: true}) - this.setState({ checkAllText: "Uncheck All" }) + this.setState({ checkAllText: strings['UNCHECK_ALL'] }) }else{ this.setState({statusCheckAll: false}) - this.setState({ checkAllText: "Check All" }) + this.setState({ checkAllText: strings['CHECK_ALL'] }) } } diff --git a/app/screens/Summary/studyPick.js b/app/screens/Summary/studyPick.js index 469a7c0..3c68ecc 100644 --- a/app/screens/Summary/studyPick.js +++ b/app/screens/Summary/studyPick.js @@ -26,9 +26,14 @@ class SummaryTopicList extends Component { constructor() { super(); } - static navigationOptions = { - title: 'Learn', + static navigationOptions = ({ navigation }) =>{ + const {state} = navigation; + return { + title: strings['SUMMARY_HEADER'], + }; }; + + state = { type: "", } diff --git a/app/screens/Summary/studySummary.js b/app/screens/Summary/studySummary.js index 51ceb15..ee7e703 100644 --- a/app/screens/Summary/studySummary.js +++ b/app/screens/Summary/studySummary.js @@ -24,10 +24,18 @@ import { class StudySummaryScreen extends Component { - static navigationOptions = { - header: null, - title: 'Summary', + static navigationOptions = ({ navigation }) =>{ + header: null; + const {state} = navigation; + return { + title: strings['SUMMARY_HEADER'], + }; }; + + // static navigationOptions = { + // header: null, + // title: 'Summary', + // }; constructor(props){ super(props); diff --git a/app/screens/Summary/summaryLearn.js b/app/screens/Summary/summaryLearn.js index 0a340a4..a3b4671 100644 --- a/app/screens/Summary/summaryLearn.js +++ b/app/screens/Summary/summaryLearn.js @@ -26,8 +26,11 @@ class SummaryLearnDetail extends Component { constructor() { super(); } - static navigationOptions = { - title: 'Learn', + static navigationOptions = ({ navigation }) =>{ + const {state} = navigation; + return { + title: strings['SUMMARY_HEADER'], + }; }; state = { type: "", @@ -54,10 +57,10 @@ class SummaryLearnDetail extends Component { resizeMode="cover" /> - TITLE - CORRECT - MISTAKE - TOTAL + {strings['SUMMARY_TITLE']} + {strings['SUMMARY_CORRECT']} + {strings['SUMMARY_MISTAKE']} + {strings['SUMMARY_TOTAL']} { this.props.showLearn.map((item, key)=>(