Hi
@all
(in "
the MotherForum" as they call it in the german one)
... I'm still from there and now hoping my english isn't to brackish otherwise please try to have fun with it!
At that I'm a newcomer in AHk and thus a little shy. Nevertheless ...
The reason to overbear my timidity and to do (my first) poste here is this loveley lil "
Sparrow" developed by
derRaphael.
In addition to my quirks above I realy like the spanish language (and try to learn it) so I took that Script
^^ of dR to add (something like) español to it.
My questions:
- are those phrases more or less OK (comments / improvements are desired) for to make it "well-dressed" for spanish eyes?
- is this modified script runing also on your system?
I've had tested it only on: |> OS: XP sp3, Browser: Iron (= googleChrome without ears)
(and because of dR asked for some screenshots) Well, for to get an impression:
Code:
<html>
<head><title>HKML Multiple Language 4</title></head>
<body>
<?ahk
; Sparrow Example for usage of $_GET variable and multiLingual text
; Here we have three translated blocks of text and one is available in English and German only
; Hier haben wir drei übersetzte Textblöcke, von denen einer nur auf English und Deutsch verfügbar ist.
; Block 1
head_b1[deDE] := "Hallo Welt"
head_b1[enUS] := "Hello world"
head_b1[frFR] := "Bonjour tout le monde!"
head_b1[esES] := "¡Hola mundo!"
text_b1[deDE] := "Ich bin ein Beispiel für Text in deutscher Sprache."
text_b1[enUS] := "I am an example for text in English."
text_b1[frFR] := "Je suis un exemple pour le texte en français."
text_b1[esES] := "Soy un ejemplo para un texto en español."
; Block 2
head_b2[deDE] := "Beispiel"
head_b2[enUS] := "Example"
head_b2[frFR] := "Exemple"
head_b2[esES] := "Ejemplo"
text_b2[deDE] := "Text für Freunde der AHK Syntax in HTML."
text_b2[enUS] := "Text for friends of the AHK-syntax in HTML."
text_b2[frFR] := "Texte pour les amis de la AHK-syntaxe HTML."
text_b2[esES] := "Texto para los amigos de la sintaxis de AHK en HTML."
; Block 3
head_b3[deDE] := "FailOver Beispiel"
head_b3[enUS] := "FailOver example"
text_b3[deDE] := "Diesen Text gibt es nicht auf Französich oder Spanisch."
text_b3[enUS] := "This Text is not available in French or Spanish."
; ******************************************************************************************
; Evaluate the possible Languages / Auswerten der möglichen Sprachen
; Possible Language / Mögliche Sprachen
AvailLng := "deDE,Deutsch|enUS,English|frFR,Français|esES,Español"
; Define Standard / Standard definieren
if (!(IsSet($_GET[lng])) || !(RegExMatch(AvailLng,$_GET[lng]))) {
$_GET[lng] := "enUS"
}
; prepare list / Liste vorbereiten
TmpLng := RegExReplace(AvailLng "|", ",[^\|]+") ; remove Descriptor / Beschreibung entfernen
lngLst := RegExReplace(TmpLng, $_GET[lng] "\|") ; remove TargetLang / Zielprache entfernen
lngLst := SubStr(LngLst,1,-1) ; remove trailing |-Symbol / angehängtes |-Symbol entfernen
; setup LangChooser links / SprachwahlLinks vorbereiten
Loop,Parse,lngLst,|
{
RegExMatch(AvailLng,"(?P<LNG>" A_LoopField "),(?P<Desc>[^\|]+)",Chooser)
echo("<a href=""" $_SERVER[REQUEST] "?lng=" ChooserLNG """>" ChooserDesc "</a> ")
}
echo("<br>")
if (!IsSet($_GET[failOver]))
FailOverLanguage := "enUS"
else
FailOverLanguage := $_GET[failOver]
; Print out our page / Ausgabe unserer Seite
Loop,3 {
head_b%A_index% := head_b%A_index%[%$_GET[lng]%]
if (StrLen(head_b%A_index%)=0)
head_b%A_index% := head_b%A_index%[%FailOverLanguage%]
text_b%A_index% := text_b%A_index%[%$_GET[lng]%]
if (StrLen(text_b%A_index%)=0)
text_b%A_index% := text_b%A_index%[%FailOverLanguage%]
echo("<h2>" head_b%A_index% "</h2>")
echo("<p style=""margin-left:2em;"">" text_b%A_index% "</p>")
}
?>
</body>
</html>
If u want to u can also view a translation of the documentation into an improved
german version for the actual 0.1.3 Sparrow
°digit°_____ò;Ó?__|:: thx for your attention and have a nice day!
_________________
.::
::. just an AHk greenhorn ...