There are menu items
on my website that are brand names. I went to my website from Google Chrome browser and clicked "translate page", and I saw that the menu items with brand names on my websites were translated. The names of these menu items should not have been translated, as in all languages they should be written in English.
I suggest adding the html tag "translate
" to the menu items
so that you can specify in the settings whether it is possible to translate the name of this menu item or not (or not to use this html tag for the menu).
Translate menu item:
In the text of Articles
I can add this html tag "translate"
for selected words myself, but I can not add this html tag "translate"
for the names of menu items myself.
The translate
attribute in HTML5 indicates that the content of the element should or should not be translated. There is no effect on the rendered page (although you could, of course, style it if you found a good reason for doing so). For example,
<h1>Using HTML's <span class="kw" translate="no">translate</span> attribute</h1>
The attribute can appear on any element, and it takes just two values: yes
or no
. If the value is no, translation tools should protect the text of the element from translation. The translation tool in question could be an automated translation engine, like those used in the online services offered by Google, Microsoft and Yandex. Or it could be a human translator's 'workbench' tool, which would prevent the translator inadvertently changing the text.
Setting this translate flag on an element applies the value to all contained element content. HTML5 has a list of attributes that are to be translated by default, but these attributes should not be translated if they are on an element where translate
is set to no
. Otherwise attributes should not be translated.
If a page has no translate
attribute, a translation system or translator should assume that all the text is to be translated. The yes
value is therefore likely to see little use, though it could be very useful if you need to override a translate flag on a parent element and indicate some bits of text that should be translated. You may want to translate the natural language text in examples of source code, for example, but leave the code untranslated.
The translate
global attribute is an enumerated attribute that is used to specify whether an element's translateable attribute values and its Text
node children should be translated when the page is localized, or whether to leave them unchanged. It can have the following values:
"yes"
, which indicates that the element should be translated when the page is localized."no"
, which indicates that the element must not be translated.Although not all browsers recognize this attribute, it is respected by automatic translation systems such as Google Translate, and may also be respected by tools used by human translators. As such it's important that web authors use this attribute to mark content that should not be translated.
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/translate
W3: https://www.w3.org/International/questions/qa-translate-flag
Labels |
Added:
?
|
Title |
|
I guess your use case would be just "New Tree", right?
yes
E.g. custom fields?
This is not an additional field (such as video or audio field). This is the HTML tag that is added for the menu title so that the menu name does not translate.
I hope you understand what I'm writing.
I hope you understand what I'm writing.
I have understood very well. You have been writing about content, and a menu title is not the only content that appears on a website. How should an article about "New Tree" be handled?
I hope you understand what I'm writing.
I have understood very well. You have been writing about content, and a menu title is not the only content that appears on a website. How should an article about "New Tree" be handled?
In the Article
, you can insert these HTML tag translate
manually (via wysiwyg editor). For the title of the article, this is currently not possible. Therefore, I suggest adding this html tag translate
for the title of the article (for the title of a menu item).
This is like an HTML tag rel=follow, only this tag is for the title, and not for the whole article.
In the article, we can independently add this tag for each word we need, it is now possible, but it is not possible to do for the title (for the name of a menu item)
Title |
|
@gerryfrancis This is what I mean. (Only the name of the menu item, this does not apply to any words that are in the article)
If a PR is proposed and accepted, for J4, it should not be limited to menu items titles, but also article titles, modules titles, contacts titles
If a PR is proposed and accepted, for J4, it should not be limited to menu items titles, but also article titles, modules titles, contacts titles
It would be great!
This is indeed a very important function not only for multilingual websites, but also for any websites. This will help to correctly translate "brand names" and other names in articles and menu items if, for example, the user has visited French website and wants to translate this website into English or Russian through an translator (built-in Google Chrome browser) (as an example).
Let’s clarify here: It has nothing to do with multilingual joomla and it does not concern either lang packs translations.
Let’s clarify here: It has nothing to do with multilingual joomla and it does not concern either lang packs translations.
Absolutely right. This is the html tag.
Let’s clarify here: It has nothing to do with multilingual joomla and it does not concern either lang packs translations.
It looks like this:
<p>The <code class="kw" translate="no">translate</code> attribute</p>
If I remember correctly google etc also support this no translate functionality by adding a class
class="notranslate"
Build | staging | ⇒ | 4.0-dev |
Category | ⇒ | Feature Request |
If I remember correctly google etc also support this no translate functionality by adding a class
class="notranslate"
Yes, Google accepts this tag, but it acts globally on the entire page, on every word.
But I am writing about excluding the translation of individual words on the page (and not the entire page). But this tag can also be added where there is a setting for follow/nofollow (if necessary).
<meta name="google" content="notranslate" />
the tag I wrote was class= not content= :)
https://webmasters.googleblog.com/2008/10/helping-you-break-language-barrier.html
As it is a class you can apply it to the menu without any code changes
<span title="Englisch"><a href="article.en.html" translate="no" lang="en">English</a></span>
Title without Translate (HTML5)
https://www.w3.org/International/questions/qa-translate-flag#attributes
the tag I wrote was class= not content= :)
https://webmasters.googleblog.com/2008/10/helping-you-break-language-barrier.html
As it is a class you can apply it to the menu without any code changes
Legacy approaches for online translation services
Before the translate
attribute was defined, both Google and Microsoft online translation services supported a number of other, non-standard ways to express similar ideas.
Both Google and Microsoft support class="notranslate"
, but replacing a class
attribute value with an attribute that is a formal part of the language makes this feature much more reliable, especially in wider contexts. For example, a translation prep tool would be able to rely on the meaning of the HTML5 translate
attribute always being what is expected. Also it becomes easier to port the concept to other scenarios, such as other translation APIs or localization standards such as XLIFF.
Microsoft apparently supports style="notranslate"
. This is not one of the options Google lists for their online service, but on the other hand they have things that are not available via Microsoft's service.
For example, if you have an entire page that should not be translated, you can add <meta name="google" value="notranslate">
inside the head
element of your page and Google won't translate any of the content on that page. (However they also support <meta name="google" content="notranslate">
.) This shouldn't be Google specific, and a single way of doing this, ie. translate="no"
on the html
tag, is far cleaner.
Microsoft and Google's translation engines also don't translate content within code
elements. Note, however, that you don't seem to have any choice about this – there don't seem to be instructions about how to override this if you do want your code
element content translated.
As already mentioned, the new HTML5 translate
attribute provides a simple and standard feature of HTML that can replace and simplify all these different approaches, and will help authors develop content that will work with other systems too.
Source: https://www.w3.org/International/questions/qa-translate-flag#stickyness
This attribute "translate
" is recommended to be added to the website, as recommended by HTML5
:
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
Source №2: https://www.w3.org/TR/html52/dom.html#global-attributes
I was offering you a way to do it right now. Might not have been perfect
and definitely could be improved but you could do it today and not after
upgrading to joomla 4 in 2021
On Thu, 5 Mar 2020 at 19:18, sanek4life notifications@github.com wrote:
the tag I wrote was class= not content= :)
https://webmasters.googleblog.com/2008/10/helping-you-break-language-barrier.html
As it is a class you can apply it to the menu without any code changes
Legacy approaches for online translation services
Before the translate attribute was defined, both Google and Microsoft
online translation services supported a number of other, non-standard ways
to express similar ideas.Both Google and Microsoft support class="notranslate", but replacing a
class attribute value with an attribute that is a formal part of the
language makes this feature much more reliable, especially in wider
contexts. For example, a translation prep tool would be able to rely on the
meaning of the HTML5 translate attribute always being what is expected.
Also it becomes easier to port the concept to other scenarios, such as
other translation APIs or localization standards such as XLIFF
https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xliff.Microsoft apparently supports style="notranslate". This is not one of the
options Google lists for their online service, but on the other hand they
have things that are not available via Microsoft's service.For example, if you have an entire page that should not be translated, you
can add inside the head element
of your page and Google won't translate any of the content on that page.
(However they also support .)
This shouldn't be Google specific, and a single way of doing this, ie.
translate="no" on the html tag, is far cleaner.Microsoft and Google's translation engines also don't translate content
within code elements. Note, however, that you don't seem to have any
choice about this – there don't seem to be instructions about how to
override this if you do want your code element content translated.As already mentioned, the new HTML5 translate attribute provides a simple
and standard feature of HTML that can replace and simplify all these
different approaches, and will help authors develop content that will work
with other systems too.Source:
https://www.w3.org/International/questions/qa-translate-flag#stickyness—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/joomla/joomla-cms/issues/28238?email_source=notifications&email_token=AAJ4P4OPMSSAR4UZOVLA2T3RF73H3A5CNFSM4LCJA4MKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN6RKAQ#issuecomment-595399938,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAJ4P4L7XU353NFOCCXJSC3RF73H3ANCNFSM4LCJA4MA
.
--
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
https://brian.teeman.net/ http://brian.teeman.net/
I was offering you a way to do it right now. Might not have been perfect and definitely could be improved but you could do it today and not after upgrading to joomla 4 in 2021
In any case, it's nice to hear that someday it will be added to Joomla.
Title |
|
In any case, it's nice to hear that someday it will be added to Joomla.
If someone proposes a full patch...
When I have a menu title "The Tree - the best release ever" I want that "the best release ever" is translated but "The Tree" not.
Thus, I would use a plugin like EOR of Kubik Rubik, define 1 (if pregMatch skills) or 2 replacement rules. Soemthing like this:
[noT]
=> <span class=notranslate>
[/noT]
=> </span>
or similiar. Depends on which markup you prefer.
Then I write my title like this:
[noT]The Tree[/noT] - the best release ever
Advantage: I can use this code snippets wherever I want, also in editor text and so on. And it's more flexible.
And I can change the markup whenever I want inside the plugin if translators change again and again their proprietary rules.
Or if I only need the replacement for menu titles I add simple PHP in an override:
str_replace(['[noT]', '[/noT]'], ['<span class=notranslate>', '</span>'], $title);
and don't need the plugin.
Thank Viktor Vogel (Kubik Rubik) for his ingenious little and bigger helpers! ;-)
so we can close this as there is a 3dp for this ?
.. or an override without 3rd party if for the menu titles only
.. or an override without 3rd party if for the menu titles only
Only an option if you either want to apply it to all items consistently or maintain a ID list in the override of items it should apply to.
so we can close this as there is a 3dp for this ?
Just because an extension exists for a problem doesn't mean that core doesn't need to entertain the feature request. K2 and EasyBlog exist, can we remove com_content from core since a 3PD solution exists for content management?
If we do a patch, remains to decide which markup would be used.
class="notranslate"
or translate="no"
, default being nothing.
i guess the latter
https://www.w3.org/International/questions/qa-translate-flag#quickanswer
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-09 08:09:28 |
Closed_By | ⇒ | alikon |
@sanek4life The menu title in the example you have described is named "New Tree (as an example, a non-existent music group)". I guess your use case would be just "New Tree", right?
E.g. custom fields?
How would you deal with the appearance of the band name in one or more paragraphs of this or another article?