Skip to content

Commit

Permalink
fix: Add missing translations (#81)
Browse files Browse the repository at this point in the history
* Add spanish

* Add missing translations
  • Loading branch information
amaury1093 authored Apr 25, 2019
1 parent caa9e99 commit 7a74f01
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
12 changes: 6 additions & 6 deletions App/Screens/About/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,27 @@ export class About extends PureComponent {
</View>

<View style={styles.credits}>
<Text style={styles.h2}>Credits</Text>
<Text style={styles.h2}>{i18n.t('about_credits_title')}</Text>
<Text style={theme.text}>
Concept &amp; Development by{' '}
{i18n.t('about_credits_concept_and_development')}{' '}
<Text onPress={this.handleOpenAmaury} style={theme.link}>
Amaury Martiny
</Text>
.{'\n'}
Design &amp; Copywriting by{' '}
{i18n.t('about_credits_design_and_copywriting')}{' '}
<Text onPress={this.handleOpenMarcelo} style={theme.link}>
Marcelo S. Coelho
</Text>
.{'\n'}
{'\n'}
Air quality data from{' '}
{i18n.t('about_credits_data_from')}{' '}
<Text onPress={this.handleOpenAqi} style={theme.link}>
WAQI
</Text>
.{'\n'}
Source code{' '}
{i18n.t('about_credits_source_code')}{' '}
<Text onPress={this.handleOpenGithub} style={theme.link}>
available on Github
{i18n.t('about_credits_available_github')}
</Text>
.{'\n'}
{'\n'}
Expand Down
7 changes: 3 additions & 4 deletions App/Screens/About/Box/Box.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import React, { PureComponent } from 'react';
import { Image, Platform, StyleSheet, Text, View } from 'react-native';

import cigarette from '../../../../assets/images/cigarette.png';
import { i18n } from '../../../localization';
import * as theme from '../../../utils/theme';

export class Box extends PureComponent {
Expand All @@ -28,7 +29,7 @@ export class Box extends PureComponent {
<View style={styles.statisticsLeft}>
<Image source={cigarette} style={styles.cigarette} />
<Text style={styles.value} />
<Text style={styles.label}>per day</Text>
<Text style={styles.label}>{i18n.t('about_box_per_day')}</Text>
</View>
<Text style={styles.equal}>=</Text>
<View style={styles.statisticsRight}>
Expand All @@ -40,9 +41,7 @@ export class Box extends PureComponent {
</View>
</View>
<Text style={styles.boxDescription}>
*Atmospheric particulate matter (PM) that have a diameter of less than
2.5 micrometers, with increased chances of inhalation by living
beings.
{i18n.t('about_box_footnote')}
</Text>
</View>
);
Expand Down
2 changes: 2 additions & 0 deletions App/localization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ import i18n from 'i18n-js';

// languages
const en = require('./languages/en');
const es = require('./languages/es');
const fr = require('./languages/fr');

i18n.fallbacks = true;
i18n.translations = {
en,
es,
fr
};
i18n.locale = Localization.locale;
Expand Down
10 changes: 9 additions & 1 deletion App/localization/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"about_how_do_you_calculate_the_number_of_cigarettes_message_1": "This app was inspired by Berkeley Earth’s findings about the",
"about_how_do_you_calculate_the_number_of_cigarettes_link_1": "equivalence between air pollution and cigarette smoking",
"about_how_do_you_calculate_the_number_of_cigarettes_message_2": ". The rule of thumb is simple: one cigarette per day is the rough equivalent of a PM2.5 level of 22",
"about_box_per_day": "per day",
"about_box_footnote": "*Atmospheric particulate matter (PM) that have a diameter of less than 2.5 micrometers, with increased chances of inhalation by living beings.",
"about_where_does_data_come_from_title": "Where does the data come from?",
"about_where_does_data_come_from_message_1": "Air quality data comes from",
"about_where_does_data_come_from_link_1": "WAQI",
Expand All @@ -48,5 +50,11 @@
"about_weird_results_title": "The results are weird or inconsistent with other sources!",
"about_weird_results_message_1": "We have also encountered a few surprising results: large cities with better air than small villages; sudden huge increases in the number of cigarettes; stations of the same town showing significantly different numbers... The fact is air quality depends on several factors such as temperature, pressure, humidity and even wind direction and intensity. If the result seems weird for you, check",
"about_weird_results_link_1": "WAQI",
"about_weird_results_message_2": "for more information and history on your station."
"about_weird_results_message_2": "for more information and history on your station.",
"about_credits_title": "Credits",
"about_credits_concept_and_development": "Concept & Development by",
"about_credits_design_and_copywriting": "Design & Copywriting by",
"about_credits_data_from": "Air quality data from",
"about_credits_source_code": "Source code",
"about_credits_available_github": "available on Github"
}

0 comments on commit 7a74f01

Please sign in to comment.