From 6dfb8e0c38c018ba7716a2ef971408461144988f Mon Sep 17 00:00:00 2001 From: keplyx Date: Thu, 7 Nov 2019 17:58:02 +0100 Subject: [PATCH] Improved translations --- components/DashboardItem.js | 11 +++++++---- components/Sidebar.js | 2 +- screens/AvailableRoomScreen.js | 4 ++-- screens/HomeScreen.js | 6 +++--- translations/en.json | 2 ++ translations/fr.json | 2 ++ 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/components/DashboardItem.js b/components/DashboardItem.js index c4840fe..246d476 100644 --- a/components/DashboardItem.js +++ b/components/DashboardItem.js @@ -8,6 +8,7 @@ import ThemeManager from "../utils/ThemeManager"; import HTML from "react-native-render-html"; import {LinearGradient} from "expo-linear-gradient"; import PlatformTouchable from "react-native-platform-touchable"; +import i18n from "i18n-js"; const CARD_BORDER_RADIUS = 10; @@ -101,12 +102,14 @@ export default class DashboardItem extends React.Component { }}/> { marginBottom: 'auto', padding: 0, }}> - Click to see more + {i18n.t("homeScreen.dashboard.seeMore")} diff --git a/components/Sidebar.js b/components/Sidebar.js index d06e601..b0cd428 100644 --- a/components/Sidebar.js +++ b/components/Sidebar.js @@ -56,7 +56,7 @@ export default class SideBar extends React.Component { icon: "school", }, { - name: "Salles dispo", + name: i18n.t('screens.availableRooms'), route: "AvailableRoomScreen", icon: "calendar-check", }, diff --git a/screens/AvailableRoomScreen.js b/screens/AvailableRoomScreen.js index 5abeae7..b99be46 100644 --- a/screens/AvailableRoomScreen.js +++ b/screens/AvailableRoomScreen.js @@ -1,8 +1,8 @@ // @flow import * as React from 'react'; -import ThemeManager from "../utils/ThemeManager"; import WebViewScreen from "../components/WebViewScreen"; +import i18n from "i18n-js"; type Props = { navigation: Object, @@ -31,7 +31,7 @@ export default class AvailableRoomScreen extends React.Component { navigation={nav} url={URL} customInjectedJS={this.customInjectedJS} - headerTitle={'SAlles dispo'} + headerTitle={i18n.t('screens.availableRooms')} hasHeaderBackButton={true} hasSideMenu={false}/> ); diff --git a/screens/HomeScreen.js b/screens/HomeScreen.js index b4f1144..14a1eef 100644 --- a/screens/HomeScreen.js +++ b/screens/HomeScreen.js @@ -9,7 +9,7 @@ import FetchedDataSectionList from "../components/FetchedDataSectionList"; import Autolink from 'react-native-autolink'; import ThemeManager from "../utils/ThemeManager"; import DashboardItem from "../components/DashboardItem"; -import DATA from "../dashboard_data.json"; +// import DATA from "../dashboard_data.json"; const ICON_AMICALE = require('../assets/amicale.png'); @@ -39,7 +39,7 @@ function openWebLink(link) { export default class HomeScreen extends FetchedDataSectionList { constructor() { - super('DATA_URL', REFRESH_TIME); + super(DATA_URL, REFRESH_TIME); } getHeaderTranslation() { @@ -55,7 +55,7 @@ export default class HomeScreen extends FetchedDataSectionList { } createDataset(fetchedData: Object) { - fetchedData = DATA; + // fetchedData = DATA; let newsData = []; let dashboardData = []; if (fetchedData['news_feed'] !== undefined) diff --git a/translations/en.json b/translations/en.json index a4cf9ea..49377a2 100644 --- a/translations/en.json +++ b/translations/en.json @@ -6,6 +6,7 @@ "proximo": "Proximo", "menuSelf": "RU Menu", "settings": "Settings", + "availableRooms": "Available rooms", "about": "About", "debug": "Debug" }, @@ -72,6 +73,7 @@ "listUpdateFail": "Error while updating list", "newsFeed": "Campus News", "dashboard": { + "seeMore": "Click to see more", "todayEventsTitle": "Today's events", "todayEventsSubtitleNA": "No events today", "todayEventsSubtitle": " event coming today", diff --git a/translations/fr.json b/translations/fr.json index 77e9395..6407f91 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -6,6 +6,7 @@ "proximo": "Proximo", "menuSelf": "Menu du RU", "settings": "Paramètres", + "availableRooms": "Salles dispo", "about": "À Propos", "debug": "Debug" }, @@ -72,6 +73,7 @@ "listUpdateFail": "Erreur lors de la mise à jour de la liste", "newsFeed": "Nouvelles du campus", "dashboard": { + "seeMore": "Cliquez pour plus d'infos", "todayEventsTitle": "Événements aujourd'hui", "todayEventsSubtitleNA": "Pas d'événements", "todayEventsSubtitle": " événement aujourd'hui",