Appsilon / shiny.i18n

Shiny applications internationalization made easy
https://appsilon.github.io/shiny.i18n/
Other
169 stars 38 forks source link

Error load_local_config function #29

Closed AleVeraM closed 4 years ago

AleVeraM commented 4 years ago

I'm trying to call the load_local_config function to load the configuration file, but it throws an error, it can't find it. What is the correct way to call this function? ` library(shiny) library(shiny.i18n) load_local_config("../../config.yaml") # Throw error, not found ui <- shinyUI(fluidPage( ...... )) translator <- Translator$new(translation_csvs_path = "../data")

server <- shinyServer(function(input, output, session) { ...... }) `

krystian8207 commented 4 years ago

@AleVeraM Could you provide folders structure including app.R and config.yml file? This way I could detect what should be the correct path.

AleVeraM commented 4 years ago

I am running the live_language_change example, I add the load_local_config ("../../ config.yaml")statement. The error shown is that the function could not be found, RStudio autocomplete does not show that function.

krystian8207 commented 4 years ago

@AleVeraM The problem is load_local_config is not an exported function in the package. In order to use it properly use:

translator <- Translator$new(
  translation_csvs_path = "../data",
  translation_csv_config = "../../config.yaml"
)

Please let me know if this fixed the problem.

AleVeraM commented 4 years ago

Fixed the problem. Thanks!!