Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 145 additions & 29 deletions R/language.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ pkgEnv$label_cn = list(

pkgEnv$label_en = list(
"Please authenticate" = "Please authenticate",
"Username:" = "Username :",
"Password:" = "Password :",
"Username:" = "Username:",
"Password:" = "Password:",
"Login" = "Login",
"Username or password are incorrect" = "Username or password are incorrect",
"Your account has expired" = "Your account has expired",
"Your account is locked" = "Your account is locked",
"Please change your password" = "Please change your password",
"New password cannot be the same as old" = "New password cannot be the same as old",
"New password:" = "New password :",
"Confirm password:" = "Confirm password :",
"New password:" = "New password:",
"Confirm password:" = "Confirm password:",
"Update new password" = "Update new password",
"Password successfully updated! Please re-login" = "Password successfully updated! Please re-login",
"The two passwords are different" = "The two passwords are different",
Expand All @@ -107,7 +107,7 @@ pkgEnv$label_en = list(
"Administrator mode" = "Administrator mode",
"Add a user" = "Add a user",
"Too many users" = "Too many users",
"Maximum number of users : %s" = "Maximum number of users : %s",
"Maximum number of users : %s" = "Maximum number of users: %s",
"Failed to update user" = "Failed to update user",
"User successfully updated" = "User successfully updated",
"Cancel" = "Cancel",
Expand All @@ -131,8 +131,8 @@ pkgEnv$label_en = list(
"Number of connections per day" = "Number of connections per day",
"Total number of connection" = "Total number of connection",
"You can\'t remove yourself!" = "You can\'t remove yourself!",
"User:" = "User :",
"Period:" = "Period :",
"User:" = "User:",
"Period:" = "Period:",
"Last week" = "Last week",
"Last month" = "Last month",
"All period" = "All period",
Expand Down Expand Up @@ -234,7 +234,7 @@ pkgEnv$label_fr = list(
"Download Users file" = "T\u00e9l\u00e9charger la table des utilisateurs",
"Reset password for %s?" = "R\u00e9initialiser le mot de passe de %s ?",
"Reset password" = "R\u00e9initialiser le mot de passe",
"Temporary password:" = "Mot de passe temporaire",
"Temporary password:" = "Mot de passe temporaire :",
"Password succesfully reset!" = "Mot de passe r\u00e9initialis\u00e9",
"You are not authorized for this application" = "Vous n\'\u00eates pas habilit\u00e9 pour cette application",
"Language" = "Langue",
Expand Down Expand Up @@ -432,16 +432,16 @@ pkgEnv$label_es = list(

pkgEnv$label_de = list(
"Please authenticate" = "Bitte anmelden",
"Username:" = "Benutzername :",
"Password:" = "Passwort :",
"Username:" = "Benutzername:",
"Password:" = "Passwort:",
"Login" = "Anmelden",
"Username or password are incorrect" = "Benutzername oder Passwort falsch",
"Your account has expired" = "Account ist abgelaufen",
"Your account is locked" = "Account ist gesperrt",
"Please change your password" = "Bitte Passwort \u00e4ndern",
"New password cannot be the same as old" = "Das neue Passwort kann nicht dasselbe sein wie das vorherige",
"New password:" = "Neues Passwort :",
"Confirm password:" = "Passwort best\u00e4tigen :",
"New password:" = "Neues Passwort:",
"Confirm password:" = "Passwort best\u00e4tigen:",
"Update new password" = "Passwort aktualisieren",
"Password successfully updated! Please re-login" = "Passwort erfolgreich aktualisiert! Bitte neu anmelden.",
"The two passwords are different" = "Passw\u00f6rter nicht gleich",
Expand Down Expand Up @@ -475,8 +475,8 @@ pkgEnv$label_de = list(
"Number of connections per day" = "Verbindungen pro Tag",
"Total number of connection" = "Anzahl Verbindungen",
"You can\'t remove yourself!" = "Der eigene Account kann nicht gel\u00f6scht werden!",
"User:" = "Benutzer :",
"Period:" = "Zeitraum :",
"User:" = "Benutzer:",
"Period:" = "Zeitraum:",
"Last week" = "Letzte Woche",
"Last month" = "Letzter Monat",
"All period" = "Gesamter Zeitraum",
Expand Down Expand Up @@ -861,8 +861,95 @@ pkgEnv$label_id = list(
"Allowed null values" = "Nilai kosong diperbolehkan"
)

v_language_registered = c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN")
names(v_language_registered) = c("English", "Fran\u00e7ais", "Portuguese", "Espa\u00f1ol", "Deutsch", "Polski", "\u65e5\u672c\u8a9e", "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac", "Indonesian", "\u4e2d\u6587")

pkgEnv$label_no = list(
"Please authenticate" = "Vennligst godkjenn",
"Username:" = "Brukernavn:",
"Password:" = "Passord:",
"Login" = "Logg inn",
"Username or password are incorrect" = "Brukernavn eller passord er feil",
"Your account has expired" = "Kontoen din er utl\u00f8pt",
"Your account is locked" = "Kontoen din er l\u00e5st",
"Please change your password" = "Vennligst endre passord",
"New password cannot be the same as old" = "Det nye passordet kan ikke v\u00e6re det samme som det gamle",
"New password:" = "Nytt passord:",
"Confirm password:" = "Bekreft passord:",
"Update new password" = "Opdater nytt passord",
"Password successfully updated! Please re-login" = "Passordet er oppdatert! Vennligst logg inn p\u00e5 nytt",
"The two passwords are different" = "De to passordene er forskjellige",
"Failed to update password" = "Kunne ikke oppdatere passordet",
"Logout" = "Logg ut",
"Go to application" = "G\u00e5 til applikasjonen",
"Administrator mode" = "Administratormodus",
"Add a user" = "Legg til en bruker",
"Too many users" = "For mange brukere",
"Maximum number of users : %s" = "Maximalt antall brukere: %s",
"Failed to update user" = "Kunne ikke oppdatere bruker",
"User successfully updated" = "Bruker opdatert",
"Cancel" = "Avbryte",
"Confirm new user" = "Bekreft ny bruker",
"Confirm change" = "Bekreft endring",
"Are you sure to remove user(s): %s from the database ?" = "Er du sikker du vill fjerne bruker(e): %s fra databasen?",
"Delete user(s)" = "Slett bruker(e)",
"Delete user" = "Slett bruker",
"Edit user" = "Rediger bruker",
"User already exist!" = "Existerende bruker!",
"Dismiss" = "Avvise",
"New user %s succesfully created!" = "Ny bruker %s opprettet!",
"Ask to change password" = "Be om passord endring",
"Confirm" = "Bekreft",
"Ask %s to change password on next connection?" = "Be %s om passord endring ved neste p\u00e5melding?",
"Change saved!" = "Endring lagret!",
"Failed to update the database" = "Kunne ikke oppdatere databasen",
"Password does not respect safety requirements" = "Passordet respekterer ikke sikkerhetskravene",
"Password must contain at least one number, one lowercase, one uppercase and must be at least length 6." = "Passordet m\u00e5 inneholde minst ett tall, én liten bokstav, én stor bokstav og m\u00e5 v\u00e6re minst 6 tegn.",
"Number of connections per user" = "Antall tilkoblinger per bruker",
"Number of connections per day" = "Antall tilkoblinger per dag",
"Total number of connection" = "Totalt antall tilkoblinger",
"You can\'t remove yourself!" = "Du kan ikke fjerne deg selv!",
"User:" = "Bruker:",
"Period:" = "Periode:",
"Last week" = "Forrige uke",
"Last month" = "Forrige m\u00e5ned",
"All period" = "Hele perioden",
"Home" = "Hjem",
"Select all shown users" = "Velg alle viste brukere",
"Remove selected users" = "Fjern utvalgte brukere",
"Edit selected users" = "Rediger utvalgte brukere",
"Force selected users to change password" = "Tving utvalgte brukere til \u00e5 endre passord",
"Users" = "Brukere",
"Passwords" = "Passord",
"Download logs database" = "Last ned loggdatabasen",
"Download SQL database" = "Last ned loggdatabasen",
"Download Users file" = "Last ned brukerfil",
"Reset password for %s?" = "Tilbakestill passord for %s?",
"Reset password" = "Tilbakestill passord",
"Temporary password:" = "Midlertidig passord:",
"Password succesfully reset!" = "Passordet er tilbakestilt!",
"You are not authorized for this application" = "Du er ikke autorisert for denne applikasjonen",
"Language" = "Spr\u00e5k",
"Yes" = "Ja",
"No" = "Nei",
"Password" = "Passord",
"start" = "start",
"expire" = "utl\u00f8pe",
"admin" = "Admin",
"user" = "Bruker",
"Edit" = "Rediger",
"Remove" = "Fjern",
"must_change" = "M\u00e5 endres",
"have_changed" = "Har endret",
"date_change" = "Dato",
"Change password" = "Endre passord",
"Select" = "Velg",
"Logs" = "Logger",
"All users" = "Alle brukere",
"Nb logged" = "Nb logget",
"Allowed null values" = "Tillatte nullverdier"
)

v_language_registered = c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no")
names(v_language_registered) = c("English", "Fran\u00e7ais", "Portuguese", "Espa\u00f1ol", "Deutsch", "Polski", "\u65e5\u672c\u8a9e", "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac", "Indonesian", "\u4e2d\u6587", "Norsk")


#' @importFrom R6 R6Class
Expand All @@ -888,7 +975,8 @@ language <- R6::R6Class(
"ja" = pkgEnv$label_ja,
"el" = pkgEnv$label_el,
"id" = pkgEnv$label_id,
"zh-CN" = pkgEnv$label_cn
"zh-CN" = pkgEnv$label_cn,
"no" = pkgEnv$label_no
)
},
get = function(label) {
Expand Down Expand Up @@ -927,9 +1015,10 @@ language <- R6::R6Class(
"de" = "de",
"pl" = "pl",
"ja" = "ja",
"el" = "el",
"id" = "id",
"zh-CN" = "zh-CN"
"el" = "el",
"id" = "id",
"zh-CN" = "zh-CN",
"no" = "no"
),
DT_lan = list(
fr = list(
Expand Down Expand Up @@ -1156,6 +1245,29 @@ language <- R6::R6Class(
sSortAscending = ": aktifkan untuk mengurutkan kolom secara naik",
sSortDescending = ": aktifkan untuk mengurutkan kolom secara turun"
)
),
no = list(
sEmptyTable = "Ingen data tilgjengelig i tabellen",
sInfo = "Viser _START_ til _END_ av _TOTAL_ oppføringer",
sInfoEmpty = "Viser 0 til 0 av 0 oppføringer",
sInfoFiltered = "(filtrert fra _MAX_ totale oppføringer)",
sInfoPostFix = "",
sInfoThousands = ",",
sLengthMenu = "Vis _MENU_ oppføringer",
sLoadingRecords = "Lasting...",
sProcessing = "Bearbeiding...",
sSearch = "S\u00f8k:",
sZeroRecords = "Ingen matchende oppføringer funnet",
oPaginate = list(
sFirst = "F\u00f8rst",
sLast = "Sist",
sNext = "Neste",
sPrevious = "Forrige"
),
oAria = list(
sSortAscending = ": aktiver for å sortere kolonnen stigende",
sSortDescending = ": aktiver for å sortere kolonnen synkende"
)
)
),
length = function() base::length(private$labels)
Expand All @@ -1168,7 +1280,7 @@ language <- R6::R6Class(
#' @description See all labels registered with \code{get_labels()},
#' then set custom text with \code{set_labels()}.
#'
#' @param lan Language to use for labels, supported values are : "en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN".
#' @param lan Language to use for labels, supported values are : "en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no".
#'
#' @return A language object
#' @export
Expand All @@ -1189,7 +1301,7 @@ use_language <- function(lan = "en") {
#' @description See all labels registered with \code{get_labels()},
#' then set custom text with \code{set_labels()}.
#'
#' @param language Language to use for labels, supported values are : "en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN".
#' @param language Language to use for labels, supported values are : "en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no".
#' @param ... A named list with labels to replace.
#'
#' @return \code{get_labels()} return a named list with all labels registered.
Expand All @@ -1207,9 +1319,9 @@ use_language <- function(lan = "en") {
#' "Password:" = "Enter your password:"
#' )
set_labels <- function(language, ...) {
if (!language %in% c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN")) {
stop("Only supported language for the now are: en, fr, pt-BR, es, de, pl, ja, el, id, zh-CN", call. = FALSE)

if (!language %in% c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no")) {
stop("Only supported language for the now are: en, fr, pt-BR, es, de, pl, ja, el, id, zh-CN, no", call. = FALSE)
}
args <- list(...)
if (!all(nzchar(names(args)))) {
Expand All @@ -1226,7 +1338,8 @@ set_labels <- function(language, ...) {
"ja" = pkgEnv$label_ja,
"el" = pkgEnv$label_el,
"id" = pkgEnv$label_id,
"zh-CN" = pkgEnv$label_cn
"zh-CN" = pkgEnv$label_cn,
"no" = pkgEnv$label_no
)

update_labels <- modifyList(
Expand Down Expand Up @@ -1254,6 +1367,8 @@ set_labels <- function(language, ...) {
pkgEnv$label_el <- update_labels
} else if (language %in% "id") {
pkgEnv$label_id <- update_labels
} else if (language %in% "no") {
pkgEnv$label_no <- update_labels
}

invisible(TRUE)
Expand All @@ -1264,8 +1379,8 @@ set_labels <- function(language, ...) {
#' @rdname custom-labels
get_labels <- function(language = "en") {

if (!language %in% c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN")) {
warning("Only supported language for the now are: en, fr, pt-BR, es, de, pl, ja, el, id, zh-CN", call. = FALSE)
if (!language %in% c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no")) {
warning("Only supported language for the now are: en, fr, pt-BR, es, de, pl, ja, el, id, zh-CN, no", call. = FALSE)
language <- "en"
}

Expand All @@ -1279,6 +1394,7 @@ get_labels <- function(language = "en") {
"ja" = pkgEnv$label_ja,
"zh-CN" = pkgEnv$label_cn,
"el" = pkgEnv$label_el,
"id" = pkgEnv$label_id
"id" = pkgEnv$label_id,
"no" = pkgEnv$label_no
)
}
2 changes: 1 addition & 1 deletion R/module-auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param tags_bottom A \code{tags (div, img, ...)} to be displayed on bottom of the authentication module.
#' @param background A optionnal \code{css} for authentication background. See example.
#' @param choose_language \code{logical/character}. Add language selection on top ? TRUE for all supported languages
#' or a vector of possibilities like \code{c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN")}. If enabled, \code{input$shinymanager_language} is created
#' or a vector of possibilities like \code{c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no")}. If enabled, \code{input$shinymanager_language} is created
#' @param ... : Used for old version compatibility.
#'
#'
Expand Down
6 changes: 3 additions & 3 deletions R/secure-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @param theme Alternative Bootstrap stylesheet, default is to use \code{readable},
#' you can use themes provided by \code{shinythemes}.
#' It will affect the authentication panel and the admin page.
#' @param language Language to use for labels, supported values are : "en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN".
#' @param language Language to use for labels, supported values are : "en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no.
#' @param fab_position Position for the FAB button, see \code{\link{fab_button}} for options.
#'
#' @note A special input value will be accessible server-side with \code{input$shinymanager_where}
Expand All @@ -33,8 +33,8 @@ secure_app <- function(ui,
theme = NULL,
language = "en",
fab_position = "bottom-right") {
if (!language %in% c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN")) {
warning("Only supported language for the now are: en, fr, pt-BR, es, de, pl, ja, el, id, zh-CN", call. = FALSE)
if (!language %in% c("en", "fr", "pt-BR", "es", "de", "pl", "ja", "el", "id", "zh-CN", "no")) {
warning("Only supported language for the now are: en, fr, pt-BR, es, de, pl, ja, el, id, zh-CN, no", call. = FALSE)
language <- "en"
}

Expand Down