Translate-flag translate="no"

I would be happy if MediaWiki could automatically add CSS tags to commands or codes that would not be translated by browsers (such as Google Translate).

qa-translate-flag

translate="no"

For example,

UEFI - Install Guide - An alternative: chainloading via GRUB - Manjaro Wiki

I am fairly certain that you can use <nowiki> tag to achieve that.

1 Like

I guess my English is not very clear.

Will the maintainers automatically tag all existing English content with nowiki tags?

example

find --extension  image -max-depth 5 -x  ls -l {}

fd --拡張子 画像 --最大-深度 5 -x ls -l {}

Maybe I’m asking for something outrageous.

The HTML5 translate attribute indicates whether or not the content of any given element should be translated (but, it’s not CSS :smile_cat:).

  • translate="no" will prevent translation.
  • translate="yes" allows translation.

If the *translate attribute was added to each page (<html translate="no">) it would also prevent valid translation of normal text – so, that’s not really an option.

However, I imagine the wiki templating for the <pre> element could be modified to prevent translation of commands; something like:

<pre translate="no">

However, the translate attribute is best used with static HTML.

In applications that generate HTML (such as blogs, wikis, etc) there might be a pre-defined setting to allow or disallow translation – much like the <nowiki> tag that @linux-aarhus mentions; though I can neither confirm or deny if that would work, as I’ve personally had limited experience with these kinds of applications.

1 Like

If you are referring to writing a command as is on Manjaro Wiki - there is templates for it.

1 Like

Help:Extension:Translate - MediaWiki

translatewiki.net - MediaWiki

1 Like

There is

{{UserCmd|command=sudo pacman-mirrors}}
{{RootCmd|command=pacman-mirrors}}

There is also templates with output

1 Like

I see. That means you have to make the corrections for each individual article, not all at once.

I imagined a template like this as a solution.

That way, you could solve the problem all at once.

There’s no need for command line translation.

Making corrections for each individual page is a lot of work. It may mean that consideration is required at the writer’s stage.

<div translate="no">
<span style="color:lawngreen;font-weight:bold;">user $ </span><span style="color:white;background-color:black;font-weight:bold;"> lsblk -o PATH,PTTYPE,PARTTYPE,FSTYPE,PARTTYPENAME <span class="mw-ui-button copy-to-clipboard-button" style="float: right; cursor: pointer; border-radius:5px; margin-top:5px" role="button" data-clipboard-text="lsblk -o PATH,PTTYPE,PARTTYPE,FSTYPE,PARTTYPENAME">COPY TO CLIPBOARD</span></span>
</div>

cf.https://wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader

I see.
If it’s written like this, there won’t be any strange pages.

If the day comes when I am able to contribute, I will make sure to take advantage of it.

Simple Translate – Get this Extension for 🦊 Firefox (en-US)

Extension Image --Max-Depth

Using the HTML5 translate attribute might work, but yes, it would assuredly be very labour-intensive.

The general quality of external translation services seems to vary. I’d suggest the onus is really on those services to avoid inadvertantly translating CSS code along with other content.

At least, that seems easier than the alternative of educating content creators to stop using inline CSS within the HTML.

Separation of concerns in coding web content has been greatly encouraged since the early 2000’s, yet a significant portion of content creators (individuals and publishing systems) still remain ignorant or simply ignore it.