473,748 Members | 2,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

More than one language in a page

What is the correct way to mark up, say, a div or p, to indicate
that it is in a different language to the main page? Are there
any potential pitfalls with different browsers associated with
doing this? If it makes any difference, this is in reference to
a page in mixed English and French:
http://www.chem.utoronto.ca/IChO.Ontario/index.html
Oct 21 '08 #1
21 1951
On 2008-10-21, David Stone <no******@domai n.invalidwrote:
What is the correct way to mark up, say, a div or p, to indicate
that it is in a different language to the main page?
You just do <div lang="en"etc. What browsers actually do with that
lang attribute is not so clear. In most cases probably nothing, although
it may influence choice of font in some.

Most fonts I've seen that are used for English will also contain all the
glyphs needed for French anyway.

I don't know if aural renderers use it to influence choice of speech
synthesizer. I doubt it, but you never know.
Are there any potential pitfalls with different browsers associated
with doing this? If it makes any difference, this is in reference to a
page in mixed English and French:
http://www.chem.utoronto.ca/IChO.Ontario/index.html
Oct 21 '08 #2
Ben C wrote:
You just do <div lang="en"etc. What browsers actually do with that
lang attribute is not so clear. In most cases probably nothing, although
it may influence choice of font in some.
Well, some languages display right-to left so the difference there
should be significant. I believe that there are also spacing issues
around some punctuation, and word-splitting issues as well. Of course,
it's all down to the care with which the browser was coded.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Oct 22 '08 #3
On 2008-10-22, Swifty <st***********@ gmail.comwrote:
Ben C wrote:
>You just do <div lang="en"etc. What browsers actually do with that
lang attribute is not so clear. In most cases probably nothing, although
it may influence choice of font in some.

Well, some languages display right-to left so the difference there
should be significant.
For that you've got to use dir=rtl or "direction: rtl". lang=ar by
itself won't make any difference.
I believe that there are also spacing issues around some punctuation,
and word-splitting issues as well. Of course, it's all down to the
care with which the browser was coded.
I haven't seen lang making a difference, but perhaps it should. Some
browsers use something based on Unicode Annex 14 for line-breaking, and
language is not involved in the algorithm they describe there.

See also http://www.cs.tut.fi/~jkorpela/unicode/linebr.html
Oct 22 '08 #4
On Wed, 22 Oct 2008, Ben C wrote:
For that you've got to use dir=rtl or "direction: rtl". lang=ar by
itself won't make any difference.
But the use of Arabic script should make a difference without the need of
specifying the writing direction.
I believe that there are also spacing issues around some punctuation,
and word-splitting issues as well. Of course, it's all down to the
care with which the browser was coded.
One example could be the interpretation of a quote symbol like <q>:

<p lang="en">The word <q><span lang="fr">chef</span></qis of French origin.</p>

should be rendered as

The word ``chef´´ is of French origin.

whereas the (incorrect)

<p lang="en">The word <span lang="fr"><q>ch ef</q></spanis of French origin.</p>

as

The word « chef » is of French origin.

--
Helmut Richter
Oct 22 '08 #5
Helmut Richter schreef:
On Wed, 22 Oct 2008, Ben C wrote:
>For that you've got to use dir=rtl or "direction: rtl". lang=ar by
itself won't make any difference.

But the use of Arabic script should make a difference without the need of
specifying the writing direction.
>>I believe that there are also spacing issues around some punctuation,
and word-splitting issues as well. Of course, it's all down to the
care with which the browser was coded.

One example could be the interpretation of a quote symbol like <q>:

<p lang="en">The word <q><span lang="fr">chef</span></qis of French origin.</p>

should be rendered as

The word ``chef´´ is of French origin.
You mean

The word “chef” is of French origin.

:-p
H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
=============== ===
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Oct 22 '08 #6
On 2008-10-22, Helmut Richter <hh***@web.dewr ote:
On Wed, 22 Oct 2008, Ben C wrote:
>For that you've got to use dir=rtl or "direction: rtl". lang=ar by
itself won't make any difference.

But the use of Arabic script should make a difference without the need of
specifying the writing direction.
It will make a difference but it won't be quite right in all
circumstances.

For a simple Arabic string it will be OK (although left-aligned), but if
you've got Roman characters embedded in there, the bidi base direction
will be wrong.

You can see the result of bidi base direction if you try an example like
this:

<div dir="rtl">
ARABIC hello
</div>

which should appear as "hello CIBARA"

<div dir="ltr">
ARABIC hello
</div>

which should appear as "CIBARA hello".

I'm using capitals to mean strongly right-to-left characters-- of course
you'd need real Arabic in the example for it to work.

Unicode Annex 9 defines three bidi base directions: left-to-right,
right-to-left and neutral.

In HTML and CSS specifications you get left-to-right unless you specify
dir or direction respectively to get right-to-left. You can't have
neutral (except perhaps in a textarea or input).
I believe that there are also spacing issues around some punctuation,
and word-splitting issues as well. Of course, it's all down to the
care with which the browser was coded.

