Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

i18n

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
McSodbrenner
Smarty Pro


Joined: 19 Sep 2004
Posts: 101
Location: Hamburg, Germany

PostPosted: Fri Nov 26, 2004 9:14 am    Post subject: i18n Reply with quote

Hi,
ich hab ein größeres Projekt, dass ich von Usern übersetzen lassen möchte, ohne das die natürlich etwas vom PHP-Quelltext sehen. Jetzt weiß ich nicht so ganz wie ich da rangehen soll.

1. Die Templates zu übersetzen wäre ja eine Möglichkeit, aber da dort ja auch gewisse Logik drin ist (wenn auch nur Smarty-Logik), will ich da keine User heranlassen. Sie sollen nur bestimmte Strings übersetzen können.

2. In die Templates verschiedene Sprachen einfließen zu lassen ist ja kein Problem, aber es gibt ja auch im PHP-Code Sprachschnipsel (E-Mail-Versand usw.)... wie handelt man das Problem.
Vielleicht Funktionen schreiben, die E-Mails aus dem Template heraus versenden?

Wie macht ihr das? Habt ihr schon verschiedene Varianten ausprobiert?
_________________
Grüzi, Smile
Christoph

My sweet home: www.webboarder.de
Do not visit!! It is private!! And it's mine!
Back to top
View user's profile Send private message Visit poster's website
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Fri Nov 26, 2004 9:52 am    Post subject: Reply with quote

Wenn du englisch kannst, könntest mal da reinschauen:
http://www.phpinsider.com/smarty-forum/viewtopic.php?t=84

Ich würde in Smarty statt den Texten Variablen nehmen und diese je nach Sprache aus einem XML File erstellen lassen. Für den User könntest du dann ja eine Art Online XML Eingabe machen.

Habe sowas selbst aber noch nie in PHP/smarty gemacht.

mfg Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
McSodbrenner
Smarty Pro


Joined: 19 Sep 2004
Posts: 101
Location: Hamburg, Germany

PostPosted: Fri Nov 26, 2004 10:40 am    Post subject: Reply with quote

Danke, hab mir das mal angeschaut. Für mich sah die XML-Variante auch am besten aus, gerade in Hinblick auf UTF-8. Auch die Lösung mit dem Prefilter ist sehr gut.
Aber das ist ja leider nur die eine Hälfte. Das Problem ist ja noch, dass es ja teilweise Sprachschnipsel im PHP-Code gibt... wie kann man das nur lösen? *grübel*
_________________
Grüzi, Smile
Christoph

My sweet home: www.webboarder.de
Do not visit!! It is private!! And it's mine!
Back to top
View user's profile Send private message Visit poster's website
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Fri Nov 26, 2004 1:02 pm    Post subject: Reply with quote

nun ja, eigentlich sollte man ja die Sprachschnippsel in PHP vermeiden, aber manchmal ists halt schon umständlich - besonders wenn man ned im Vorhinein darüber nachdenk was mal daraus werden könnt Wink

Es sollte aber auch kein Problem sein von PHP aus auf die XML Dateien zuzugreifen, denke ich.

mfg Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
lewian
Smarty n00b


Joined: 02 Dec 2004
Posts: 1

PostPosted: Thu Dec 02, 2004 11:26 am    Post subject: Reply with quote

Hi,

wenn Du auf einer Linuxbox arbeitest, dann solltest Du PHP mit gettext() verwenden.
Da hast Du dann eine große Datei pro Sprache, wo die komplette Übersetzung drinsteht.
Nach dem Format:

$language["NAME"] = "Herbert";
$language["STADT"] = "ULM";

usw.

gettext() nimmt dann jeweils die Datei/Sprache die angefordert wird.
http://www.flashbattle.de/forumv2/thread.php?threadid=4635&sid=079c074226f8bdc351923a084e144bcd

Hoffe es hilft.
Gruss Andi
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP