Giter VIP home page Giter VIP logo

text-provider's Introduction

text-provider

A component which provides all the string constants using provider pattern

Text provider is a library to place all the string constants of an application in a single place and use them inside the components in a memory friendly way.

It provides two components:

  1. TextProvider
  2. FormattedMessage

Install

npm i text-provider

Usage

  1. Import the string constants required for the particular presentational component:
const sampleText = require("src/nls/sample-text.json");
  1. Use the TextProvider to make it available for all the components:
<TextProvider globalText={sampleText} >
  <MyPresentationalComponent />
</TextProvider>
  1. Use it inside the presentational component:
<FormattedMessage id="Random Id"/>
const randomId = "Random Id";
const values = {
  "valueToBeInjected": "Random Value"
};

<FormattedMessage id={randomId} values={values}/>

Works like a format string also. Example JSON:

{
  "Random Id": "<b>Random Text Returns</b> {valueToBeInjected} for each text)"
}

Then ${valueToBeInjected} gets replaced with the value specified in values.

Make sure that a string by the same id exists in the JSON file.

text-provider's People

Contributors

hipstersmoothie avatar konoha-14 avatar madarauchiha-314 avatar nsinghal12 avatar rachanamamillapalli avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar skodamarthi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

text-provider's Issues

Upgrade to latest React 16.9.0

The current context API being used is from an older version of React when context was still experimental in react.

Look at this for the new implementation : https://reactjs.org/docs/context.html

Tasks :

  • Will have to decide whether this breaks backward compatibility. If yes, we will have to do a minor/major version release and then update the code accordingly.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm babel-eslint Available
npm eslint-loader Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency babel-eslint with @babel/eslint-parser 7.11.0
  • chore(deps): update commitlint monorepo to v8.3.6 (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency enzyme-adapter-react-16 to v1.15.8
  • chore(deps): update semantic-release monorepo (@semantic-release/git, @semantic-release/github, @semantic-release/npm, @semantic-release/release-notes-generator)
  • chore(deps): update dependency babel-loader to v8.3.0
  • chore(deps): update dependency eslint to v7.32.0
  • chore(deps): update dependency eslint-plugin-import to v2.29.1
  • chore(deps): update node.js to v12.22.7
  • fix(deps): update dependency prop-types to v15.8.1
  • fix(deps): update react monorepo to v16.14.0 (react, react-dom)
  • chore(deps): update dependency babel-loader to v9
  • chore(deps): update dependency css-loader to v7
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-airbnb to v19
  • chore(deps): update dependency html-loader to v5
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency jest to v29
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency pretty-quick to v4
  • chore(deps): update dependency webpack-cli to v5
  • chore(deps): update dependency webpack-dev-server to v5
  • chore(deps): update node.js to v17
  • chore(deps): update semantic-release monorepo (major) (@semantic-release/changelog, @semantic-release/commit-analyzer, @semantic-release/git, @semantic-release/github, @semantic-release/npm, @semantic-release/release-notes-generator)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • circleci/node 12.18.4
  • circleci/node 12.18.4
npm
package.json
  • prop-types ^15.7.2
  • react ^16.13.1
  • react-dom ^16.13.1
  • @babel/core 7.11.6
  • @babel/preset-env 7.11.5
  • @babel/preset-react 7.10.4
  • @commitlint/cli 8.3.5
  • @commitlint/config-conventional 8.3.4
  • @semantic-release/changelog ^5.0.1
  • @semantic-release/commit-analyzer ^8.0.1
  • @semantic-release/git ^9.0.0
  • @semantic-release/github ^7.1.1
  • @semantic-release/npm ^7.0.6
  • @semantic-release/release-notes-generator ^9.0.1
  • babel-eslint 10.1.0
  • babel-loader 8.1.0
  • css-loader 3.6.0
  • enzyme ^3.11.0
  • enzyme-adapter-react-16 ^1.15.5
  • eslint 7.5.0
  • eslint-config-airbnb 18.2.0
  • eslint-loader 4.0.2
  • eslint-plugin-import 2.22.1
  • eslint-plugin-jsx-a11y 6.3.1
  • eslint-plugin-react 7.20.3
  • file-loader 6.1.0
  • html-loader 1.1.0
  • husky 4.2.5
  • jest ^26.4.2
  • prettier 2.1.2
  • pretty-quick 2.0.1
  • semantic-release ^17.1.2
  • react-test-renderer 17.0.2
  • webpack 4.44.1
  • webpack-cli 3.3.12
  • webpack-dev-server 3.11.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.