question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline translations break page layouts

See original GitHub issue

I am no HTML expert, but the way the inline translations work feels wrong. Also cumbersome to code inside the templates. Also I may be wrong but this is what I think may be a good solution:

I think there should be a single function in form of

inlineEditorHelper('<a href="blah">{{ trans('keyname') }}</a>','keyname')

This function would return result of normal translation if inline editing is disabled:

<a href="blah">{{ trans('keyname') }}</a>

If inline editing is enabled, it would return something like this:

<span style="position:relative;" onmouseover="show popup with id" onmouseout="hide popup with id"><a href="blah">{{ trans('keyname') }}</a><span><a style="position:absolute; display: none;"....then the usual stuff>$diff</a>

This way, when one comes on top of the text to be translated, the translation link would pop up without breaking the page layout.

An alternative would be showing a small floating translate icon next to the texts which wont break the layouts. I think magento translator does something similar.

What do you think?

PS. The reason for giving the key twice was because it is impossible to figure out what was the original key otherwise. Perhaps there could be a better way…

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
vschcommented, Jun 4, 2016

@yurtesen, that is an awesome implementation. I love it. Great work.

If you make it available I will add it to the next release.

0reactions
yurtesencommented, Jun 27, 2016

You are right, I should have done it from the beginning. I have made a pull request now https://github.com/vsch/laravel-translation-manager/pull/43

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline Translator: Advanced Features - ImTranslator
Inline Translator translates a selected text on a website and embedded the translation into a webpage. Based on settings, the translation can be...
Read more >
page-break-inside - CSS: Cascading Style Sheets | MDN
The page-break-inside CSS property adjusts page breaks inside the current element.
Read more >
Allow synced Layout override Translations - Drupal
Right now you are not able to translate layouts at all. The most common use case is probably translating the block labels and...
Read more >
How can I prevent Google Translate from changing the html ...
For example, where did you get layout: google.translate.TranslateElement.InlineLayout.SIMPLE from? That site should have all the info you ...
Read more >
Multi-language content for print or the web - Inline
Layout and design of translated text. Many of Inline's clients need their translations in camera-ready copy for high-quality printing, or for documents that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found