Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #94 from ZendyLim/feature/#84_fix_localization_and…
Browse files Browse the repository at this point in the history
…_other_bugs

Feature/#84 fix localization and other bugs
  • Loading branch information
andy1dx authored Jun 18, 2018
2 parents 178e99f + f64b539 commit b77b6f5
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 38 deletions.
33 changes: 25 additions & 8 deletions app/config/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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: "ログイン",
Expand Down Expand Up @@ -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 : "サインイン",
Expand Down Expand Up @@ -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 : "警告",


}
});
4 changes: 2 additions & 2 deletions app/screens/Login/username.js
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand Down
18 changes: 9 additions & 9 deletions app/screens/Quiz/quizHiraganaList.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { strings } from '../../config/localization';
};

state = {
checkAllText: "Check All",
checkAllText: strings['CHECK_ALL'],
statusCheckAll: false,
stsList : "",
statusPerRow: false,
Expand Down Expand Up @@ -55,7 +55,7 @@ import { strings } from '../../config/localization';
<TouchableOpacity style={quizStyles.menuButton}
onPress={()=> { this.checkAll() }}
>
<Text style={quizStyles.buttonText}>{ strings['CHECK_ALL']}</Text>
<Text style={quizStyles.buttonText}>{this.state.checkAllText}</Text>
</TouchableOpacity>
<TouchableOpacity style={quizStyles.menuButton}
onPress={this.proceed}
Expand Down Expand Up @@ -105,13 +105,13 @@ import { strings } from '../../config/localization';
for(i=0;i<hiraganaList.length;i++){
if(this.checkRows[i] == true){
this.setState({statusCheckAll: !this.state.statusCheckAll})
this.setState({ checkAllText: "Check All" })
this.setState({ checkAllText: strings['CHECK_ALL'] })
status=true;
}
}
if (status == false) error = "You need to choose at least 1 row";
if (status == false) error = strings['HIRAGANA_KATAKANA_LIST_VALIDATION'];
if (error) {
Alert.alert('Warning', error);
Alert.alert(strings['WARNING'], error);
return true;
}
else{
Expand Down Expand Up @@ -173,7 +173,7 @@ import { strings } from '../../config/localization';
this.checkRows[key] = false,
this.setState({ statusPerRow: this.checkRows })
));
this.setState({ checkAllText: "Check All" })
this.setState({ checkAllText: strings['CHECK_ALL'] })
}else{
{hiraganaList.map((item, key)=>(
this.checkItems[key] = true,
Expand All @@ -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'] })
}
};

Expand Down Expand Up @@ -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'] })
}
}

Expand Down
16 changes: 8 additions & 8 deletions app/screens/Quiz/quizKatakanaList.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { strings } from '../../config/localization';
};

state = {
checkAllText: "Check All",
checkAllText: strings['CHECK_ALL'],
statusCheckAll: false,
stsList : false,
statusPerRow: false,
Expand Down Expand Up @@ -62,7 +62,7 @@ import { strings } from '../../config/localization';
<TouchableOpacity style={quizStyles.menuButton}
onPress={this.proceed}
>
<Text style={quizStyles.buttonText}>Proceed ></Text>
<Text style={quizStyles.buttonText}>{strings['PROCEED']}</Text>
</TouchableOpacity>
</View>
<View style={styles.row}>
Expand Down Expand Up @@ -107,11 +107,11 @@ import { strings } from '../../config/localization';
for(i=0;i<katakanaList.length;i++){
if(this.checkRows[i] == true){
this.setState({statusCheckAll: !this.state.statusCheckAll})
this.setState({ checkAllText: "Check All" })
this.setState({ checkAllText: strings['CHECK_ALL'] })
status=true;
}
}
if (status == false) error = "You need to choose at least 1 row";
if (status == false) error = strings['HIRAGANA_KATAKANA_LIST_VALIDATION'];
if (error) {
Alert.alert('Warning', error);
return true;
Expand Down Expand Up @@ -175,7 +175,7 @@ import { strings } from '../../config/localization';
this.checkRows[key] = false,
this.setState({ statusPerRow: this.checkRows })
))};
this.setState({ checkAllText: "Check All" })
this.setState({ checkAllText: strings['CHECK_ALL'] })
}else{
{katakanaList.map((item, key)=>(
this.checkItems[key] = true,
Expand All @@ -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){
Expand Down Expand Up @@ -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'] })
}
}

Expand Down
9 changes: 7 additions & 2 deletions app/screens/Summary/studyPick.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
}
Expand Down
14 changes: 11 additions & 3 deletions app/screens/Summary/studySummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 9 additions & 6 deletions app/screens/Summary/summaryLearn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
Expand All @@ -54,10 +57,10 @@ class SummaryLearnDetail extends Component {
resizeMode="cover"
/>
<View style={study.summaryLearn} >
<Text style={[study.summaryTitle, study.fontBold]}>TITLE</Text>
<Text style={[study.summaryDetail, study.fontBold]}>CORRECT</Text>
<Text style={[study.summaryDetail, study.fontBold]}>MISTAKE</Text>
<Text style={[study.summaryDetail, study.fontBold]}>TOTAL</Text>
<Text style={[study.summaryTitle, study.fontBold]}>{strings['SUMMARY_TITLE']}</Text>
<Text style={[study.summaryDetail, study.fontBold]}>{strings['SUMMARY_CORRECT']}</Text>
<Text style={[study.summaryDetail, study.fontBold]}>{strings['SUMMARY_MISTAKE']}</Text>
<Text style={[study.summaryDetail, study.fontBold]}>{strings['SUMMARY_TOTAL']}</Text>
</View>
{ this.props.showLearn.map((item, key)=>(
<View key={key} style={study.summaryLearn} >
Expand Down

0 comments on commit b77b6f5

Please sign in to comment.