GithubHelp home page GithubHelp logo

chef-chungus / pancake-swap-interface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pancakeswap/pancake-swap-interface-v1

2.0 1.0 2.0 14.3 MB

Home Page: https://pancake-swap-interface.vercel.app

License: GNU General Public License v3.0

TypeScript 99.12% JavaScript 0.48% HTML 0.40%

pancake-swap-interface's Introduction

pancakeswap

Intro

PancakeSwap is an automated market maker (โ€œAMMโ€) that allows two tokens to be exchanged on the Binance Smart Chain (BSC). It is fast, cheap, and allows anyone to participate.

This repo is responsible for the exchange/pool interfaace of the AMM: exchange.pancakeswap.finance

Run locally

Install packages

yarn

Start application

yarn start

Change BSC network

To change the BSC network from test net, modify the REACT_APP_CHAIN_ID value in .env.

  • MAIN NET 56
  • TEST NET 97

Run integration tets

Firstly, if you need to install cypress

yarn cypress install

Then to run the Cypress suite in CLI

yarn cypress run

Or, to run Cypress with its GUI

yarn cypress open

Localisation

In order for the Crowdin API queries to work - you will need REACT_APP_CROWDIN_APIKEY & REACT_APP_CROWDIN_PROJECTID env variables set in your root .env.development.local file - please contact a dev if you need these.

Adding translations

There are two methods for adding translations, both are valid, and it depends on the context in which you are trying to implement the translation as to which you should use.

1. Using TranslateString within translateTextHelpers

If you need to translate a string that exists within another string, i.e:

<span>I need to translate this bit of the span. I don't need to translate this second sentence.</span>

Or, a string that is being passed into a component as props, i.e.:

<Component label="This text need translated" />

Then you should make use of the TranslateString method within translateTextHelpers.

It takes in the translationId (found in Crowdin) as the first argument, and a string of fallback text as the second argument, which is rendered if the translation isn't found,

import { TranslateString } from '../translateTextHelpers'
;<StyledLink>๐Ÿฏ {TranslateString(282, 'SYRUP Pool')}</StyledLink>
import { TranslateString } from '../translateTextHelpers'
;<Button text={`๐Ÿ”“ ${TranslateString(292, 'Unlock Wallet')}`} />

2. Using TranslatedText component

This is a simple abstraction of the TranslateString method, wrapping it within a React Component - this can be a visually simpler pattern, if you are wanting to translate standalone piece of text.

It takes in a translationId prop and whatever is passed as {children} is used for the fallback, i.e.:

<StyledLink to="/farms">
    <TranslatedText translationId={278}>Farm</TranslatedText>
</StyledLink>
<StyledLink to="/staking">
    <TranslatedText translationId={280}>Staking</TranslatedText>
</StyledLink>

Variables

The translation component can handle variables being passed in from Crowdin, with no code changes.

It will only work if there is only one variable passed in, and if that variable within Crowdin is wrapped in % signs, i.e.:

Translation in crowdin: %asset% Earned link

Code:

<Label text={TranslateString(330, 'CAKE Earned')} />

pancake-swap-interface's People

Contributors

artistic709 avatar brianmcmichael avatar callil avatar chef-chungus avatar chefhopper avatar chikeichan avatar christophsiegenthaler avatar cryptocatvc avatar dependabot[bot] avatar dy avatar fryworld-finance avatar hacktar avatar hav-noms avatar haydenadams avatar ianlapham avatar kennyt avatar micahzoltu avatar mikedemarais avatar mirshko avatar moodysalem avatar mooncakehero avatar noahzinsmeister avatar pancake-cat avatar pancake-swap avatar paulrberg avatar rabbitdoge avatar richardpk avatar tpmccallum avatar vikmeup avatar wjmelements avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.