Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundant translations #105

Open
maxheld83 opened this issue Sep 7, 2021 · 1 comment
Open

remove redundant translations #105

maxheld83 opened this issue Sep 7, 2021 · 1 comment

Comments

@maxheld83
Copy link
Owner

currently as per a limitation in shiny.i18n (?) only one translation.json is considered in the JavaScript behind shiny.i18n::update_lang(), even when there are several json files in the HTML head.

Cleanly, these should be identified by the respective Translator object but that does not appear to be the case.

So, for now, we gotta duplicate some translations in the JSON, because only the latest (?) one to be added appears to be considered.

@maxheld83
Copy link
Owner Author

yup, I think this shows that it only expects on json of translations in the <head>:

let translate = function(key, new_lang) {
  return(i18n_translations
        .filter(cell => cell._row == key)
        .map(result => result[new_lang])[0]
  );
};

Also gives an js error in the console if this is called twice, probably overriding the last call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant