Giter Club home page Giter Club logo

react-gettext's People

Contributors

eugene-manuilov avatar rtalvarez avatar shirazz avatar

Stargazers

 avatar  avatar  avatar  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

react-gettext's Issues

Get wrapped component

While using withGettext method in order to internationalize the component, this librairy hide the concerning component from react application.
I don't find any way to get this component (eg. to use refs and method hosted inside).

Have you a suggestion or can you confirm that is currently not possible ?

Example in README is non-i18n

Line 237:

this.context.ngettext('day ago', 'days ago', numberOfDays);

This is a bad example of i18n string because in Hebrew (and in several other languages) we don't use the same word order so unless there's a placeholder in there I can't translate it so that Hebrew native speaker will understand.

A better approach would be (assuming I'm not messing up the parameters):

this.context.ngettext('{numberOfDays} day ago', '{numberOfDays} days ago', numberOfDays);

Another solution can be changing the example :)

Support hoist-non-react-statics ^2.2.2

After upgrading npm packages we got:

npm install
npm WARN [email protected] requires a peer of hoist-non-react-statics@^1.2.0 but none was installed.

"hoist-non-react-statics": "^2.2.2", is recent

Could react-gettext support that recent version?

Typescript support

Hi,
could you maybe provide a typescript declaration file (react-gettext.d.ts)?
Would be nice to use your project in typescript projects!

ngettext problem

Is it possible to translate something like this:

ngettext('only {{ count }} night', 'only {{ count }} nights', 3)

As I see right now - there is no way to do it...

How to access context/state inside getTranslations() function

I followed the guide and everything works but I am still confused how can I implement multi-lingual react application.

The docs say, getTranslations() function should returns hash object where keys are original messages and values are translated messages but what should be the structure of this hash object when you have to distinguish between multiple locales (how to access locales in the function which are stored inside the state) and different contexts?

Thanks.

Get text extract

@eugene-manuilov It would be nice if you can document details about extracting strings and creating the .pot file. If you can just provide an overview, i can contribute the rest.

generation mo file

Hi, i have problem with generation mo file. When i add new localization (By poedit) and save it, mo file contain something like this

PO-Revision-Date: 2019-01-17 20:19+0300
Language-Team: 
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Generator: Poedit 2.0.6
X-Poedit-Basepath: ../../src
Plural-Forms: nplurals=2; plural=(n != 1);
X-Poedit-KeywordsList: gettext;ngettext:1,2;xgettext:1,2c;nxgettext:1,2,4c
X-Poedit-SourceCharset: UTF-8
Last-Translator: 
Language: en
X-Poedit-SearchPath-0: components
 username 

But in your project mo.json files contain payload in json format. How can i change save format in poedit (or another editor)?

Change Translations While On Demand

Great little library! One thing I'm not seeing is the ability to change the application translation after initialization. Just want to confirm I'm not missing this.

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.