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

Global replacements #24

Open
jancama2 opened this issue Dec 4, 2020 · 0 comments
Open

Global replacements #24

jancama2 opened this issue Dec 4, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jancama2
Copy link

jancama2 commented Dec 4, 2020

Say we have a translation in a sheet with interpolated values. We use the same sheet for web and mobile apps and it quite a lot of times ends up with having two rows with the same translation but different interpolation:

  • mobile - Máte nové zprávy v%sinboxu.
  • web - Máte nové zprávy v{nbsp}inboxu.

We could unify it if a sheet loading tool for each platform would replace some placeholder with platform specific strings. Something like:
Máte nové zprávy v inboxu.

Which would be be replaced based on a configuration for web in the lokse config

{
   replacements: { ' ': '{nbsp}' }
}

to: Máte nové zprávy v{nbsp}inboxu. which we can than use for react-intl interpolations.

Pros:

  • we can let a person translating the sheet to use commonly known things like   even though we can't use them straigt away in react-intl
  • we can have only one translation in the sheet for each message id and not two or more based on the platform needs
@jancama2 jancama2 added the enhancement New feature or request label Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant