Typography rules in different languages

Started by spirulez, May 10, 2005, 09:55:51 AM

Previous topic - Next topic

spirulez

(An English translation can be found after this post...)

Salut


Comme je l'avais signalé sur SMF-Fr (ici), au contraire de l'anglais, en français les signes de ponctuation composés (un point et une virgule par exemple) sont précédés d'un espace insécable et suivis d'un espace sécable. Il est possible que ça existe dans d'autres typo étrangères et c'est pourquoi je poste dans le sous-forum des langues, qu'on se mette tous d'accord à l'international ;)


Si bien qu'en anglais on écrit en html :

  • Name: John
Et en français, en html :
  • Nom : Jean

Il suffirait d'intégrer directement les ":" ou les " :" dans les packs de langue.
Exemple dans Profile.french.php :
Cherchons :
$txt[420] = 'Âge';
Ce qui donne ---------------------> Âge

Remplacer par :
$txt[420] = 'Âge'; :
Ce qui donnerait -----------------> Âge : (avec un espace derrière, ou sans, c'est à voir)

Faire la mm chose pour le pack de langue anglaise avec les doubles-points collés :
$txt[420] = 'Age: ';

Du coup, dans Profile.template.php il suffirait d'alléger le code :
Chercher :
<b>', $txt[420], ':</b>

Remplacer par :
<b>', $txt[420]</b>

Ca peut se faire rapidement sous Dreamweaver.

Il y aurait une autre possibilité encore. Imaginons qu'une variable "Remplacer" soit tantôt combinée avec un ":" tantôt avec un "?" (je sais pas s'il y a des cas dans SMF)
(j'envisage le pire des cas, hein !)

Il suffirait de déclarer d'autres variables dans les fichiers de langues, par exemple dans Profile.french.php :
$txt[349] = 'Langue pr&eacute;f&eacute;r&eacute;e';
$txt[':'] = '&nbsp;: ';
$txt['?'] = '&nbsp;? ';
$txt['!'] = '&nbsp;! ';
$txt[';'] = '&nbsp;; ';


Et en anglais :
$txt[349] = 'Preferred Language';
$txt[':'] = ': ';
$txt['?'] = '? ';
$txt['!'] = '! ';
$txt[';'] = '; ';


Si bien que dans le template on aurait suivant les cas :
$txt[349].$txt[':']
$txt[349].$txt['?']
$txt[349].$txt['!']
$txt[349].$txt[';']

Ce que ça donnerait dans un bloc de Profile.template.php par exemple :
ancien bout de code (118 caractères) :
echo '
<tr>
<td width="40%"><b>', $txt[349], ':</b></td>
<td>
<select name="lngfile">';


Nouveau bout de code (9 caractères de plus côté serveur) :
echo '
<tr>
<td width="40%"><b>', $txt[349].$txt[':'], '</b></td>
<td>
<select name="lngfile">';


Et ça s'afficherait parfaitement suivant la ponctuation en vigueur dans nos différentes (et belles) langues qu'on se doit de préserver ;D

Bien entendu, je veux bien aider et participer activement à l'amélioration de SMF.

Longue vie à SMF International 8)
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

Alexandre P.

Here is an approximative translation of above post:
Quote from: spirulez on May 10, 2005, 09:55:51 AM
Hi


Like I did mention on SMF-Fr (here), in contrary to English, in French composed ponctuation symbols (a semicolon [;] or a question mark [?], for example) are precessed by a non-breaking space.  It is also possible that such a typography exists in other languages, that's why I'm posting this in the Language Specific sub-board ;)


If in English we write in HTML, for example:

  • Name: John
in French, we have to add a non-breaking space before the colon:
  • Nom&nbsp;: John

What could be done to perfectly match such a typography rule is to always insert punctuations inside the languages strings (instead of directly in template files).
Let's take an example, from Profile.[french/english].php.
Search for:
$txt[420] = '&Acirc;ge';
This will render ---------------------> Âge

Instead, add the colon symbol in this string:
$txt[420] = '&Acirc;ge;&nbsp;: ';
This would render -----------------> Âge :

