Changelog
Source:NEWS.md
shiny.i18n (development version)
-
usei18n()sets the initial language on thei18n-stateelement, and language changes made withupdate_lang()are now reported to the server asinput[["i18n-state"]]. Previously the input was never set, and each language change logged a JavaScript error in recent Shiny versions. -
Translator$t()matches keys exactly. Previously a unique prefix of a key was translated as that key (e.g.NA_character_was translated as"NASO"), andNAreturned one value per dictionary row.NAnow passes through unchanged, without a warning (#139). -
init_i18n(automatic = TRUE)enables automatic translation mode. Previously the flag was passed toTranslator$new()as the CSV separator, so the call failed without translation files or with CSV files, and left automatic mode off with a JSON file (#144). -
Translator$automatic_translate()and$at()stop with “Please provide a ‘translation_language’” when no translation language is set. Previously, in automatic mode without translation files, the missing language (NULL) was passed on to Google Translate, and a failure was reported as a credentials problem (#152). -
create_translation_file(type = "csv")names its default outputtranslation_lang.csv, soTranslator$new(translation_csvs_path = ...)finds it. Previously it wrotetranslate_lang.csv, whichTranslatorskipped, because it reads only files namedtranslation_*.csv. A folder with no such files now fails with “No translation files found” instead of the misleading “Key translation is not the same in all files” (#137).
shiny.i18n 0.3.0
CRAN release: 2023-01-16
-
shiny.i18nfull compatibility withrhinoapplications -
get_translation_languagemethod added to theTranslatorclass - fixed regex in
extract_key_expressions - translator reads only CSV files with the “translation_” prefix
- added default session value in
update_lang
shiny.i18n 0.2.0
CRAN release: 2020-10-02
-
preprocscript with preprocessing functions - they create example translation CSV, or JSON files - RStudio addin that searches for all
i18nttags - JS bindings that identify html elements with i18n class
-
uiscript with ui translations related function - automatic translations via API (currently only google cloud supported)
- increased test coverage to 63%
- 2 vignettes with tutorials
- examples with live language translation on the UI side and with automatic translation via API
- pkgdown documentation
- Translator class is R6 class now
-
translatemethod now automatically detects whether object is in UI or server and applies reactive or JS translation accordingly