Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Plurr preview for simple {FOO}-style placeholders #468

Closed
iafan opened this issue Apr 24, 2020 · 7 comments
Closed

Support Plurr preview for simple {FOO}-style placeholders #468

iafan opened this issue Apr 24, 2020 · 7 comments
Assignees

Comments

@iafan
Copy link
Contributor

iafan commented Apr 24, 2020

Right now we look for {FOO:<...>} style placeholders in the string to determine whether we need to show the live Plurr preview panel. However, we could expand that to any strings that contain simple placeholders like {FOO} as well, since these are also valid in Plurr (and Plurr can be used to render such strings even if they don't contain plurals or choices).

Example of such a string:

Screen Shot 2020-04-24 at 12 57 59

@benjamimo1 benjamimo1 self-assigned this May 4, 2020
@benjamimo1
Copy link

benjamimo1 commented May 4, 2020

Since this ticket is similar to the Emoji Highlight ticket I'll take a look
Relevant: https://github.com/loctools/plurr

Plurr: Cross-platform format specification + libraries for handling plurals/genders/conditionals for Go, Java, JS, Obj-C, Perl, PHP, Python

@benjamimo1
Copy link

benjamimo1 commented May 5, 2020

@iafan
Copy link
Contributor Author

iafan commented May 6, 2020

@benjamimo1 here you go: https://translate.evernote.com/ru/android_evernote/translate/strings.xml.po#unit=6140694

You can find such units in Zing by searching for _PLURAL.

@benjamimo1
Copy link

benjamimo1 commented May 6, 2020

Relevant paths:

/pootle/static/js/editor/components/plurr/PlurrPreview.js
/pootle/static/js/editor/components/plurr/PlurrEditor.js

@benjamimo1
Copy link

@iafan can you reference a code line where "Right now we look for {FOO:<...>} " happens?

benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 8, 2020
@benjamimo1
Copy link

benjamimo1 commented May 11, 2020

Current status tested both with one and multiple placeholders:
image

image

benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 11, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 14, 2020
Improved comments on regex

Got comments mixed up. Fixed
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 14, 2020
Improved comments on regex

Got comments mixed up. Fixed

Fix serge-community#458: make emojis work as placeables.

Fix serge-community#458: make emojis work as placeables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants