From afd6856d3813445811712b67181982fd63238b28 Mon Sep 17 00:00:00 2001 From: Shun Wang Date: Sat, 9 Nov 2024 03:38:59 +0000 Subject: [PATCH] fix i18n: use gettextf and `%` together --- R/classicalmetaanalysiscommon.R | 4 ++-- R/classicalmetaanalysismultilevelmultivariate.R | 4 ++-- R/effectsizecomputation.R | 2 +- R/funnelplot.R | 12 ++++++------ po/R-ar.po | 2 +- po/R-es.po | 2 +- po/R-ja.po | 2 +- po/R-jaspMetaAnalysis.pot | 2 +- po/R-pl.po | 2 +- po/R-pt.po | 2 +- po/R-ru.po | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/R/classicalmetaanalysiscommon.R b/R/classicalmetaanalysiscommon.R index de2e9d75..eaa3c75c 100644 --- a/R/classicalmetaanalysiscommon.R +++ b/R/classicalmetaanalysiscommon.R @@ -179,7 +179,7 @@ rmaInput$data$constant <- 1 for (i in seq_along(rmaInput$dist)) { if (is.matrix(rmaInput$dist[[i]]) && !all(unique(rmaInput[["data"]][[names(rmaInput$dist)[i]]]) %in% rownames(rmaInput$dist[[names(rmaInput$dist)[i]]]))) - .quitAnalysis(sprintf(gettext("The loaded distance matrix for '%1$s' does not match the dataset. The following levels are missing: %2$s."), + .quitAnalysis(gettextf("The loaded distance matrix for '%1$s' does not match the dataset. The following levels are missing: %2$s.", names(rmaInput$dist)[i], paste0(unique(rmaInput[["data"]][[names(rmaInput$dist)[i]]])[!unique(rmaInput[["data"]][[names(rmaInput$dist)[i]]]) %in% rownames(rmaInput$dist)], collapse = ", "))) } @@ -188,7 +188,7 @@ rmaInput$R <- unlist(lapply(randomFormulaList, attr, which = "R"), recursive = FALSE) for (i in seq_along(rmaInput$R)) { if (!all(unique(rmaInput[["data"]][[names(rmaInput$R)[i]]]) %in% rownames(rmaInput$R[[names(rmaInput$R)[i]]]))) - .quitAnalysis(sprintf(gettext("The loaded correlation matrix for '%1$s' does not match the dataset. The following levels are missing: %2$s."), + .quitAnalysis(gettextf("The loaded correlation matrix for '%1$s' does not match the dataset. The following levels are missing: %2$s.", names(rmaInput$R)[i], paste0(unique(rmaInput[["data"]][[names(rmaInput$R)[i]]])[!unique(rmaInput[["data"]][[names(rmaInput$R)[i]]]) %in% rownames(rmaInput$R)], collapse = ", "))) } diff --git a/R/classicalmetaanalysismultilevelmultivariate.R b/R/classicalmetaanalysismultilevelmultivariate.R index 4d40a18b..dbcc0f54 100644 --- a/R/classicalmetaanalysismultilevelmultivariate.R +++ b/R/classicalmetaanalysismultilevelmultivariate.R @@ -194,7 +194,7 @@ ClassicalMetaAnalysisMultilevelMultivariate <- function(jaspResults, dataset = N .quitAnalysis(gettextf("Error reading the distance matrix file: %1$s", distanceMatrix)) if (nrow(distanceMatrix) != ncol(distanceMatrix)) - .quitAnalysis(gettext("The distance matrix must be square. The number of rows (%1$i) does not match the number of columns (%2$i).", + .quitAnalysis(gettextf("The distance matrix must be square. The number of rows (%1$i) does not match the number of columns (%2$i).", nrow(distanceMatrix), ncol(distanceMatrix))) # spatial does not require a grouping factor @@ -231,7 +231,7 @@ ClassicalMetaAnalysisMultilevelMultivariate <- function(jaspResults, dataset = N .quitAnalysis(gettextf("Error reading the correlation matrix file: %1$s", correlationMatrix)) if (nrow(correlationMatrix) != ncol(correlationMatrix)) - .quitAnalysis(gettext("The distance matrix must be square. The number of rows (%1$i) does not match the number of columns (%2$i).", + .quitAnalysis(gettextf("The distance matrix must be square. The number of rows (%1$i) does not match the number of columns (%2$i).", nrow(correlationMatrix), ncol(correlationMatrix))) randomFormulas[[i]] <- as.formula(paste0("~ 1 | ", tempValueOuter), env = parent.frame(1)) diff --git a/R/effectsizecomputation.R b/R/effectsizecomputation.R index 11add3b4..1287db92 100644 --- a/R/effectsizecomputation.R +++ b/R/effectsizecomputation.R @@ -51,7 +51,7 @@ EffectSizeComputation <- function(jaspResults, dataset, options, state = NULL) { # set error message if reported effect sizes cannot be performed if (effectSizeType[["design"]] == "reportedEffectSizes" && !.escReportedEffectSizesReady(variables, all = TRUE)) { - newDataOutput <- try(stop(gettext("Cannot compute outcomes. Chech that all of the required information is specified via the appropriate arguments (i.e. an Effect Size and either Standard Error, Sampling Variance, or 95% Confidence Interval)."))) + newDataOutput <- try(stop(gettextf("Cannot compute outcomes. Chech that all of the required information is specified via the appropriate arguments (i.e. an Effect Size and either Standard Error, Sampling Variance, or 95%% Confidence Interval)."))) } else { # set escalc input escalcInput <- c( diff --git a/R/funnelplot.R b/R/funnelplot.R index c6214370..845ddcdc 100644 --- a/R/funnelplot.R +++ b/R/funnelplot.R @@ -540,9 +540,9 @@ FunnelPlot <- function(jaspResults, dataset = NULL, options, ...) { metaRegressionTable$addColumnInfo(name = "k", title = gettext("Estimates"), type = "integer") metaRegressionTable$addColumnInfo(name = "z", title = gettext("z"), type = "number", overtitle = gettext("Asymmetry Test")) metaRegressionTable$addColumnInfo(name = "p", title = gettext("p"), type = "pvalue", overtitle = gettext("Asymmetry Test")) - metaRegressionTable$addColumnInfo(name = "est", title = gettext("Estimate"), type = "number", overtitle = gettext("Limit Estimate")) - metaRegressionTable$addColumnInfo(name = "lCI", title = gettext("Lower 95% CI"), type = "number", overtitle = gettext("Limit Estimate")) - metaRegressionTable$addColumnInfo(name = "uCI", title = gettext("Upper 95% CI"), type = "number", overtitle = gettext("Limit Estimate")) + metaRegressionTable$addColumnInfo(name = "est", title = gettext("Estimate"), type = "number", overtitle = gettext("Limit Estimate")) + metaRegressionTable$addColumnInfo(name = "lCI", title = gettextf("Lower 95%% CI"), type = "number", overtitle = gettext("Limit Estimate")) + metaRegressionTable$addColumnInfo(name = "uCI", title = gettextf("Upper 95%% CI"), type = "number", overtitle = gettext("Limit Estimate")) if (.fpReady(options)) { if (options[["split"]] == "") { @@ -595,9 +595,9 @@ FunnelPlot <- function(jaspResults, dataset = NULL, options, ...) { weightedRegressionTable$addColumnInfo(name = "t", title = gettext("t"), type = "number", overtitle = gettext("Asymmetry Test")) weightedRegressionTable$addColumnInfo(name = "df", title = gettext("df"), type = "integer", overtitle = gettext("Asymmetry Test")) weightedRegressionTable$addColumnInfo(name = "p", title = gettext("p"), type = "pvalue", overtitle = gettext("Asymmetry Test")) - weightedRegressionTable$addColumnInfo(name = "est", title = gettext("Estimate"), type = "number", overtitle = gettext("Limit Estimate")) - weightedRegressionTable$addColumnInfo(name = "lCI", title = gettext("Lower 95% CI"), type = "number", overtitle = gettext("Limit Estimate")) - weightedRegressionTable$addColumnInfo(name = "uCI", title = gettext("Upper 95% CI"), type = "number", overtitle = gettext("Limit Estimate")) + weightedRegressionTable$addColumnInfo(name = "est", title = gettext("Estimate"), type = "number", overtitle = gettext("Limit Estimate")) + weightedRegressionTable$addColumnInfo(name = "lCI", title = gettextf("Lower 95%% CI"), type = "number", overtitle = gettext("Limit Estimate")) + weightedRegressionTable$addColumnInfo(name = "uCI", title = gettextf("Upper 95%% CI"), type = "number", overtitle = gettext("Limit Estimate")) if (.fpReady(options)) { if (options[["split"]] == "") { diff --git a/po/R-ar.po b/po/R-ar.po index 56672de9..7e4377fd 100644 --- a/po/R-ar.po +++ b/po/R-ar.po @@ -981,7 +981,7 @@ msgstr "" msgid "" "Cannot compute outcomes. Chech that all of the required information is " "specified via the appropriate arguments (i.e. an Effect Size and either " -"Standard Error, Sampling Variance, or 95% Confidence Interval)." +"Standard Error, Sampling Variance, or 95%% Confidence Interval)." msgstr "" msgid "Step" diff --git a/po/R-es.po b/po/R-es.po index b1a4fe75..a78526c3 100644 --- a/po/R-es.po +++ b/po/R-es.po @@ -1081,7 +1081,7 @@ msgstr "Eventos totales" msgid "" "Cannot compute outcomes. Chech that all of the required information is " "specified via the appropriate arguments (i.e. an Effect Size and either " -"Standard Error, Sampling Variance, or 95% Confidence Interval)." +"Standard Error, Sampling Variance, or 95%% Confidence Interval)." msgstr "" msgid "Step" diff --git a/po/R-ja.po b/po/R-ja.po index 607c2722..9d55db30 100644 --- a/po/R-ja.po +++ b/po/R-ja.po @@ -1056,7 +1056,7 @@ msgstr "イベントの合計数" msgid "" "Cannot compute outcomes. Chech that all of the required information is " "specified via the appropriate arguments (i.e. an Effect Size and either " -"Standard Error, Sampling Variance, or 95% Confidence Interval)." +"Standard Error, Sampling Variance, or 95%% Confidence Interval)." msgstr "" msgid "Step" diff --git a/po/R-jaspMetaAnalysis.pot b/po/R-jaspMetaAnalysis.pot index eab9f954..0834eb49 100644 --- a/po/R-jaspMetaAnalysis.pot +++ b/po/R-jaspMetaAnalysis.pot @@ -902,7 +902,7 @@ msgstr "" msgid "Total events" msgstr "" -msgid "Cannot compute outcomes. Chech that all of the required information is specified via the appropriate arguments (i.e. an Effect Size and either Standard Error, Sampling Variance, or 95% Confidence Interval)." +msgid "Cannot compute outcomes. Chech that all of the required information is specified via the appropriate arguments (i.e. an Effect Size and either Standard Error, Sampling Variance, or 95%% Confidence Interval)." msgstr "" msgid "Step" diff --git a/po/R-pl.po b/po/R-pl.po index 58a6d9fa..3d942fb0 100644 --- a/po/R-pl.po +++ b/po/R-pl.po @@ -1001,7 +1001,7 @@ msgstr "" msgid "" "Cannot compute outcomes. Chech that all of the required information is " "specified via the appropriate arguments (i.e. an Effect Size and either " -"Standard Error, Sampling Variance, or 95% Confidence Interval)." +"Standard Error, Sampling Variance, or 95%% Confidence Interval)." msgstr "" msgid "Step" diff --git a/po/R-pt.po b/po/R-pt.po index 4cdf9af6..8826e6fe 100644 --- a/po/R-pt.po +++ b/po/R-pt.po @@ -1049,7 +1049,7 @@ msgstr "" msgid "" "Cannot compute outcomes. Chech that all of the required information is " "specified via the appropriate arguments (i.e. an Effect Size and either " -"Standard Error, Sampling Variance, or 95% Confidence Interval)." +"Standard Error, Sampling Variance, or 95%% Confidence Interval)." msgstr "" msgid "Step" diff --git a/po/R-ru.po b/po/R-ru.po index 9f03af02..f0e00b41 100644 --- a/po/R-ru.po +++ b/po/R-ru.po @@ -981,7 +981,7 @@ msgstr "" msgid "" "Cannot compute outcomes. Chech that all of the required information is " "specified via the appropriate arguments (i.e. an Effect Size and either " -"Standard Error, Sampling Variance, or 95% Confidence Interval)." +"Standard Error, Sampling Variance, or 95%% Confidence Interval)." msgstr "" msgid "Step"