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

Strings not translatable in VueUI by default #875

Open
Quirinus opened this issue Nov 22, 2023 · 0 comments
Open

Strings not translatable in VueUI by default #875

Quirinus opened this issue Nov 22, 2023 · 0 comments

Comments

@Quirinus
Copy link
Contributor

Quirinus commented Nov 22, 2023

Describe the bug

When using VueUI, there are a bunch of strings that are not translated or are displaying as code, and some are hardcoded.

Steps to reproduce the bug

Open up pywb with a translation that isn't English. Open up the timeline. Here are three different examples:

  • When you zoom in to a period, and hover your mouse over the translation of "All-time", it says "Zoom out to [...]", instead of being allowed to be translated. This string is hardcoded in the code.
  • If you hover over the icon of the globe in the top right it says "Language" - not translated; note that the button itself (which contains the icon) has a translated title, though. Seems like this string is not added to messages.csv when generating translations. It's of the type :title=\"_('Language')\" in the code.
  • Strings that are like alt=\"_('pywb logo')\" produce alt="_('pywb logo')" instead of showing the translation string - that is, they don't even get processed internally, unlike the one from the previous point (plus like the one from the previous point, they're not generated in messages.csv when generating translations).

Expected behavior

I expect that all front-end VueUI strings are translatable and not display as code, and appear in the messages.csv when generating the list of strings for translation.

Screenshots

image
Notice the string in the red rectangle isn't translated. (Ignore the missing image, that's another issue.)

Environment

  • Version: pywb 2.7.4

Additional context

I digged a bit, and it seems it should be fixable fairly simply:

  • https://github.com/webrecorder/pywb/blob/main/pywb/templates/vue_loc.html:
    • add strings/translations here
    • I guess this is used when generating the translation messages.csv. maybe there's a way to include vueui.js in the generation, or should all strings that are to be translated put in here?
  • https://github.com/webrecorder/pywb/blob/main/pywb/static/vue/vueui.js:
    • find the hardcoded strings and replace them with translations
    • fix the translations of the type alt=\"_('pywb logo')\" not getting even processed, and getting displayed as code
    • they have to also be replaced in the injected code (e.g. also in "vue_inject_styles$5")... not sure if thats some automatic tool that does that or can it be done manually
    • regenerate the source map with some tool

I might give fixing/improving this a shot when I get some time.

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