Appsilon / shiny.i18n

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

[Bug]: documentation error for function `usei18n` #127

Closed kletts closed 1 year ago

kletts commented 1 year ago

Guidelines

Project Version

v0.3.0

Platform and OS Version

All

Existing Issues

No response

What happened?

The documentation example for the function usei18n includes the following observe event and update language, see file: https://github.com/Appsilon/shiny.i18n/blob/132348b87429b107efd03ac544952f04b488f949/R/ui.R#L44C10-L45C1

' observeEvent(input$go,{

' update_lang(session, "pl")

' })

However as per the requirements update_lang, the session argument comes second. Although minor the error message from the example is unintuitive and difficult to trace for new users of the package:

Warning: Error in : $ operator is invalid for atomic vectors

Steps to reproduce

1. 2. 3. ...

Expected behavior

Corrected example:

' observeEvent(input$go,{

' update_lang(language="pl", session=session)

' })

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response