lbry-desktop/ui
infiinte-persistence 567316cfbe Support for multiple string context + "About" as initial example.
## Issue
4796 - i18n: Allow support for string overloading (multiple contexts)

## Approach
- Minimal code and process change.
- Handle on a case-by-case basis when reported by translators.
- Split the affected key in the string json by appending the context.
- Translators need to be aware of the new format and not translate context itself. Code is added to detect bad translations and will revert to English.

Sample in json:
  "About --[About section in Help Page]--": "About",
  "About --[tab title in Channel Page]--":  "About",

Sample in client code:
  title={__('About --[About section in Help Page]--')}

- "--[ ]--" was chosen as it's unique enough (unlikely for real strings to use it) and hopefully not that distracting in the client code.
- In the key itself, spaces are allowed after the string (i.e. before '--[') for neatness. It will be trimmed by the system.

## First example
"About" is used in 3 places:
   - Channel Page
   - Help Page
   - Footer (in Odysee branch)

For Russian, the word "About" is "O" and is usually not used standalone, but requires something behind it. A translator said so, and seems to be the case in other sites as well.
   "O xxx"
   "O yyy"

## Other languages
For other languages that are not impacted, they can just clone the same translation for each of the split keys, just like in English.

## Possible enhancement in Transifex
I see that Transifex's API includes a `context` entry. It might be possible to move the context-metadata there during the upload, so translators will never see the "--[]--" messiness (it will be shown as "Context: xxx" in the Transifex GUI).

I'm not sure how to test the Transifex side, so I did not investigate further.
2020-10-14 17:44:44 -04:00
..
component add new sort icons for new/best/controversial 2020-10-14 16:51:48 -04:00
constants add new sort icons for new/best/controversial 2020-10-14 16:51:48 -04:00
effects new layout 🕺 2020-09-29 17:12:32 -04:00
modal Rebranding: 'Publish' --> 'Upload'; Use LBC icon 2020-10-02 10:25:17 -04:00
page Support for multiple string context + "About" as initial example. 2020-10-14 17:44:44 -04:00
redux catch claim error on referrer set 2020-10-08 10:52:44 -04:00
scss add spacing for ul/ol next to p elements 2020-10-14 11:33:39 -04:00
util pass to 2020-10-13 15:31:07 -04:00
analytics.js Revert "Revert "add logging of player point of presence"" 2020-09-09 14:55:16 -04:00
app.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
i18n.js Support for multiple string context + "About" as initial example. 2020-10-14 17:44:44 -04:00
index.jsx new layout 🕺 2020-09-29 17:12:32 -04:00
logWarningConsoleMessage.js new lbc icon 2020-09-29 17:12:32 -04:00
native.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
reducers.js add file reactions code from odysee 2020-10-02 15:28:00 -04:00
rewards.js new lbc icon 2020-09-29 17:12:32 -04:00
store.js add yotube sync to initial sign up flow 2020-09-29 17:12:32 -04:00