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

Some strings consisting of variable names probably shouldn't be translated #6507

Closed
27 tasks done
aitap opened this issue Sep 18, 2024 · 3 comments · Fixed by #6539
Closed
27 tasks done

Some strings consisting of variable names probably shouldn't be translated #6507

aitap opened this issue Sep 18, 2024 · 3 comments · Fixed by #6539
Labels
translation issues/PRs related to message translation projects

Comments

@aitap
Copy link
Contributor

aitap commented Sep 18, 2024

There's quite a lot of debugging printout that consists of argument/variable names that (arguably) should not be translated:

  • DTPRINT(_(" NAstrings = ["));
  • DTPRINT(_("]\n"));
  • DTPRINT(_(" =====\n"));

    DTPRINT(_(" =====\n"));
  • DTPRINT(_("%10d : %-9s '%c'\n"), typeCounts[i], typeName[i], typeLetter[i]);
  • DTPRINT(_("=============================\n"));
  • if (verbose) Rprintf(_("RHS_list_of_columns == %s\n"), RHS_list_of_columns ? "true" : "false");
  • if (iN && it!=xt) error(_("typeof x.%s (%s) != typeof i.%s (%s)"), CHAR(STRING_ELT(getAttrib(xdt,R_NamesSymbol),xcols[col]-1)), type2char(xt), CHAR(STRING_ELT(getAttrib(idt,R_NamesSymbol),icols[col]-1)), type2char(it));
  • if (isNull(jiscols) && (length(bynames)!=length(groups) || length(bynames)!=length(grpcols))) error(_("!length(bynames)[%d]==length(groups)[%d]==length(grpcols)[%d]"),length(bynames),length(groups),length(grpcols));
  • if (length(names) != length(SDall)) error(_("length(names)!=length(SD)"));
  • if (length(xknames) != length(xSD)) error(_("length(xknames)!=length(xSD)"));
  • data.table/src/dogroups.c

    Lines 162 to 163 in d7e95d1

    if (length(iSD)!=length(jiscols)) error(_("length(iSD)[%d] != length(jiscols)[%d]"),length(iSD),length(jiscols));
    if (length(xSD)!=length(xjiscols)) error(_("length(xSD)[%d] != length(xjiscols)[%d]"),length(xSD),length(xjiscols));
  • if (length(ans) != ngrpcols + njval) error(_("dogroups: length(ans)[%d]!=ngrpcols[%d]+njval[%d]"),length(ans),ngrpcols,njval);
  • Rprintf(_("nradix=%d\n"), nradix);
  • if (verbose) DTPRINT(_(" jumps=[%d..%d), chunk_size=%"PRIu64", total_size=%"PRIu64"\n"),
  • if (INTEGER(nThreadArg)[0]<1) error(_("nThread(%d)<1"), INTEGER(nThreadArg)[0]);
  • error(_("%s"), msg); // include "%s" because data in msg might include '%'

    warning(_("%s"), ret);
  • if (verbose) Rprintf(_("nth=%d, nBatch=%d\n"),nth,nBatch);
  • if (verbose) Rprintf(_("maxBit=%d; MSBNbits=%d; shift=%d; MSBsize=%zu\n"), maxBit, MSBNbits, shift, MSBsize);
  • Rprintf(_("Top 20 MSB counts: ")); for(int i=0; i<MIN(MSBsize,20); i++) Rprintf(_("%"PRId64" "), (int64_t)msbCounts[order[i]]); Rprintf(_("\n"));
  • Rprintf(_("%d: %.3f (%4.1f%%)\n"), i, t[i]-t[i-1], 100.*(t[i]-t[i-1])/tot);
  • for (int j=0; j<args.ncol; j++) DTPRINT(_("%d "), args.whichFun[j]);

    for (int j=0; j<30; j++) DTPRINT(_("%d "), args.whichFun[j]);

    for (int j=args.ncol-10; j<args.ncol; j++) DTPRINT(_("%d "), args.whichFun[j]);

    DTPRINT(_("... "));
  • data.table/src/fwrite.c

    Lines 638 to 639 in d7e95d1

    DTPRINT(_("\nargs.doRowNames=%d args.rowNames=%p args.rowNameFun=%d doQuote=%d args.nrow=%"PRId64" args.ncol=%d eolLen=%d\n"),
    args.doRowNames, args.rowNames, args.rowNameFun, doQuote, args.nrow, args.ncol, eolLen);
  • else STOP(_("%s: '%s'"), strerror(errwrite), args.filename);
  • if (LENGTH(f) != ngrp) error(_("length(f)=%d != length(l)=%d"), LENGTH(f), ngrp);
  • Rprintf(_(" omp_get_num_procs() %d\n"), omp_get_num_procs());
    Rprintf(_(" R_DATATABLE_NUM_PROCS_PERCENT %s\n"), mygetenv("R_DATATABLE_NUM_PROCS_PERCENT", "unset (default 50)"));
    Rprintf(_(" R_DATATABLE_NUM_THREADS %s\n"), mygetenv("R_DATATABLE_NUM_THREADS", "unset"));
    Rprintf(_(" R_DATATABLE_THROTTLE %s\n"), mygetenv("R_DATATABLE_THROTTLE", "unset (default 1024)"));
    Rprintf(_(" omp_get_thread_limit() %d\n"), omp_get_thread_limit());
    Rprintf(_(" omp_get_max_threads() %d\n"), omp_get_max_threads());
    Rprintf(_(" OMP_THREAD_LIMIT %s\n"), mygetenv("OMP_THREAD_LIMIT", "unset")); // CRAN sets to 2
    Rprintf(_(" OMP_NUM_THREADS %s\n"), mygetenv("OMP_NUM_THREADS", "unset"));
    Rprintf(_(" RestoreAfterFork %s\n"), RestoreAfterFork ? "true" : "false");
  • if (length(order) != nrow) error(_("nrow(x)[%d]!=length(order)[%d]"),nrow,length(order));
  • if (stat[i]) Rprintf(_("stat[%03d]==%20"PRIu64"\n"), i, (uint64_t)stat[i]);

Which of these should have their _ removed and marked with // # notranslate for potools? Which should be translated anyway?

Topic originally started by @rikivillalba in #6503 (comment)

Edit: I have since remembered about punctuation rules, e.g. a space being required before the colon in French, and checked the corresponding checkboxes. If you can think of any reason to translate any of my examples, please check them too.

@aitap aitap added the translation issues/PRs related to message translation projects label Sep 18, 2024
@rikivillalba
Copy link
Contributor

rikivillalba commented Sep 18, 2024

Perhaps it should be weigthed the trade off between the number of required // # nontranslate current and new annotations versus not running the string extraction and adding the new _()'s manually?

@MichaelChirico
Copy link
Member

Perhaps it should be weigthed the trade off between the number of required // # nontranslate current and new annotations versus not running the string extraction and adding the new _()'s manually?

There are over 400 # nocov annotations, I think the number of # notranslate tags implied here is pretty small.

@MichaelChirico
Copy link
Member

WDYT about leaving this one: DTPRINT(_("... "));, I figure ... could be translated differently across languages, e.g. quickly googling for Japanese: https://japanese.stackexchange.com/questions/18058/ellipsis-usage-and-format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translation issues/PRs related to message translation projects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants