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

Translations in folder_contents are incomplete #2188

Closed
tomgross opened this issue Oct 24, 2017 · 19 comments
Closed

Translations in folder_contents are incomplete #2188

tomgross opened this issue Oct 24, 2017 · 19 comments

Comments

@tomgross
Copy link
Member

Partly this looks like a regression to 5.1b4. The translation coverage was better there.

What I did:

  • Install Plone 5.1rc1 and set a language different to English.
  • Go to folder_contents of the site or a folder.

What I expect to happen:

  • All actions are translated to the selected language.

What actually happened:

  • NOT all actions are translated to the selected language.

grafik

What version of Plone/ Addons I am using:

  • Plone 5.1rc1
@tomgross tomgross added this to the Plone 5.1 milestone Oct 24, 2017
@mauritsvanrees
Copy link
Member

When I search for 'Move to top of folder' I only find this in mockup/patterns/structure/js/actionmenu.js. So it has something to do with Javascript translations.
@thet Does this ring a bell for you?

@terapyon
Copy link
Member

I want to fix it.

@vincentfretin
Copy link
Member

vincentfretin commented Jun 19, 2020

The issue with those actions Copy, Move to top of folder, Move to bottom of folder, Set as default page still exists.

Here is a complete list I think:

@vincentfretin
Copy link
Member

Does anyone has the knowledge how to debug this? Like how do we modify the files of mockup and see the changes in a buildout.coredev 5.2?
Maybe someone who did the latest mockup / plone.staticresources bundle recently can tell us? @thet maybe?

@vincentfretin
Copy link
Member

vincentfretin commented Jun 19, 2020

I only know how to create widgets.pot from the https://github.com/plone/mockup/ repository with yarn && make i18n-dump and copy widgets.pot generated in the working directory to plone.app.locales/plone/app/locales/locales/widgets.pot and then run bin/i18n widgets from buildout.coredev 5.2.
What I don't know is how to modify the mockup javascripts files and see the changes in Plone.

@vincentfretin
Copy link
Member

@thet @davisagli @adam139 @parruc @frapell Do you know how to modify mockup files and see the changes in Plone? I see what I need to change to fix #3120 but I don't know how to test it.

@frapell
Copy link
Member

frapell commented Jun 19, 2020

@vincentfretin You need to go to the site setup, and then to the "Resource registries". In there you should see a checkbox that will enable "Dev mode" for resources. Next, you can enable dev mode for JS or CSS resources (I believe in your case you will only want to enable JS) I think the bundle you are looking for is "plone-logged-in" but it could be some other, I don't remember at this time.

@vincentfretin
Copy link
Member

Thanks you @frapell ! Now we're talking.
So from buildout.coredev, if you change something in src/mockup/mockup/patterns/structure/js/actionmenu.js
and want to see the change:
Go to Site Setup->Resource Registries, click on "Development Mode(only logged in users)" checkbox, then on "Develop Javascript" button for the plone-editor-tools bundle and then click the "Save" button.

@vincentfretin
Copy link
Member

vincentfretin commented Jun 20, 2020

OMG how does this stuff works? I started to write documentation of what I know there plone/mockup#985
How do you make changes to the translations and see the changes? Does the translation needs to be converted in json or something? How does it work?

@vincentfretin
Copy link
Member

I found out. The translations are handled by mockup/js/i18n.js that calls the plonejsi18n view in plone.app.content apparently to generate a live json from the mo file. The view is called one time for a given domain and language and the result is cached in localStorage for 24 hours. The only way to test the new translations is to restart the instance to update the mo file from the po file, and then to purge the localStorage to trigger a new download of the translations.

@frapell
Copy link
Member

frapell commented Jun 22, 2020

@vincentfretin I don't know much about the translations, and I didn't know they were cached for 24 hours in localstorage, isn't there a way to avoid that in development? I can imagine being a total pain when adding new translations

@frapell
Copy link
Member

frapell commented Jun 22, 2020

@vincentfretin Maybe @thet knows?

@vincentfretin
Copy link
Member

@frapell There is no way no, look at the code
https://github.com/plone/mockup/blob/0f4e1d014f305723bdbc7bd8826218ac69168d62/mockup/js/i18n.js#L75-L79
There is no develop flag or anything.

@vincentfretin
Copy link
Member

vincentfretin commented Jun 22, 2020

I'm not going to work on it myself. So anybody feel free to continue from here.
I documented how to live debug this in plone/mockup#985
I'm sure some of the issues I listed in #2188 (comment)
can be fixed similarly to other fixes that have already been done like #3120 @djowett-ftw if you want to try.

plone/mockup#539 can help too

@vincentfretin
Copy link
Member

@pbauer is one of a few that did know the caching issue in localStorage in 2015 :-)
plone/mockup#537 (comment)

@vincentfretin
Copy link
Member

There is actually a dedicated issue for the review state column: #2419

@vincentfretin
Copy link
Member

@erral started a branch in mockup plone/mockup#992 to fix some of the issues of the list #2188 (comment)
Thanks you!
If anyone else wants to contribute, please do! :-)

@erral
Copy link
Member

erral commented Jul 3, 2020

I will create specific issues for some of the items described above, because some of them are hard to track down.

@vincentfretin vincentfretin modified the milestones: Plone 5.1, Plone 5.2 Jul 8, 2020
@jensens
Copy link
Member

jensens commented Mar 13, 2023

I close the issue, because it addresses a Plone version that is no longer supported.
If you think this is wrong please reopen the issue and assign a matching milestone.

@jensens jensens closed this as completed Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants