Message in I18nMessage not translated correctly #4173

Closed
opened 2020-05-11 11:26:04 +02:00 by infinite-persistence · 2 comments
infinite-persistence commented 2020-05-11 11:26:04 +02:00 (Migrated from github.com)

In the error message below, it appears in English, but the embedded link was translated.

partial

The string is part of app-string.json and has been translated. But since it was used in a I18nMessage, I'm guessing the string substitution doesn't work there?

    <I18nMessage
      tokens={{
        refreshing_the_app_link: (
          <Button
            button="link"
            className="load-screen__button"
            label={__('refreshing the app')}
            onClick={this.refresh}
          />
        ),
      }}
    >
      There was an error. Try %refreshing_the_app_link% to fix it. If that doesn't work, try pressing
      Ctrl+R/Cmd+R.
    </I18nMessage>

I then tried encapsulating the string with {__(' ')} and it seems to load the translated text, but it ends up adding the translated string into app-string.json in my workspace at runtime. I'm not really sure what's going on, so I'll just submit this first. I'll be willing to help if you can give me pointers.


yarn dev
commit: 7596fd64 (master)
In the error message below, it appears in English, but the embedded link was translated. ![partial](https://user-images.githubusercontent.com/64950861/81545497-8f3c3600-93ab-11ea-95ce-7174b9e110f2.png) The string is part of `app-string.json` and has been translated. But since it was used in a `I18nMessage`, I'm guessing the string substitution doesn't work there? ``` <I18nMessage tokens={{ refreshing_the_app_link: ( <Button button="link" className="load-screen__button" label={__('refreshing the app')} onClick={this.refresh} /> ), }} > There was an error. Try %refreshing_the_app_link% to fix it. If that doesn't work, try pressing Ctrl+R/Cmd+R. </I18nMessage> ``` I then tried encapsulating the string with `{__(' ')}` and it seems to load the translated text, but it ends up adding the translated string into `app-string.json` in my workspace at runtime. I'm not really sure what's going on, so I'll just submit this first. I'll be willing to help if you can give me pointers. --- ``` yarn dev commit: 7596fd64 (master) ```
tzarebczan commented 2020-05-11 15:15:18 +02:00 (Migrated from github.com)

Thanks for spotting and opening the issue! Maybe @seanyesmunt can point you in the right direction.

Thanks for spotting and opening the issue! Maybe @seanyesmunt can point you in the right direction.
infinite-persistence commented 2020-05-25 00:16:57 +02:00 (Migrated from github.com)

I think I found the culprit. PR coming up...

I think I found the culprit. PR coming up...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#4173
No description provided.