From 666f5966d1790a2dbc892d12a82c43457ec0a159 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Tue, 2 Jan 2018 15:45:20 +0200 Subject: [PATCH] Use units instead of nights in var names and translation keys --- src/components/ListingCard/ListingCard.css | 2 +- src/components/ListingCard/ListingCard.js | 4 ++-- .../__snapshots__/ListingCard.test.js.snap | 2 +- .../ManageListingCard/ManageListingCard.css | 2 +- .../ManageListingCard/ManageListingCard.js | 4 ++-- .../__snapshots__/ManageListingCard.test.js.snap | 2 +- .../EditListingPricingForm/EditListingPricingForm.js | 4 ++-- .../EditListingPricingForm.test.js.snap | 2 +- src/containers/ListingPage/ListingPage.css | 4 ++-- src/containers/ListingPage/ListingPage.js | 8 ++++---- .../__snapshots__/ListingPage.test.js.snap | 4 ++-- src/translations/en.json | 12 ++++++------ 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/components/ListingCard/ListingCard.css b/src/components/ListingCard/ListingCard.css index cac38782..37c5c98d 100644 --- a/src/components/ListingCard/ListingCard.css +++ b/src/components/ListingCard/ListingCard.css @@ -71,7 +71,7 @@ } } -.perNight { +.perUnit { /* Font */ @apply --marketplaceTinyFontStyles; color: var(--matterColor); diff --git a/src/components/ListingCard/ListingCard.js b/src/components/ListingCard/ListingCard.js index ad60507c..5059085c 100644 --- a/src/components/ListingCard/ListingCard.js +++ b/src/components/ListingCard/ListingCard.js @@ -64,8 +64,8 @@ export const ListingCardComponent = props => {
{formattedPrice}
-
- +
+
diff --git a/src/components/ListingCard/__snapshots__/ListingCard.test.js.snap b/src/components/ListingCard/__snapshots__/ListingCard.test.js.snap index f8a975d4..528e4e31 100644 --- a/src/components/ListingCard/__snapshots__/ListingCard.test.js.snap +++ b/src/components/ListingCard/__snapshots__/ListingCard.test.js.snap @@ -44,7 +44,7 @@ exports[`ListingCard matches snapshot 1`] = `
diff --git a/src/components/ManageListingCard/ManageListingCard.css b/src/components/ManageListingCard/ManageListingCard.css index bd995400..bc7d8dfb 100644 --- a/src/components/ManageListingCard/ManageListingCard.css +++ b/src/components/ManageListingCard/ManageListingCard.css @@ -220,7 +220,7 @@ } } -.perNight { +.perUnit { /* Font */ @apply --marketplaceTinyFontStyles; color: var(--matterColor); diff --git a/src/components/ManageListingCard/ManageListingCard.js b/src/components/ManageListingCard/ManageListingCard.js index ce4c1105..b1ebf08d 100644 --- a/src/components/ManageListingCard/ManageListingCard.js +++ b/src/components/ManageListingCard/ManageListingCard.js @@ -219,8 +219,8 @@ export const ManageListingCardComponent = props => {
{formattedPrice}
-
- +
+
diff --git a/src/components/ManageListingCard/__snapshots__/ManageListingCard.test.js.snap b/src/components/ManageListingCard/__snapshots__/ManageListingCard.test.js.snap index 12610695..65ade4b4 100644 --- a/src/components/ManageListingCard/__snapshots__/ManageListingCard.test.js.snap +++ b/src/components/ManageListingCard/__snapshots__/ManageListingCard.test.js.snap @@ -110,7 +110,7 @@ exports[`ManageListingCard matches snapshot 1`] = `
diff --git a/src/containers/EditListingPricingForm/EditListingPricingForm.js b/src/containers/EditListingPricingForm/EditListingPricingForm.js index e61689a0..4c8c6611 100644 --- a/src/containers/EditListingPricingForm/EditListingPricingForm.js +++ b/src/containers/EditListingPricingForm/EditListingPricingForm.js @@ -25,7 +25,7 @@ export const EditListingPricingFormComponent = props => { updateInProgress, } = props; - const pricePerNightMessage = intl.formatMessage({ id: 'EditListingPricingForm.pricePerNight' }); + const pricePerUnitMessage = intl.formatMessage({ id: 'EditListingPricingForm.pricePerUnit' }); const priceRequiredMessage = intl.formatMessage({ id: 'EditListingPricingForm.priceRequired' }); const pricePlaceholderMessage = intl.formatMessage({ id: 'EditListingPricingForm.priceInputPlaceholder', @@ -50,7 +50,7 @@ export const EditListingPricingFormComponent = props => { className={css.priceInput} autoFocus name="price" - label={pricePerNightMessage} + label={pricePerUnitMessage} placeholder={pricePlaceholderMessage} currencyConfig={config.currencyConfig} validate={[required(priceRequiredMessage)]} diff --git a/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap b/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap index 0c56bfbf..e03bbbfb 100644 --- a/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap +++ b/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap @@ -13,7 +13,7 @@ exports[`EditListingPricingForm matches snapshot 1`] = ` {formattedPrice} -
- +
+
@@ -618,8 +618,8 @@ export class ListingPageComponent extends Component {
{formattedPrice}
-
- +
+
diff --git a/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap b/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap index 944e8d4d..42037d63 100644 --- a/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap +++ b/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap @@ -174,7 +174,7 @@ exports[`ListingPage matches snapshot 1`] = `
@@ -398,7 +398,7 @@ exports[`ListingPage matches snapshot 1`] = `
diff --git a/src/translations/en.json b/src/translations/en.json index 09e4501c..18dd9ead 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -39,8 +39,7 @@ "Avatar.bannedUserDisplayName": "Banned user", "BookingBreakdown.bookingPeriod": "{bookingStart} – {bookingEnd}", "BookingBreakdown.commission": "Saunatime fee", - "BookingBreakdown.nightCount": "{count, number} {count, plural, one {night} other {nights}}", - "BookingBreakdown.pricePerNight": "Price per night", + "BookingBreakdown.pricePerUnit": "Price per night", "BookingBreakdown.providerTotalCanceled": "Total price", "BookingBreakdown.providerTotalDeclined": "You would have made", "BookingBreakdown.providerTotalDefault": "You'll make", @@ -48,6 +47,7 @@ "BookingBreakdown.refund": "Refund", "BookingBreakdown.subTotal": "Subtotal", "BookingBreakdown.total": "Total price", + "BookingBreakdown.unitCount": "{count, number} {count, plural, one {night} other {nights}}", "BookingDatesForm.bookingEndTitle": "End date", "BookingDatesForm.bookingStartTitle": "Start date", "BookingDatesForm.listingCurrencyInvalid": "Oops, the currency of the listing doesn't match the currency of the marketplace.", @@ -143,7 +143,7 @@ "EditListingPhotosPanel.payoutModalTitlePayoutPreferences": "Payout preferences", "EditListingPhotosPanel.title": "Edit the photos of {listingTitle}", "EditListingPricingForm.priceInputPlaceholder": "Choose your price…", - "EditListingPricingForm.pricePerNight": "Price per night in euros", + "EditListingPricingForm.pricePerUnit": "Price per night in euros", "EditListingPricingForm.priceRequired": "You need to add a valid price.", "EditListingPricingForm.updateFailed": "Failed to update listing. Please try again.", "EditListingPricingPanel.createListingTitle": "How much does it cost?", @@ -234,7 +234,7 @@ "LandingPage.schemaDescription": "Book a sauna using Saunatime or earn some income by sharing your sauna", "LandingPage.schemaTitle": "Book saunas everywhere | {siteTitle}", "ListingCard.hostedBy": "Hosted by {authorName}.", - "ListingCard.perNight": "per night", + "ListingCard.perUnit": "per night", "ListingCard.unsupportedPrice": "({currency})", "ListingCard.unsupportedPriceTitle": "Unsupported currency ({currency})", "ListingPage.bannedUserDisplayName": "Banned user", @@ -260,7 +260,7 @@ "ListingPage.locationTitle": "Location", "ListingPage.ownClosedListing": "Your listing has been closed and can't be booked.", "ListingPage.ownListing": "This is your own listing.", - "ListingPage.perNight": "per night", + "ListingPage.perUnit": "per night", "ListingPage.reviewsError": "Loading reviews failed.", "ListingPage.reviewsHeading": "Reviews ({count})", "ListingPage.schemaTitle": "{title} - {price} | {siteTitle}", @@ -282,7 +282,7 @@ "ManageListingCard.closedListing": "This listing is closed and not visible on the marketplace.", "ManageListingCard.edit": "Edit", "ManageListingCard.openListing": "Open listing", - "ManageListingCard.perNight": "per night", + "ManageListingCard.perUnit": "per night", "ManageListingCard.unsupportedPrice": "({currency})", "ManageListingCard.unsupportedPriceTitle": "Unsupported currency ({currency})", "ManageListingCard.viewListing": "View listing",