How to use the fbt-runtime.fbt function in fbt-runtime

To help you get started, we’ve selected a few fbt-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OriginProtocol / origin / dapps / marketplace / src / pages / user / _EditModal.js View on Github external
render() {
    const isMobile = this.props.isMobile

    const ModalComp = isMobile ? MobileModal : Modal

    const titleContent = fbt('Edit Profile', 'EditModal.editProfile')

    return (
      // Using css hide Edit Profile dialog when image cropper is opened
       this.props.onClose()}
        shouldClose={this.state.shouldClose}
        classNameOuter={this.state.imageCropperOpened ? 'd-none' : ''}
        lightMode={this.props.lightMode}
      >
         {
            this.setState({
              imageCropperOpened: open
            })
          }}
github OriginProtocol / origin / dapps / marketplace / src / pages / user / Profile.js View on Github external
showDeploySuccessMessage(type) {
    let message

    if ('profile' === type) {
      // Not one of attestation changes
      message = fbt('Profile updated', 'profile.profileUpdated')
    } else {
      message = fbt(
        fbt.param('provider', getProviderDisplayName(type)) + ' updated',
        'profile.attestationUpdated'
      )
    }

    this.handleShowNotification(message, 'blue')
  }
github OriginProtocol / origin / dapps / marketplace / src / pages / user / Profile.js View on Github external
showDeploySuccessMessage(type) {
    let message

    if ('profile' === type) {
      // Not one of attestation changes
      message = fbt('Profile updated', 'profile.profileUpdated')
    } else {
      message = fbt(
        fbt.param('provider', getProviderDisplayName(type)) + ' updated',
        'profile.attestationUpdated'
      )
    }

    this.handleShowNotification(message, 'blue')
  }
github OriginProtocol / origin / dapps / marketplace / src / pages / create-listing / listing-types / FractionalHourlyListing / Details.js View on Github external
)
    } else if (this.state.title.length > 100) {
      // Limit from origin-validator/src/schemas/listing.json
      newState.titleError = fbt(
        'Title is too long',
        'create.error.Title is too long'
      )
    }

    if (!this.state.description) {
      newState.descriptionError = fbt(
        'Description is required',
        'create.error.Description is required'
      )
    } else if (this.state.description.length < 10) {
      newState.descriptionError = fbt(
        'Description is too short',
        'create.error.Description is too short'
      )
    } else if (this.state.description.length > 1024) {
      // Limit from origin-validator/src/schemas/listing.json
      newState.descriptionError = fbt(
        'Description is too long',
        'create.error.Description is too long'
      )
    }

    if (!this.state.timeZone) {
      newState.timeZoneError = fbt(
        'Time Zone is required',
        'Time Zone is required'
      )
github OriginProtocol / origin / dapps / marketplace / src / pages / create-listing / listing-types / GiftCardListing / Details.js View on Github external
validate() {
    const newState = {}

    if (!this.state.description) {
      newState.descriptionError = fbt(
        'Description is required',
        'create.error.Description is required'
      )
    } else if (this.state.description.length < 10) {
      newState.descriptionError = fbt(
        'Description is too short',
        'create.error.Description is too short'
      )
    } else if (this.state.description.length > 1024) {
      // Limit from origin-validator/src/schemas/listing.json
      newState.descriptionError = fbt(
        'Description is too long',
        'create.error.Description is too long'
      )
    }

    if (!this.state.retailer) {
      newState.retailerError = fbt(
        'Please select a card retailer',
        'create.listing.giftcard.select-retailer'
      )
github OriginProtocol / origin / dapps / marketplace / src / pages / growth / Promotions.js View on Github external
const getToastMessage = (action, decimalDivision) => {
  const tokensEarned = formatTokens(action.reward.amount, decimalDivision)
  return fbt(
    `You earned ` + fbt.param('amount', tokensEarned) + ' OGN',
    'GrowthPromotions.tokensEarned'
  )
}
github OriginProtocol / origin / dapps / marketplace / src / pages / growth / FollowOrigin.js View on Github external
const getToastMessage = (action, decimalDivision) => {
  const tokensEarned = formatTokens(action.reward.amount, decimalDivision)
  return fbt(
    `You earned ` + fbt.param('amount', tokensEarned) + ' OGN',
    'GrowthFollowOrigin.tokensEarned'
  )
}
github OriginProtocol / origin / dapps / marketplace / src / components / MobileUserActivation.js View on Github external
constructor(props) {
    super(props)
    this.state = {
      stage: 'AddEmail',
      modal: true,
      shouldClose: false,
      title: fbt('Create a profile', 'MobileUserActivation.createProfile')
    }

    this.portal = document.createElement('div')
  }
github OriginProtocol / origin / dapps / marketplace / src / pages / growth / Invite.js View on Github external
handleTwitterShareClick() {
    let text = fbt(
      'Join me on Origin and earn Origin cryptocurrency tokens (OGN). Origin is a new marketplace to buy and sell with other users. Earn Origin tokens when you create your profile, invite your friends, and buy and sell on the marketplace.',
      'RewardInvite.twitterInvite'
    )
    text += ' ' + this.getInviteCode()
    window.open(
      `https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}`
    )
  }
github OriginProtocol / origin / dapps / marketplace / src / pages / growth / WithEnrolmentModal.js View on Github external
)

      this.initialStage =
        props.skipjoincampaign === 'false'
          ? 'JoinActiveCampaign'
          : 'TermsAndEligibilityCheck'
      this.countryCode = undefined
      this.state = {
        open: props.startopen === 'true',
        stage: this.initialStage,
        notCitizenChecked: false,
        notCitizenConfirmed: false,
        termsAccepted: false,
        enableSignupButton: false,
        userAlreadyEnrolled: false,
        modalTitle: fbt('Origin Rewards', 'WithEnrolmentModal.OriginRewards')
      }
    }

fbt-runtime

The fbt i18n framework JS runtime.

MIT
Latest version published 6 years ago

Package Health Score

53 / 100
Full package analysis

Popular fbt-runtime functions