Skip to content

Commit

Permalink
I18n strings improved (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
shun2wang authored Jul 11, 2023
1 parent 32d3c56 commit 5fa008e
Show file tree
Hide file tree
Showing 16 changed files with 176 additions and 177 deletions.
4 changes: 2 additions & 2 deletions R/LSbinaryclassification.R
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,10 @@ coef.bcPosteriorParams <- function(results) {
post <- .bcGetPosterior(options, dataset)
data <- data.frame(
parameter = gettext(c("Prevalence", "Sensitivity", "Specificity")),
prior = gettextf("beta(%s,%s)",
prior = gettextf("beta(%1$s,%2$s)",
options[c("priorPrevalenceAlpha", "priorSensitivityAlpha", "priorSpecificityAlpha")],
options[c("priorPrevalenceBeta", "priorSensitivityBeta", "priorSpecificityBeta")]),
posterior = gettextf("beta(%s,%s)",
posterior = gettextf("beta(%1$s,%2$s)",
post[c("priorPrevalenceAlpha", "priorSensitivityAlpha", "priorSpecificityAlpha")],
post[c("priorPrevalenceBeta", "priorSensitivityBeta", "priorSpecificityBeta")])
)
Expand Down
6 changes: 3 additions & 3 deletions R/LSbinomialcommon.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
}

output <- list(
distribution = gettextf("beta (%s, %s)", textAlpha, textBeta),
distribution = gettextf("beta (%1$s, %2$s)", textAlpha, textBeta),
mean = (prior[["betaPriorAlpha"]] + data$nSuccesses) / (prior[["betaPriorAlpha"]] + data$nSuccesses + prior[["betaPriorBeta"]] + data$nFailures),
median = qbeta(.5, prior[["betaPriorAlpha"]] + data$nSuccesses, prior[["betaPriorBeta"]] + data$nFailures),
mode = .modeBetaLS(prior[["betaPriorAlpha"]] + data$nSuccesses, prior[["betaPriorBeta"]] + data$nFailures),
Expand Down Expand Up @@ -282,7 +282,7 @@
if (prior[["type"]] == "spike") {

output <- list(
distribution = gettextf("binomial (%i, %s)", options[["posteriorPredictionNumberOfFutureTrials"]], prior[["spikePointInp"]]),
distribution = gettextf("binomial (%1$i, %2$s)", options[["posteriorPredictionNumberOfFutureTrials"]], prior[["spikePointInp"]]),
mean = prior[["spikePoint"]] * options[["posteriorPredictionNumberOfFutureTrials"]] / d,
median = qbinom(.5, options[["posteriorPredictionNumberOfFutureTrials"]], prior[["spikePoint"]]) / d,
mode = .modeBinomialLS(options[["posteriorPredictionNumberOfFutureTrials"]], prior[["spikePoint"]], prop = prop),
Expand All @@ -308,7 +308,7 @@
}

output <- list(
distribution = gettextf("beta-binomial (%i, %s, %s)", options[["posteriorPredictionNumberOfFutureTrials"]], textAlpha, textBeta),
distribution = gettextf("beta-binomial (%1$i, %2$s, %3$s)", options[["posteriorPredictionNumberOfFutureTrials"]], textAlpha, textBeta),
mean = (prior[["betaPriorAlpha"]] + data$nSuccesses) * options[["posteriorPredictionNumberOfFutureTrials"]] / (prior[["betaPriorAlpha"]] + data$nSuccesses + prior[["betaPriorBeta"]] + data$nFailures) / d,
median = .qbetabinomLS(.5, options[["posteriorPredictionNumberOfFutureTrials"]], prior[["betaPriorAlpha"]] + data$nSuccesses, prior[["betaPriorBeta"]] + data$nFailures) / d,
mode = .modeBetaBinomLS(options[["posteriorPredictionNumberOfFutureTrials"]], prior[["betaPriorAlpha"]] + data$nSuccesses, prior[["betaPriorBeta"]] + data$nFailures, prop = prop),
Expand Down
4 changes: 2 additions & 2 deletions R/LSbinomialestimation.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)

# add footnote clarifying what dataset was used
estimatesTable$addFootnote(gettextf(
"These results are based on %i %s and %i %s.",
"These results are based on %1$i %2$s and %3$i %4$s.",
data[["nSuccesses"]], ifelse (data[["nSuccesses"]] == 1, gettext("success"), gettext("successes")),
data[["nFailures"]], ifelse (data[["nFailures"]] == 1, gettext("failure"), gettext("failures"))
))
Expand Down Expand Up @@ -1138,7 +1138,7 @@ LSbinomialestimation <- function(jaspResults, dataset, options, state = NULL)

# add footnote clarifying what dataset was used
predictionsTable$addFootnote(gettextf(
"The prediction for %s %s is based on %s %s and %s %s.",
"The prediction for %1$s %2$s is based on %3$s %4$s and %5$s %6$s.",
options[["posteriorPredictionNumberOfFutureTrials"]], ifelse (options[["posteriorPredictionNumberOfFutureTrials"]] == 1, gettext("observation"), gettext("observations")),
data[["nSuccesses"]], ifelse (data[["nSuccesses"]] == 1, gettext("success"), gettext("successes")),
data[["nFailures"]], ifelse (data[["nFailures"]] == 1, gettext("failure"), gettext("failures"))
Expand Down
4 changes: 2 additions & 2 deletions R/LSbinomialtesting.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ LSbinomialtesting <- function(jaspResults, dataset, options, state = NULL) {

# add footnote clarifying what dataset was used
testsTable$addFootnote(gettextf(
"These results are based on %i %s and %i %s.",
"These results are based on %1$i %2$s and %3$i %4$s.",
data[["nSuccesses"]], ifelse (data[["nSuccesses"]] == 1, gettext("success"), gettext("successes")),
data[["nFailures"]], ifelse (data[["nFailures"]] == 1, gettext("failure"), gettext("failures"))
))
Expand Down Expand Up @@ -1463,7 +1463,7 @@ LSbinomialtesting <- function(jaspResults, dataset, options, state = NULL) {

# add footnote clarifying what dataset was used
predictionsTable$addFootnote(gettextf(
"The prediction for %s %s is based on %s %s and %s %s.",
"The prediction for %1$s %2$s is based on %3$s %4$s and %5$s %6$s.",
options[["posteriorPredictionNumberOfFutureTrials"]], ifelse (options[["posteriorPredictionNumberOfFutureTrials"]] == 1, gettext("observation"), gettext("observations")),
data[["nSuccesses"]], ifelse (data[["nSuccesses"]] == 1, gettext("success"), gettext("successes")),
data[["nFailures"]], ifelse (data[["nFailures"]] == 1, gettext("failure"), gettext("failures"))
Expand Down
15 changes: 7 additions & 8 deletions R/LScommon.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ gettextf <- function(fmt, ..., domain = NULL) {
}
}
if (models[[p]][["name"]] == "") {
models[[p]][["name"]] <- gettextf(
"%s %i",
ifelse (any(names(models[[p]]) %in% c("priorWeight")), "Hypothesis", "Model"),
models[[p]][["name"]] <- paste(
ifelse (any(names(models[[p]]) %in% c("priorWeight")), gettext("Hypothesis"), gettext("Model")),
p
)
}
Expand Down Expand Up @@ -1690,7 +1689,7 @@ hdi.density <- function(object, credMass=0.95, allowSplit=FALSE, ...) {
if (text == "main") {

introText <- gettextf(
"Welcome to the %s analysis from the Learn Bayes module. This analysis illustrates Bayesian %s using %s examples.",
"Welcome to the %1$s analysis from the Learn Bayes module. This analysis illustrates Bayesian %2$s using %3$s examples.",
switch(
analysis,
"binEst" = gettext("Binomial Estimation"),
Expand All @@ -1711,10 +1710,10 @@ hdi.density <- function(object, credMass=0.95, allowSplit=FALSE, ...) {
overviewText <- gettextf(
"The analysis is split into 5 sections:
<ol> <li> Data - for specifying the data input for the computations. You can either use a variable from a dataset loaded into JASP, specify an aggregated overview of the data, or enter the observations one by one (and update them during the analysis). </li>
<li> %s </li>
<li> %s </li>
<li> %s </li>
<li> %s </li> </ol>
<li> %1$s </li>
<li> %2$s </li>
<li> %3$s </li>
<li> %4$s </li> </ol>
",
ifelse (estimation,
gettextf("Model - for specifying models that will be used for estimation. You can specify the model name, the prior distribution for the parameter %s, and parameters that define the distribution.", parameterInfo),
Expand Down
2 changes: 1 addition & 1 deletion R/LSgaussiancommon.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
if (is.null(data)) {

output <- list(
distribution = gettextf("normal (%s, %s)", prior[["parMuInp"]], prior[["parSigmaInp"]]),
distribution = gettextf("normal (%1$s, %2$s)", prior[["parMuInp"]], prior[["parSigmaInp"]]),
mean = prior[["parMu"]],
median = prior[["parMu"]],
mode = prior[["parMu"]],
Expand Down
4 changes: 2 additions & 2 deletions R/LSgaussianestimation.R
Original file line number Diff line number Diff line change
Expand Up @@ -1190,11 +1190,11 @@ LSgaussianestimation <- function(jaspResults, dataset, options, state = NULL)

# add footnote clarifying what dataset was used
predictionsTable$addFootnote(gettextf(
"The prediction for %s future %s is based on %s.",
"The prediction for %1$s future %2$s is based on %3$s.",
options[["posteriorPredictionNumberOfFutureTrials"]],
ifelse (options[["posteriorPredictionNumberOfFutureTrials"]] == 1, gettext("observation"),gettext("observations")),
if (is.null(data)) gettext("prior") else gettextf(
"%s past %s",
"%1$s past %2$s",
data$N,
ifelse (data$N == 1, gettext("observation"), gettext("observations"))
)
Expand Down
48 changes: 24 additions & 24 deletions po/R-de.po
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ msgstr "Sensitivität"
msgid "Specificity"
msgstr "Spezifizität"

msgid "beta(%s,%s)"
msgstr "Beta(%s,%s)"
msgid "beta(%1$s,%2$s)"
msgstr "beta(%1$s,%2$s)"

msgid "Plots"
msgstr "Diagramme"
Expand Down Expand Up @@ -567,14 +567,14 @@ msgstr "Misserfolge"
msgid "spike at %s"
msgstr "Impuls bei %s"

msgid "beta (%s, %s)"
msgstr "Beta (%s, %s)"
msgid "beta (%1$s, %2$s)"
msgstr "beta (%1$s, %2$s)"

msgid "binomial (%i, %s)"
msgstr "Binomial (%i, %s)"
msgid "binomial (%1$i, %2$s)"
msgstr "binomial (%1$i, %2$s)"

msgid "beta-binomial (%i, %s, %s)"
msgstr "Beta-Binomial (%i, %s, %s)"
msgid "beta-binomial (%1$i, %2$s, %3$s)"
msgstr "beta-binomial (%1$i, %2$s, %3$s)"

msgid "Estimation Summary"
msgstr "Schätzungs-Zusammenfassung"
Expand All @@ -597,8 +597,8 @@ msgstr "Posterior %s"
msgid "Please specify successes and failures."
msgstr "Bitte gib Erfolge und Misserfolge an."

msgid "These results are based on %i %s and %i %s."
msgstr "Diese Ergebnisse basieren auf %i %s und %i %s."
msgid "These results are based on %1$i %2$s and %3$i %4$s."
msgstr "Diese Ergebnisse basieren auf %1$i %2$s und %3$i %4$s."

msgid "Observation"
msgstr "Beobachtung"
Expand Down Expand Up @@ -633,8 +633,8 @@ msgstr "Vorhersage %s"
msgid "Prediction std. deviation"
msgstr "Vorhersage Std.-Abweichung"

msgid "The prediction for %s %s is based on %s %s and %s %s."
msgstr "Die Vorhersage für %s %s basiert auf %s %s und %s %s."
msgid "The prediction for %1$s %2$s is based on %3$s %4$s and %5$s %6$s."
msgstr "Die Vorhersage für %1$s %2$s basiert auf %3$s %4$s und %5$s %6$s."

msgid "Predicted sample proportions"
msgstr "Vorhergesagte Stichprobenanteile"
Expand Down Expand Up @@ -800,21 +800,21 @@ msgid ""
"You can either use a variable from a dataset loaded into JASP, specify an "
"aggregated overview of the data, or enter the observations one by one (and "
"update them during the analysis). </li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li> </ol>"
" <li> %1$s </li>\n"
" <li> %2$s </li>\n"
" <li> %3$s </li>\n"
" <li> %4$s </li> </ol>"
msgstr ""
"Die Analyse ist in 5 Abschnitte aufgeteilt:\n"
" <ol> <li> Daten - hier werden die Daten für die Berechnungen "
"eingetragen. Sie können entweder eine Variable aus einem im JASP geladenen "
"Datensatz verwenden, eine Zusammenfassung der Daten auswählen oder die "
"Beobachtungen einzeln eintragen (und während der Analyse aktualisieren). </"
"li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li> </ol>"
" <li> %1$s </li>\n"
" <li> %2$s </li>\n"
" <li> %3$s </li>\n"
" <li> %4$s </li> </ol>"

msgid "The 'Data' section allows you to specify data input for the analysis."
msgstr "Im 'Daten'-Abschnitt können Sie die Daten für die Analyse eingeben."
Expand Down Expand Up @@ -1663,8 +1663,8 @@ msgstr "Es sind nur numerische Werte in der Eingabe erlaubt."
msgid "SD"
msgstr "SD"

msgid "normal (%s, %s)"
msgstr "Normal (%s, %s)"
msgid "normal (%1$s, %2$s)"
msgstr "Normal (%1$s, %2$s)"

msgid "normal (%.2f, %.2f)"
msgstr "Normal (%.2f, %.2f)"
Expand Down Expand Up @@ -1696,8 +1696,8 @@ msgstr "Mittelwert Vorhersage"
msgid "Please, specify the standard deviation of the data."
msgstr "Bitte gib die Standardabweichung der Daten an."

msgid "The prediction for %s future %s is based on %s."
msgstr "Die Vorhersage für %s zukünftiges %s basiert auf %s."
msgid "The prediction for %1$s future %2$s is based on %3$s."
msgstr "Die Vorhersage für %1$s zukünftiges %2$s basiert auf %3$s."

msgid "Sample means"
msgstr "Stichprobenmittelwerte"
Expand Down
48 changes: 24 additions & 24 deletions po/R-es.po
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ msgstr "Sensibilidad"
msgid "Specificity"
msgstr "Especificidad"

msgid "beta(%s,%s)"
msgstr "Beta(%s,%s)"
msgid "beta(%1$s,%2$s)"
msgstr "beta(%1$s,%2$s)"

msgid "Plots"
msgstr "Gráficos"
Expand Down Expand Up @@ -573,14 +573,14 @@ msgstr "Fracasos"
msgid "spike at %s"
msgstr "pico en %s"

msgid "beta (%s, %s)"
msgstr "Beta (%s, %s)"
msgid "beta (%1$s, %2$s)"
msgstr "beta (%1$s, %2$s)"

msgid "binomial (%i, %s)"
msgstr "Binomial (%i, %s)"
msgid "binomial (%1$i, %2$s)"
msgstr "binomial (%1$i, %2$s)"

msgid "beta-binomial (%i, %s, %s)"
msgstr "Beta-Binomial (%i, %s, %s)"
msgid "beta-binomial (%1$i, %2$s, %3$s)"
msgstr "beta-binomial (%1$i, %2$s, %3$s)"

msgid "Estimation Summary"
msgstr "Resumen de la Estimación"
Expand All @@ -603,8 +603,8 @@ msgstr "%s posterior"
msgid "Please specify successes and failures."
msgstr "Por favor, indica los aciertos y los fracasos."

msgid "These results are based on %i %s and %i %s."
msgstr "Estos resultados se basan en %i %s y %i %s."
msgid "These results are based on %1$i %2$s and %3$i %4$s."
msgstr "Estos resultados se basan en %1$i %2$s y %3$i %4$s."

msgid "Observation"
msgstr "Observación"
Expand Down Expand Up @@ -638,8 +638,8 @@ msgstr "Predicción %s"
msgid "Prediction std. deviation"
msgstr "Desviación típica de la predicción"

msgid "The prediction for %s %s is based on %s %s and %s %s."
msgstr "La predicción para %s %s se basa en %s %s y %s %s."
msgid "The prediction for %1$s %2$s is based on %3$s %4$s and %5$s %6$s."
msgstr "La predicción para %1$s %2$s se basa en %3$s %4$s y %5$s %6$s."

msgid "Predicted sample proportions"
msgstr "Proporciones predichas de la muestra"
Expand Down Expand Up @@ -807,20 +807,20 @@ msgid ""
"You can either use a variable from a dataset loaded into JASP, specify an "
"aggregated overview of the data, or enter the observations one by one (and "
"update them during the analysis). </li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li> </ol>"
" <li> %1$s </li>\n"
" <li> %2$s </li>\n"
" <li> %3$s </li>\n"
" <li> %4$s </li> </ol>"
msgstr ""
"El análisis se divide en 5 secciones:\n"
" <ol> <li> Datos - para indicar la introducción de datos para los "
"cálculos. Se puede utilizar una variable de un conjunto de datos cargados en "
"JASP, o indicar una revisión agregada de los datos, o bien introducir las "
"observaciones una a una (y actualizarlas durante el análisis). </li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li>\n"
" <li> %s </li> </ol>"
" <li> %1$s </li>\n"
" <li> %2$s </li>\n"
" <li> %3$s </li>\n"
" <li> %4$s </li> </ol>"

msgid "The 'Data' section allows you to specify data input for the analysis."
msgstr ""
Expand Down Expand Up @@ -1663,8 +1663,8 @@ msgstr "Solo se admiten valores numéricos en la entrada."
msgid "SD"
msgstr "DT"

msgid "normal (%s, %s)"
msgstr "Normal (%s, %s)"
msgid "normal (%1$s, %2$s)"
msgstr "Normal (%1$s, %2$s)"

msgid "normal (%.2f, %.2f)"
msgstr "Normal (%.2f, %.2f)"
Expand Down Expand Up @@ -1696,8 +1696,8 @@ msgstr "Media de la Predicción"
msgid "Please, specify the standard deviation of the data."
msgstr "Por favor, indica la desviación típica de los datos."

msgid "The prediction for %s future %s is based on %s."
msgstr "La predicción para %s futuro %s se basa en %s."
msgid "The prediction for %1$s future %2$s is based on %3$s."
msgstr "La predicción para %1$s futuro %2$s se basa en %3$s."

msgid "Sample means"
msgstr "Medias muestrales"
Expand Down
Loading

0 comments on commit 5fa008e

Please sign in to comment.