One example could be the interpretation of a quote symbol like <q>:

<p lang="en">The word <q><span lang="fr">chef</span></qis of French origin.</p>

should be rendered as

The word ``chef´´ is of French origin.

whereas the (incorrect)

<p lang="en">The word <span lang="fr"><q>ch ef</q></spanis of French origin.</p>

as

The word « chef » is of French origin.
Yes and there is stuff in CSS to do all that-- see the "quotes"
property, content: open-quote, and lang pseudos in CSS 2.1.

Not sure if any of the browsers actually implement all that stuff
though.

I think Korpela recommends just type the quote characters you want and
don't bother with <qbut I hope I'm not misquoting him [pause for
groans].
Oct 22 '08 #7
On Wed, 22 Oct 2008, Stefan Ram wrote:
(However, »chef« as used above actually is the English
word (because it is said that it was of french origin),
and so it should not be marked as french.

The English word »chef« is of french origin.

The French word »chef« is not of french origin, it /is/ french.)
Right. I should have taken better example.

--
Helmut Richter
Oct 22 '08 #8
On Wed, 22 Oct 2008, Hendrik Maryns wrote:
Helmut Richter schreef:
One example could be the interpretation of a quote symbol like <q>:

<p lang="en">The word <q><span lang="fr">chef</span></qis of French origin.</p>

should be rendered as

The word ``chef´´ is of French origin.

You mean

The word «chef» is of French origin.
No.I meant what I wrote.

1) When the quotes are in the outer text, they are English. These are also the
correct quotes (at least according to German quote rules where the *outer*
language determines the form of the quotes at least as long as the quoted
text is not a paragraph of its own).

2) Guillemets are used with a space to the enclosed text:

« chef »

In German, they are sometimes used the other way round without spaces
instead of other quotes:

»chef«

--
Helmut Richter
Oct 22 '08 #9
Helmut Richter schreef:
On Wed, 22 Oct 2008, Hendrik Maryns wrote:
>Helmut Richter schreef:
>>One example could be the interpretation of a quote symbol like <q>:

<p lang="en">The word <q><span lang="fr">chef</span></qis of French origin.</p>

should be rendered as

The word ``chef´´ is of French origin.
You mean

The word «chef» is of French origin.

No.I meant what I wrote.
This is interesting. I did not type «» (i.e. guillemets) at all. I
actually typed “” (i.e. proper curly open and close quotes); it seems
like your newsreader has interpreted them as guillemets anyway. Funny.
I suppose you (or me?) have an encoding problem.

H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
=============== ===
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Oct 22 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
17707
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
22
2324
by: bearophile | last post by:
Ville Vainio: >It's highly typical for the newbies to suggest improvements to the >language. They will usually learn that they are wrong, but the >discussion that ensues can be fruitfull anyway :-). Few more notes on the language. I don't know if I can really suggest improvements to the language... but I hope to learn something :-) I think some things are better in Delphi/Pascal (like the := for assignments instead of = and = for...
11
1597
by: Adonis | last post by:
What I do not understand, or not clear to me I should say, is how can some people regard Python as a scripting language? In particular the JAVA crowd. Unless my understanding is off, and from what I can gather from googling, is that Python is compiled implicitly into bytecode then read into the interpreter, and in JAVA you must compile explicitly before it is interpreted, both have virtual machines, so why such a label since there is...
5
3748
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the following code fragments in which I want to list through all files on a directory with a link to download each file by passing a filename and whether or not to force the download dialog box to appear.
5
1800
by: Marc Violette | last post by:
<Reply-To: veejunk@sympatico.ca> Hello, I'm hoping someone can help me out here... I'm a beginner ASP.NET developper, and am trying to follow a series of exercises in the book entitled "Microsoft ASP.NET Step By Step" by Microsoft Press. When I try to display *any* ASP.NET page with a Sub() somewhere, I get the following error:
10
2445
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and load as a 3rd partial class. This would be handy so i can generate standard code into one of the partial classes, while having my custom code untouched
3
2959
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
5
2826
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
We have a page that is loading very slow. There is not a lot of data, not a lot of users are connected at the same time and the page does not produce an error, so I am not sure where to start to look for why it is slowing down. I thought about the DB first and added NOLOCK to a couple of stored procedures that were being run, but with no effect. Can someone offer some tips on where to start looking or how I can begin to diagnose this...
0
1401
by: xirowei | last post by:
I try to search information from many websites, but what i can found is they only demonstrate the example with ONE ATTRIBUTE in a Cookie only. What i want is how to set more than 1 attribute in a same cookie? Below is my code: currently i only can show the username but cannot show the age. How to enable the ShowCookie.jsp able to show both the attribute of "username" and "age" enter by User? GetValue.jsp <%@ page language="java" %>...
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.