andrewhancox / moodle-filter_translations

8 stars 8 forks source link

Feature request/improvement: Use encoded URLs instead of actual URLs for translation hashes #139

Open rjnl opened 2 years ago

rjnl commented 2 years ago

With the current way how translations are stored and how translation hashes are computed, it will be difficult to migrate or export/import translations from one site to another. Internal file paths and references in Moodle are stored with a PLUGINFILE placeholder and actual URLs are generated when content is rendered. The translations filter generates hashes on content that has these encoded URLs converted to actual URLs. Likewise it stores the rawtext and substitutetext with actual URLs.

Will it not be better to use the real raw texts, as they are stored in the database, to generate hashes? And to store them in rawtext. Are there any drawbacks/limitations of this over the current approach?

This will also help resolve #125.

andrewhancox commented 2 years ago

Totally agree but it's not possible given the architecture of filters/editors, I checked this very, very thoroughly.

jgramp commented 2 years ago

In that case, can we convert all URLs back to use the PLUGINFILE placeholder when we export the translations and then we convert these placeholders back to the URLs for the new site upon import?

andrewhancox commented 2 years ago

Also no, you would need to know the plugin etc. to generate the placeholders. This was one of the architectural limitations we discussed right at the start of the project.

andrewhancox commented 1 year ago

Also probably not feasible as we wouldn’t know which plugin generated the link.

On 11 Jul 2022, at 10:53, Jessica Gramp @.***> wrote:

In that case, can we convert all URLs back to use the PLUGINFILE placeholder when we export the translations and then we convert these placeholders back to the URLs for the new site upon import?

— Reply to this email directly, view it on GitHub https://github.com/andrewhancox/moodle-filter_translations/issues/139#issuecomment-1180193872, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJEYMTHI7JQHJGX6LIVVU3VTPVKDANCNFSM527PYM5A. You are receiving this because you commented.