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
enhance language translator module for text translation, avoid label text duplication #1404
enhance language translator module for text translation, avoid label text duplication #1404
Conversation
Thanks for the PR. The description is shown even when it's going to be duplicating the label primarily because the label can't be copied (for copy/paste operations) wheres the description can. Some people use external tools (like Google translate) to assist in translation, so being able to copy the untranslated text is important for them. Regarding the text in ProcessLanguageTranslator itself not being translatable, that was intended, though I'm not sure it's necessarily the right decision, so wanted to see what you thought. The idea was that this tool is primarily used for translating English text to some other language, so the text in the module itself should always be English. Again, I'm not sure that's the right way to do it, and maybe it should be translatable like in your PR. |
Maybe the duplicated label could be resolved otherwise because it blows up the list a lot. So I have to scroll twice as much as actually needed.
For a current project our clients want to change some string translation by themselves, therefore I adapted my translation module and added a new permission. Furthermore the clients get only the site translation files displayed. So in this case it’s really necessary to translate the introduction text as well as the labels.. I have no chance to solve it by using a hook before or after method. I wouldn't want to alter the returned html output using regex. At the moment I'm using a replacement hook which I really don’t like. Therefore I would highly appreciate it if there would be a way to translate these texts. |
Thanks, what you said makes sense. I will make the text translatable in the module per your updates here and will experiment further with those labels to see if can accomplish it without the duplication. To make them copy/paste friendly, I think we would have to disable the default use of field labels here, since clicking an Inputfield label focuses the field (per regular |
…g suggestions from PR #1404 and fixes from issue #1291. Biggest changes to language translation tools are that the translation interface is now more minimal without redundant labels, a checkbox has been added enabling you to hide already-translated blocks, the ProcessLanguageTranslator module itself is now translatable, and a new lang-edit permission is available so that you can assign permissions to the language tools... optionally combining them with page-edit-lang-* permissions.
I have applied the suggestions from this PR to the language translation tools, plus some more goodies. Please let me know how it works for you. Thanks. |
Thanks a lot. Works like a charm except two little issues, but maybe I missed some settings. The checkbox "hide already-translated blocks" is not working for me because the related JS file The other issue is related to the label. At the moment it is not "copy-paste-friendly". This is completely fine for me, I don't need to copy and paste the label. I just wanted to mention this behaviour because we talked about it. To be able to select the label, the CSS needs to be adapted: |
Thanks for testing. I'm not seeing either of those issues here, so wondering if you might have an incomplete copy of the core? Make sure it's the dev branch that you've got, and not the master or devns branch. Also make sure that when you replace your /wire/ directory that you wipe out the old one first before putting in the new one (so that the contents don't get merged). If you are doing a git pull of the core, then you don't need to worry about this as Git should take care of it. Another possibility, you might need to do a Modules > Refresh since the core version hasn't changed yet. Here's a link to the min.js file: https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/modules/LanguageSupport/ProcessLanguageTranslator.min.js As for the copy/paste, it's only the descriptions that need to be copy/paste friendly. The label (InputfieldHeader) is now only shown if additional notes are provided for the translator, and those don't need to be copy/paste friendly since they are not meant to be translated. Are you finding that the description can't be copy/pasted? If so, what browser/platform? Thanks. |
I use git so everything should work. I checked out |
Using a fresh installation everything works like a charm. Thanks! |
No description provided.