Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:40
    ccamusso edited #746
  • 05:40
    ccamusso edited #746
  • Sep 30 20:51
    tricoder42 synchronize #344
  • Sep 30 20:33
    tricoder42 edited #334
  • Sep 30 19:42
    tricoder42 edited #746
  • Sep 30 19:13
    tricoder42 labeled #743
  • Sep 30 19:13
    tricoder42 labeled #743
  • Sep 30 19:13
    tricoder42 labeled #743
  • Sep 30 19:13
    tricoder42 labeled #743
  • Sep 30 19:13
    tricoder42 labeled #743
  • Sep 30 18:59
    tricoder42 labeled #746
  • Sep 30 18:59
    tricoder42 labeled #746
  • Sep 30 18:59
    tricoder42 labeled #746
  • Sep 30 18:59
    tricoder42 labeled #746
  • Sep 30 18:59
    tricoder42 labeled #746
  • Sep 28 09:07
    ccamusso opened #746
  • Sep 27 13:57
    mediaxtend opened #745
  • Sep 27 10:31
    landsman closed #544
  • Sep 25 18:43
    nathanforce opened #744
  • Sep 25 18:41
    nathanforce opened #743
Daniel K.
@FredyC
sadly, I am not aware a good solution, it's bit unfortunate that Trans is exported from both packages and has different functionality
Alexander Wallace
@telpochyaotl
i'm glad it's working now, i really like lingui but was having lots of confusion
Alexander Wallace
@telpochyaotl
thanks a lot for all your help @FredyC !
Alexander Wallace
@telpochyaotl
Hello all! ... I'm doing a bit of research to see if this is possible out of the box, or even if we need to write some extension: That we can select a strange locale-country combo, I'm pretty sure for what i've seen it can be done for the translations, but will it have any effect on macros such as date? For example, say that i choose en-FR will <Trans> Some date in french format {date(theDate)}</Trans> translate with a date format as used in france? what about numbers? Thanks in advance!
Daniel K.
@FredyC
date isn't macro anymore :)
Alexander Wallace
@telpochyaotl
nice, so we can just pull the country name and do what we need whichever way we want...
cool... thanks!
Alexander Wallace
@telpochyaotl
@FredyC , does that mean this is not accurate? NumberFormat and DateFormat components were removed. Use date and number formats from @lingui/core package instead. from https://js-lingui-git-next.lingui-js.now.sh/releases/migration-3.html
Daniel K.
@FredyC
that is accurate, as I said, there is no macro for these, just functions in the core
Alexander Wallace
@telpochyaotl
ok, i can look at them... thanks!
Tanner Stirrat
@tstirrat15

hey all. question on the Trans macro: I'd assume that using ids is preferable, because then the reference in the .po file is stable even if the contents of a particular Trans component change. However, when I try and use the id prop, I no longer have the default in the .po file:

#. The headline to the website
#: src/homepage/components/panels/Hero/index.js:26
msgid "hero.headline"
msgstr ""

#. Tells the user how many things we have in inventory and where those things are
#: src/homepage/components/panels/Hero/index.js:37
msgid "hero.subtitle"
msgstr ""

It seems like that makes a translator's life more difficult, since they no longer have access to the default. There's this bit in the docs, which seems to indicate that if you provide an id, it should make the body into defaults, which I assume should show up in the .po file. Is that incorrect? If so, why? I'm just wading into i18n, so there are gaps in my knowledge.

