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

Have the option of disabling parameter checking for a project #1488

Closed
jdimeo opened this issue Jan 6, 2023 · 4 comments
Closed

Have the option of disabling parameter checking for a project #1488

jdimeo opened this issue Jan 6, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@jdimeo
Copy link
Contributor

jdimeo commented Jan 6, 2023

... or improve it to recognize embedded language codes.

In our reference text, we have variables like ${foo} and it's awesome that Tolgee is aware of those and helps warn translators. However, in our case, we also have localized variables, so we do ${foo_es-ES} if the Spanish variable should be injected. Translators are now getting warned if they change from ${foo_es-ES} to ${foo_es-MX} as they should (because they changed the variable name.

The warnings they get now is confusing to them and they think they did something wrong.

Can we either:

  • Have a checkbox to disable this feature (as sad as that makes me, because it's an awesome feature)
  • Or somehow recognize that if one of the project language codes appears in it, confirm that it matches the language (this is probably too opinionated/specific though for the general platform)
@stepan662
Copy link
Contributor

Hey what syntax format are you using? I think the syntax highlighting in this case works basically "by accident". We highlight syntax for ICU message format which is using slightly different format for parameters ({parameter} without the dollar sign). So it works for you but the dollar sign is considered as a part of the translation. The error you see is because ICU doesn't allow - character in the parameter name.

We have a long term plan to support more formats than just ICU, but currently it's problematic. Easiest solution currently for us would be to add an checkbox to disable highlighting per project.

@jdimeo
Copy link
Contributor Author

jdimeo commented Jan 9, 2023

Ahh I see thanks @stepan662 . Yes, I'm using "dollar" syntax which is common to XLSForms (see https://xlsform.org/en/#relevant and where it says

Note the ${ } around the variable likes_pizza...

which is the same as Apache "string substitutor" syntax:
https://commons.apache.org/proper/commons-text/apidocs/org/apache/commons/text/StringSubstitutor.html

This allows my DSL end users to have a common way of injecting other text into the survey questions that are understood by many data collection platforms.

I had assumed the ICU syntax highlighting was "smart" and comparing the variable name across translations, didn't realize it was just the presence of - that was causing the error. In that case, yes, if we're not using ICU, it would be nice to have a checkbox. thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Mar 6, 2023
@JanCizmar JanCizmar added enhancement New feature or request and removed stale labels Mar 6, 2023
@stepan662
Copy link
Contributor

Continued in #1574

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

3 participants