Commit graph

8 commits

Author SHA1 Message Date
Sean Yesmunt cc568fb8cf working 2020-12-16 10:52:22 -05:00
Sean Yesmunt 0cc3af28a3 flow fixes 2020-12-16 10:52:22 -05:00
Sean Yesmunt 41dfd8a0f8 return early for undefined i18n messages
could happen when we map over a list of objects to create buttons and one only has an icon
2020-10-19 23:54:32 -04:00
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
infiinte-persistence 7feb123a45 Improve auto string addition to produce better diffs and ease merging.
## Issue
- The diff for new strings are polluted by the need to add a comma to the previous entry.
- Having to re-add the newline at the end of file before commiting is a repetitive pain.

## Caveats to this approach
- When manually adding strings, developers need to put it above the `--end--` entry. Hopefully it is obvious without having to put verbose comments like "^--- add new string before this line ---^"
- Translators will surely ask how to translate "--end--".
2020-07-08 15:01:05 -04:00
jessop 33672a789b app plays embed in iframe
make player full screen and prepared for overlay actions

small changes

cleanup
2020-01-28 10:20:54 -05:00
jessop c9fd7f032c fix i18n messages when token is 0 2019-12-17 10:33:21 -05:00
Sean Yesmunt 6ad31a3ce9 refactor lbrytv web server 2019-11-11 13:27:29 -05:00
Renamed from src/ui/i18n.js (Browse further)