Tanner Stirrat
@tstirrat15
Ah hmm... it looks like the id in a .po file is supposed to be the untranslated string, where I thought it was just a reference. Makes some sense.
Zsolt Szabo
@zsolt-dev
hi, anyone tried to use webtranslateit.com as the translation tool? which file format to chose from that will support multiple plurals? Thank you
I have also created question here:
can I use i18next json v3?
Zsolt Szabo
@zsolt-dev
Or maybe a better question... can I use lingui without cli? So I will just get the segments from webtranslateit or other service and use these even in development, not just in production?
טוני פאול
@tfall65_gitlab
Hi, I really like Lingui and have successfully set it up in my REACT web app. But I am having trouble doing the same in my REACT NATIVE app. I followed the instructions and set it up with Lingui version 2.2 (instead of version 2.9). Using the <TRANS> tag works and is rendered with the translation as expected. But when I try and use the <I18n> tag this error is thrown:
image.png
I have tried everything I can think of, and even tried updating to the latest version of Lingui and installing the https://github.com/react-native-community/jsc-android-buildscripts
טוני פאול
@tfall65_gitlab
But I still get the same error. So what is the correct method of using Lingui in REACT NATIVE? (Is it supported by Lingui 3.0?)
Daniel K.
@FredyC
@tfall65_gitlab Do you have correctly setup babel-plugin-macros? Also are you importing Trans from @lingui/macro?
טוני פאול
@tfall65_gitlab
I solved the problem. It turned out that I had React Native CLI installed globally . It is very clearly noted in the documentation that a global installation of RN CLI will cause problems, I just did not know that I had it installed globally. As soon as I uninstalled everything worked great!
Gerard de Brieder
@smeevil
Hi all, I'm trying to get Lingui working in a new project again, but keep running into @lingui/macro: Cannot read property 'attributes' of undefined using 3.0.0-13 and typescript 3.8.3. Does anyone have a clue on what might be wrong ?
Doris Tam
@dory2380_gitlab
hi there, I'm trying to write a test using i18n. I have my config file set up, but I am not sure how to mock the i18n prop that goes into I18nProvider. Any idea?
Doris Tam
@dory2380_gitlab
nevermind, I fixed it :)
Doris Tam
@dory2380_gitlab
I'm having trouble with my piplines as it can't fine the messages.js
In the documentation, it says to put those files into gitignore, what would be the right way to go around this?
טוני פאול
@tfall65_gitlab
image.png
טוני פאול
@tfall65_gitlab
Hi there, it appears that the documentation here is incorrect/out of date:
https://lingui.js.org/tutorials/react-native.html
There is no need to install the "JSC build scripts for Android" or find any workaround mentioned in the note (pasted above). I just created a new React-Native app using init and then installed Lingui v2.91 and it all works, including <I18n> tags and the "t" format. In fact it installs/works exactly the same as in a React web app. So there is no real need for the entire section of React Native in the Lingui docs. They are actually confusing because they are missing several parts that you need to get it working (which are explained in the regular React section).
Or am i missing something?
Calvin Iyer
@calvin-iyer
Hi, I am trying to implement translations for right-to-left languages, is there any option in lingui which would simplify this or would I need to change my templates to support this?
ExoMemphiz
@ExoMemphiz

Hi,

I am running a React Native app with Typescript and am trying to use the library with @lingui/react, and want to extract messages:

i18n._(`units`);

But getting:

Missing message ID, skipping.
i18n._(`units`)

For all of the strings like that

babel config:
module.exports = {
    presets: [
        "module:metro-react-native-babel-preset",
        [
            "@babel/preset-env",
            {
                targets: {
                    node: "current",
                },
            },
        ],
        "@babel/preset-react",
        "@lingui/babel-preset-react",
        "@babel/preset-typescript",
    ],
    plugins: ["macros"],
};
Tomáš Ehrlich
@tricoder42
Hey @ExoMemphiz , what if you change backticks to double quotes?
i18n._("units")
ExoMemphiz
@ExoMemphiz
Yes, thank you, that seemed to fix it. A shame that templated strings don't work
Tomáš Ehrlich
@tricoder42
Feel free to send a PR with a fix :thumbsup:
Dávid Horov
@anticol
Hey @tricoder42, would be possible to add functionality to do not print line numbers (or file names) during lingui extract in .po files?
nive
@NivedhithaV
Hello 👋🏽I'm using lingui 2.x and trying to mock I18n._ in jest. Any pointers? I am using react-testing-library, if that makes a difference.
Daniel K.
@FredyC
@NivedhithaV Why do you mock in a first place?
nive
@NivedhithaV
@FredyC Good question. I had to use i18n._(t``) and see Error: Uncaught [TypeError: Cannot read property '_' of undefined] when I run tests. I didn't see any errors when I used the Trans tag though. I was hoping mocking I18n would fix that. Open to other suggestions as well.
Saravanan Ramupillai
@saravanan10393
I need one your input, is there any way to stop the lingui cli to follow on symlinks.
because it parse through the symlinks , and it do it recurely, and fails
Daniel K.
@FredyC
@saravanan10393 no way besides you sending in PR to fix it :)
Michal Landsman
@landsman
Hi guys, was there question / documentation about comments in localization files?
lingui/js-lingui#720
1 reply
Alexander Wallace
@telpochyaotl
Hello! I’m a bit confused with how locale and locales is dealt with, for example in i18n.activate("en", ["en-UK", "ar-AS”]) … how do the catalogs look of this?
on one hand I’m thinking i can name my catalogs like ‘en-US’, ‘es-MX’, etc. …. and then just do i18n.activate(“en-US”) and so on, but what am I missing if I do that? where is the specialization of having en-UK or ar-AS in the above example go?
all the examples I see deal with only language, but no country
Alexander Wallace
@telpochyaotl
seems that locales is only used for formating dates and numbers, seems I can name my catalogs ‘en-US’ and so on and use the same name for locales for example
Alexander Wallace
@telpochyaotl
Where did the number and date macros end up? they are not exported as documented from macros