-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from andrechalom/multilingual
Multilingual
- Loading branch information
Showing
7 changed files
with
587 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
################################################## | ||
### MULTILINGUAL VARIABLES AND FUNCTION ### | ||
################################################# | ||
# The default language is "en". To use the translated version, set the language such as | ||
# > language <- "pt" | ||
# before calling the app | ||
language <- ifelse(exists("language"), language, "en") | ||
dictionary <- read.csv('lang.csv', sep = ';', stringsAsFactors = FALSE, fileEncoding="UTF-8", header=TRUE) | ||
# If the language is not recognized, does not attempt to run the app. Stop immediately: | ||
if (! language %in% colnames(dictionary)[-1]) | ||
stop(paste0("Language is not recognized: ", language, "\n")) | ||
## Main translation function. Uses "language" and "dictionary" as globals, defined above | ||
# in this file. | ||
tr <- function(text) { | ||
for (i in 1:length(text)) { | ||
id <- which(dictionary$value %in% text[i]) | ||
# Trying again: | ||
if (length(id) == 0) | ||
id <- which(dictionary$en %in% text[i]) | ||
# If still no matches, prints a warning: | ||
if (length(id) == 0) | ||
cat(paste('No matches for text:', text[i], '\n')) | ||
if (length(id) == 1) { | ||
text[i] <- ifelse(language == "pt", dictionary$pt[id], dictionary$en[id]) | ||
} else if (length(id) > 1) { | ||
cat(paste('More than one match for text:', text[i], '\n')) | ||
} | ||
} | ||
return(text) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
</ul> | ||
<p>The idea behind this package is to help students to understand the logic behind these tests, | ||
with lots of flexibility on what is the statistic that will be calculated.</p> | ||
<p>Rsampling and and this web interface were written by <a href="mailto:[email protected]">Andre Chalom</a>, | ||
<p>Rsampling and this web interface were written by <a href="mailto:[email protected]">Andre Chalom</a>, | ||
<a href="mailto:[email protected]">Alexandre Adalardo</a>, <a href="mailto:[email protected]">Ayana Martins</a> | ||
and <a href="mailto:[email protected]">Paulo Prado</a>.</p> | ||
<p>Please visit our <a href="https://github.com/andrechalom/Rsampling-shiny">project webpage</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div style="float: right; border:1px dashed #ccc; width:22%; text-align: center;"> | ||
<img src="chicken.png" align="none"> | ||
<p style="font-size: 75%;">A Galinha Esférica foi criada por | ||
<a href="[email protected]">Luisa Novara</a> e pode ser utilizada sob a licença | ||
<a href="https://creativecommons.org/licenses/by/3.0/">CC3-by</a>.</p> | ||
</div> | ||
<div style="float: left; width: 73%"> | ||
<p>Rsampling é uma pacote gratuito e de código aberto desenvolvido | ||
com o objetivo de ajudar no aprendizado de métodos estatísticos | ||
baseados em permutação. | ||
O pacote foi baseado no programa | ||
<a href="http://www.resample.com">Resampling Stats</a>.</p> | ||
<p>Podemos pensar na lógica por trás de um teste de significância da seguinte forma: | ||
<ul><li>Escolha a sua estatística de interesse</li> | ||
<li>Determine qual é a sua hipótese nula</li> | ||
<li>Obtenha a distribuição da estatísica de interesse sob a hipótese nula</li> | ||
<li>Rejeite a hipótese nula se a probabilidade da estatística de interesse observada for | ||
menor do que um certo limiar</li> | ||
</ul> | ||
<p>A ideia por trás deste pacote é auxiliar na compreensão desta lógica, com grande flexibilidade de estatísticas | ||
que podem ser calculadas.</p> | ||
<p>Rsampling e sua interface gráfica foram escritos por <a href="mailto:[email protected]">Andre Chalom</a>, | ||
<a href="mailto:[email protected]">Alexandre Adalardo</a>, <a href="mailto:[email protected]">Ayana Martins</a> | ||
e <a href="mailto:[email protected]">Paulo Prado</a>.</p> | ||
<p>Visite nossa <a href="https://github.com/andrechalom/Rsampling-shiny">página de projeto</a> | ||
e a página da <a href="https://github.com/lageIBUSP/Rsampling">biblioteca Rsampling </a> no | ||
<a href="https://github.com">github</a>, | ||
para aprender mais sobre o projeto e enviar sugestões ou reportar bugs.</p> | ||
<p>Rsampling e Rsampling-shiny têm os poderes da Galinha Esférica.</p> | ||
</div> | ||
<div style="clear: both;"></div> |
Oops, something went wrong.