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

Text fragmentation makes translations harder/impossible #15

Open
JoKeyser opened this issue May 31, 2023 · 4 comments
Open

Text fragmentation makes translations harder/impossible #15

JoKeyser opened this issue May 31, 2023 · 4 comments
Assignees

Comments

@JoKeyser
Copy link
Member

JoKeyser commented May 31, 2023

First of all, thank you for adding power analyses to JASP, this is super exciting!

During my first translations into German, I notice that some strings are relatively fragmented, and then put back together in code (example below).
I understand that this may make sense to reduce code and typing for the English language, but unfortunately, it makes translation harder, and probably even impossible at times:

  • Translators often cannot know what strings are put together, unless they read and understand the code. On Weblate (and probably other tools), it's not possible to clarify this kind of context.
  • The grammar rules of languages are too different to generally make this kind of text manipulation possible in code.
    It's better to write out the entire sentence, because any word or concept may end up in a totally different position; but in the code, it's always pasted into a fixed position.

Here is one example, from file pwr_ttestis.R#L831.
Note how the string is fragmented into two pieces.
I hope it becomes clearer what I mean?

n_text <- ifelse(n1 == n2,
    gettextf("a sample size of %1$s in each group", n1),
    gettextf("group sample sizes of %1$s and %2$s, respectively", n1, n2)
  )

# ... some other code ...

gettextf(
   "Both assume %1$s.",
    n_text
),

Again, thank you for the great work.

Edit: Of course this fragmentation also happens in other parts of JASP (and I plan to point that out in the future), but since this is a new module, and the fragmentation feels a bit more common here, I think this is would be the right place and time to correct this hurdle.

@JoKeyser JoKeyser changed the title Make translations easier by less text fragmentation Text fragmentation to makes translations harder/impossible May 31, 2023
@EJWagenmakers
Copy link

Good point! Can this be changed somehow, @jansim? I think it would be good to indicate this in a JASP style file for contributing programmers, @vandenman

@vandenman
Copy link
Contributor

Actually, we already have this in the guide here. But we have multiple guides, and there is a lot of material in there. We should probably review them and see how we can make things easier for new (and old) contributors.

@JoKeyser please feel free to create issues for this whenever you encounter them. In my opinion, untranslatable strings are basically bugs.

@vandenman vandenman self-assigned this Jun 1, 2023
@JoKeyser JoKeyser changed the title Text fragmentation to makes translations harder/impossible Text fragmentation makes translations harder/impossible Jun 1, 2023
@JoKeyser
Copy link
Member Author

JoKeyser commented Jun 1, 2023

Ok thank you both for understanding and this general issue and for taking translation so seriously.

Not sure about the scope of this issue; pointing out every single occurrence of fragmented strings may be too tedious? (But it could be done...) For this module, maybe this one is sufficient for now?

And regarding other modules, it's probably best to open an issue in the general issues and scoping it for the module, so the module maintainers can be assigned and deal with it?

@vandenman
Copy link
Contributor

For this module, maybe this one is sufficient for now?

Yes, I'll go over every gettext and gettextf and make changes as I deem fit.

it's probably best to open an issue in the general issues and scoping it for the module, so the module maintainers can be assigned and deal with it?

Yes, one issue per module should be fine.

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

3 participants