From cf829d102ba620df273c0970e45421da47b4c34c Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 25 Sep 2023 14:27:40 +0300 Subject: [PATCH 1/2] chore: dt-5890 translations --- app/component/ItineraryTab.js | 13 ++++++++----- app/configurations/config.tampere.js | 14 ++++++++++++-- app/translations.js | 6 +++--- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/app/component/ItineraryTab.js b/app/component/ItineraryTab.js index 8f2c9d0a0c..cce4732b88 100644 --- a/app/component/ItineraryTab.js +++ b/app/component/ItineraryTab.js @@ -67,6 +67,7 @@ const ItineraryShape = PropTypes.shape({ }), ), fares: PropTypes.arrayOf(FareShape), + currentLanguage: PropTypes.string.isRequired, }); /* eslint-disable prettier/prettier */ @@ -81,6 +82,7 @@ class ItineraryTab extends React.Component { isMobile: PropTypes.bool.isRequired, currentTime: PropTypes.number.isRequired, hideTitle: PropTypes.bool, + currentLanguage: PropTypes.string.isRequired, }; static defaultProps = { @@ -176,7 +178,7 @@ class ItineraryTab extends React.Component { }; render() { - const { itinerary } = this.props; + const { itinerary, currentLanguage } = this.props; const { config } = this.context; if (!itinerary || !itinerary.legs[0]) { @@ -315,14 +317,14 @@ class ItineraryTab extends React.Component { values={{ callAgencyInfoUrl: get( config, - 'callAgencyInfo.callAgencyInfoLink', + `callAgencyInfo.${currentLanguage}.callAgencyInfoLink`, ), }} /> - + @@ -369,6 +371,7 @@ class ItineraryTab extends React.Component { const withRelay = createFragmentContainer( connectToStores(ItineraryTab, ['TimeStore'], context => ({ currentTime: context.getStore('TimeStore').getCurrentTime().unix(), + currentLanguage: context.getStore('PreferencesStore').getLanguage(), })), { plan: graphql` diff --git a/app/configurations/config.tampere.js b/app/configurations/config.tampere.js index 4ab4aebf28..c87c30d78f 100644 --- a/app/configurations/config.tampere.js +++ b/app/configurations/config.tampere.js @@ -81,8 +81,18 @@ export default configMerger(walttiConfig, { ticketLink: 'https://www.nysse.fi/liput-ja-hinnat.html', callAgencyInfo: { - callAgencyInfoLink: 'https://nysse.fi/nyssykka', - callAgencyInfoLinkText: 'nysse.fi/nyssykka', + fi: { + callAgencyInfoLink: 'https://nysse.fi/kutsuliikenne', + callAgencyInfoLinkText: 'https://nysse.fi/kutsuliikenne', + }, + sv: { + callAgencyInfoLink: 'https://nysse.fi/kutsuliikenne', + callAgencyInfoLinkText: 'https://nysse.fi/kutsuliikenne', + }, + en: { + callAgencyInfoLink: 'https://nysse.fi/drt', + callAgencyInfoLinkText: 'https://nysse.fi/drt', + }, }, // mapping fareId from OTP fare identifiers to human readable form diff --git a/app/translations.js b/app/translations.js index fe8a87bece..755c980cf8 100644 --- a/app/translations.js +++ b/app/translations.js @@ -1465,7 +1465,7 @@ const translations = { 'separate-ticket-required-disclaimer': 'This itinerary contains one or more legs for which {agencyName} does not sell tickets.', 'separate-ticket-required-for-call-agency-disclaimer': - 'Voit tarkistaa kutsuliikenteen maksutavat ja käytännöt ', + 'The journey includes demand responsive transport service. Please check the payment methods and practices on ', 'set-specific-settings': 'Set more specific settings', 'set-stop-as-routes': "Set the stop as route's", settings: 'Settings', @@ -2601,7 +2601,7 @@ const translations = { 'separate-ticket-required-disclaimer': 'Matka sisältää yhden tai useamman osuuden, jonka lippujen myynnistä {agencyName} ei vastaa.', 'separate-ticket-required-for-call-agency-disclaimer': - 'Voit tarkistaa kutsuliikenteen maksutavat ja käytännöt ', + 'Matka sisältää kutsuliikennettä. Voit tarkistaa maksutavat ja käytännöt ', 'set-specific-settings': 'Aseta tarkemmat asetukset', 'set-stop-as-routes': 'Aseta pysäkki reitin', settings: 'Asetukset', @@ -4521,7 +4521,7 @@ const translations = { 'separate-ticket-required-disclaimer': 'Resan består av en eller fleta etapper vilka kräver biljetter som inte säljs av {agencyName}.', 'separate-ticket-required-for-call-agency-disclaimer': - 'Voit tarkistaa kutsuliikenteen maksutavat ja käytännöt ', + 'I resan ingår anropsbusstrafiken. Bekanta dig med betalningsmetoder och praxis på ', 'set-specific-settings': 'Ställa avancerade inställningar', 'set-stop-as-routes': 'Ställa hållplats som rutter', settings: 'Anpassa', From a637d5860dfd7bc3f83872e039a134368dcd441e Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 25 Sep 2023 14:38:34 +0300 Subject: [PATCH 2/2] chore: dt-5890 translations --- app/component/ItineraryTab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/component/ItineraryTab.js b/app/component/ItineraryTab.js index cce4732b88..0d66d38114 100644 --- a/app/component/ItineraryTab.js +++ b/app/component/ItineraryTab.js @@ -67,7 +67,6 @@ const ItineraryShape = PropTypes.shape({ }), ), fares: PropTypes.arrayOf(FareShape), - currentLanguage: PropTypes.string.isRequired, }); /* eslint-disable prettier/prettier */ @@ -82,11 +81,12 @@ class ItineraryTab extends React.Component { isMobile: PropTypes.bool.isRequired, currentTime: PropTypes.number.isRequired, hideTitle: PropTypes.bool, - currentLanguage: PropTypes.string.isRequired, + currentLanguage: PropTypes.string, }; static defaultProps = { hideTitle: false, + currentLanguage: "fi" }; static contextTypes = {