This also have to be done in the English language file.  But for this one, there won't be any non-breaking space before the colon (since this is the typo rule in English):
$txt[420] = 'Age: ';

And in the template file, Profile.template.php, the colon would have to be removed from the source code:
Search for:
<b>', $txt[420], ':</b>
Replace by:
<b>', $txt[420], '</b>

This is something that can easily be done under Dreamweaver.



Maybe there could also be another possibility for integrating such a feature.  New language strings could be added to language files for punctuation signs:
For French:
$txt[':'] = '&nbsp;: ';
$txt['?'] = '&nbsp;? ';
$txt['!'] = '&nbsp;! ';
$txt[';'] = '&nbsp;; ';

For English:
$txt[':'] = ': ';
$txt['?'] = '? ';
$txt['!'] = '! ';
$txt[';'] = '; ';


And in template files (let's take the same example as the precedent one):
<b>', $txt[420], $txt[':'], '</b>

And that would perfectly match the different typography rules in effect in different languages, something that has to be kept in my opinion ;D

Of course, I'm willing to help to get something like this done to ameliorate SMF.

Long live SMF International 8)

I guess I have to tell my opinion on this:

I think this idea is... interesting.  Because that's true: maybe other language do have some typo rules which are different from the English typo.  The first proposition (integrating all punctuation signs in lang strings) might be a good idea.  It may be long to change every template and language file, though...

The other idea (adding new lang strings for punct. signs) has also some kind of potential, IMO.  But will templates designers adopt this new way to print those symbols?  And what about signs that don't exist in French or English but do exist in other languages (like the [¿] or the [¡] in Spanish)?  How could we be sure to get an exhaustive list of all those signs?

But for now I leave the coders and translators deliver their opinion...
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

spirulez

#2
Thank you a lot Alexandre ;)

I hope that the next version 1.1 of SMF will integrate these modifications and will take ascending on the majority of boards which often also make and increase this kind of small error.

Good work guys, I adore SMF and I am one of the new disciples :P

Have a nice day (30°C in France today 8))

(BabelFish translation, sorry :D)



J'espère que la prochaine version 1.1 de SMF  intégrera ces modifications et prendra un ascendant sur la plupart des forums qui souvent aussi commettent ce genre de petite d'erreur.

Bon travail les gars, j'adore SMF et j'en suis un des nouveaux disciples.
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

spirulez

#3
(edit :-X)
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

[Unknown]

Why can't, for example, $txt[489] look like this in French:

$txt[489] = 'Total Posts&nbsp;';

No colon, but the space is there.  I believe Dutch is the same way in this regard.

-[Unknown]

spirulez

Sure, it's a pretty good idea. It'll works in french I think and perhaps with all strings. So the modifications must be report by translator packagers.

For spanish we can imagine for a question this kind of code :
$txt[489] = '&iquest;&nbsp;<spanish_translation for Total Posts>&nbsp;';

How worked this methode for other languages ?
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

spirulez

#6
Arf, in Seach.template.php there is :
$txt['search_relevance'], ': '

In the same file :
<td width="6%" align="center">', $txt['search_relevance'], '</td>
It isn't the the only case, in fact.

So variable strings are employed sometimes with ": " sometimes without.

It isn't really pretty to see a orphan &nbsp;
::)

Just a remarque : it's so quick and clean to research in php files :
, ": ",
and remplace by :
, $txt[':'], and put this variable in all language packages.

Five minutes to do the modification for ALL LANGUAGES. Better than mondialisation   but in respect. A one time job.


;D

Must we do a referendum ? :P
(joke)

What do you think about ?
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

spirulez

Ca en est où Alexandre et Unknown ? On bougera rien pour la prochaine version ? :o
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

[Unknown]

I'd rather replace $txt['search_relevance'] with $txt['search_relevance_prompt'] and $txt['search_relevance'] than add a $txt[':'].

-[Unknown]

spirulez

It's a solution... the mine is quicker but yours perhaps more elegant ;)
But how many other new txt variables ? Many.

I hope a solution for the next release. Possible ? ;D
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

Advertisement: