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

best way to build a multi-language site with smarty
Goto page Previous  1, 2, 3, 4, 5, 6 ... 13, 14, 15  Next
 
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 -> Tips and Tricks
View previous topic :: View next topic  
Author Message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Tue May 20, 2003 8:44 pm    Post subject: Reply with quote

AZTEK wrote:
The whole astalavista issue is a good example. If I didn't live in the US I wouldn't have any problem using the bablefish translations, but I do, and therefore am bound to US laws on copyright and if they say "Hey this is ours we made it don't copy what it generates" then I have to respect that.


How would you go about creating a translation file for a language you (or anyone you have access to) don't speak without 'violating' copyright?
Back to top
View user's profile Send private message Visit poster's website
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Tue May 20, 2003 8:54 pm    Post subject: Reply with quote

You don't I have a few ties to people who speak more then english and I ask them to translate phrases for me using my XML files and then they put their name at the top as translator. The file format closely follows gettext's .po only its in XML.
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
Back to top
View user's profile Send private message Visit poster's website
andreas
Smarty Pro


Joined: 22 Apr 2003
Posts: 106

PostPosted: Tue May 20, 2003 9:02 pm    Post subject: Reply with quote

or you pay money to one of these translation-engines like babelfish
or you pay money for a professional translator
or you pay money for a dictionary and and try it yourself
or you find a completly free translation-engine
...

________
Ford Tourneo Connect


Last edited by andreas on Fri Feb 04, 2011 9:01 am; edited 2 times in total
Back to top
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Tue May 20, 2003 9:04 pm    Post subject: Reply with quote

Well a professional translator is always best because all languages have a funky change somehow. Thats why I ask friends. I trust they do a good translation but in all truth I don't know.
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane


Last edited by AZTEK on Tue May 20, 2003 9:42 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Wom.bat
Smarty Pro


Joined: 24 Apr 2003
Posts: 107
Location: Munich, Germany

PostPosted: Tue May 20, 2003 9:12 pm    Post subject: Reply with quote

err... I might be wrong, but I guess it's illegal in most countries on this planet if I just provide translations done by babelfish and "sell" them as my own service or whatever...
Back to top
View user's profile Send private message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Tue May 20, 2003 9:24 pm    Post subject: Reply with quote

Wom.bat wrote:
err... I might be wrong, but I guess it's illegal in most countries on this planet if I just provide translations done by babelfish and "sell" them as my own service or whatever...


http://www.phpinsider.com/smarty-forum/viewtopic.php?t=84&postdays=0&postorder=asc&start=45#1824
Already discussed.
Back to top
View user's profile Send private message Visit poster's website
andreas
Smarty Pro


Joined: 22 Apr 2003
Posts: 106

PostPosted: Thu May 22, 2003 11:13 am    Post subject: Reply with quote

Everybody knows babelfish - translations are not very nice, but I would like to know how good/bad the different translation-engines work, so here 2 results:

Quote:
Through integration of a procurement portal and presentation of the procurement program into the existing Internet appearance, you develop an additional benefit potential of your available Internet presence

Quote:
by integration of a procurement portal and presentation of the procurement program into the existing InterNet appearance you are opened an additional use potential of your existing InterNet operational readiness level


first is from
http://www.heisoft.de/, second from babelfish(google-translation is 1:1 the same like babelfish) . Which one is the better translation, how would you change this sentence?
________
Suzuki GSX-R Series history

Last edited by andreas on Fri Feb 04, 2011 9:01 am; edited 2 times in total
Back to top
View user's profile Send private message
Escariion
Smarty Rookie


Joined: 14 May 2003
Posts: 7
Location: Berlin, Germany

PostPosted: Thu May 22, 2003 11:23 am    Post subject: Reply with quote

@AZTEK:

what if you want to translate something like this:
There {if $sessions.num ne "1"}are {$sessions.num} visitors{else}is {$sessions.num} visitor{/if} online!

this is the way i do it in my project:

XML-Language-File: lang_english.xml
(i use this config/path/var-format in all my xml-config-files, so i did not change it for language-files)

Code:
<config>
   <path name="lang">
           <var name="who_is_online">Who is online?</var>
           <var name="sessions_total">There {if $sessions.num ne "1"}are {$sessions.num} visitors{else}is {$sessions.num} visitor{/if} online!</var>
   </path>
</config>


- xml-language-file is loaded once at the beginning of the script
- lang is assigned: $smarty->assign("lang",$lang);
- there is one global language-file loaded for the framework and each module loads his own language-file

Smarty:

Code:
{eval var=$lang.sessions_total}


or if no variables have to be replaced

Code:
{$lang.sessions_total}


PHP:

Code:
getText('sessions_total')


- works, because anything that is printed to the browser is going trough the smarty-engine first
Back to top
View user's profile Send private message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Thu May 22, 2003 11:02 pm    Post subject: Reply with quote

andreas wrote:
Everybody knows babelfish - translations are not very nice, but I would like to know how good/bad the different translation-engines work, so here 2 results:

Quote:
Through integration of a procurement portal and presentation of the procurement program into the existing Internet appearance, you develop an additional benefit potential of your available Internet presence

Quote:
by integration of a procurement portal and presentation of the procurement program into the existing InterNet appearance you are opened an additional use potential of your existing InterNet operational readiness level


first is from http://www.heisoft.de/, second from babelfish(google-translation is 1:1 the same like babelfish) . Which one is the better translation, how would you change this sentence?


Well the first definatly looks better, but I think this thread was more concerned with the implementation of multilanguage support rather than translation engines.
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu May 22, 2003 11:09 pm    Post subject: Reply with quote

Quote:
I think this thread was more concerned with the implementation of multilanguage support rather than translation engines.


I'm starting to think that translations is proving to be a topic that encompasses enough material to warrant a forum in its own right. All of the related topics could be collected there and long threads like this one can be split up.

Ideas?
Back to top
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Fri May 23, 2003 3:10 am    Post subject: Reply with quote

Escariion wrote:
@AZTEK:

what if you want to translate something like this:
There {if $sessions.num ne "1"}are {$sessions.num} visitors{else}is {$sessions.num} visitor{/if} online!

this is the way i do it in my project:

XML-Language-File: lang_english.xml
(i use this config/path/var-format in all my xml-config-files, so i did not change it for language-files)


You would have to have two seperate entries. Then use an if to decide which one to use.

Code:
{if $sessions.num != "1"}
    {trans d=$sessions.num}are %d visitors{/trans}
{else}
    {trans d=$sessions.num}is %d visitors{/trans}
{/if}


For your tpl and

Code:
<?xml version="1.0" encoding="utf-8" ?>
<locale lang="de">
   <header>
      <project>Project Name</project>
      <create>2003-01-12 17:24-0500</create>
      <revise>2003-01-15 19:15-0500</revise>
      <trans>Your Name - Your Email</trans>
      <lang>Deutsch</lang>
   </header>
   <message>
      <id>are %d visitors</id>
      <string>%d Besucher sind</string>
   </message>
   <message>
      <id>is %d visitor</id>
      <string>%d Besucher ist</string>
   </message>
</locale>


for your de.xml file (its been way to long since german class for me to even think those translations are remotely correct). I am sure the a system would be easy to adapt to your style of structure though.
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
Back to top
View user's profile Send private message Visit poster's website
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Fri May 23, 2003 3:58 pm    Post subject: Reply with quote

boots wrote:
I'm starting to think that translations is proving to be a topic that encompasses enough material to warrant a forum in its own right. All of the related topics could be collected there and long threads like this one can be split up.
Ideas?


Nah; bad idea. Over time it'll just turn into an unused forum. I think keeping this thread here is fine.
Back to top
View user's profile Send private message Visit poster's website
thuree
Smarty n00b


Joined: 29 May 2003
Posts: 3

PostPosted: Thu May 29, 2003 6:04 am    Post subject: Localization - Best strategy - Advice wanted? Reply with quote

Hej,

I am about to re-design a website (www.huaruichemicals.com) and this time I want to make sure I am using the correct strategy and tools.

This web site will mainly consist of static pages, but the news section will be dynamic (preferably updatable from the web).
I will need to have the website available in English, Chinese, and Swedish.
To start with anyway.

I have been considering using Smarty to separate the code from the design. But I want my pages to be in strict XHTML.
Another solution is to use XML/XSL (which I will have learn from scratch).

I want to use CSS (or similar) to keep the formatting away from the HTML code.

I am considering a database (MySQL), or XML, or gettext for the various language strings.

Would very much like to receive some hints and tips from the "experts" in this forum.

Thanks in advance

/Bengt
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu May 29, 2003 6:20 am    Post subject: Reply with quote

Quote:
Would very much like to receive some hints and tips from the "experts" in this forum.


hmmm. Quotations around 'experts' ? Someone please remind me: is that good or bad?

Very Happy
Back to top
View user's profile Send private message
thuree
Smarty n00b


Joined: 29 May 2003
Posts: 3

PostPosted: Thu May 29, 2003 6:29 am    Post subject: Reply with quote

Very Happy
Sorry for confusing...
Anyway, since all in this forum is most likely more experienced than I am then all are in my opinion experts.... then again, some I am sure of it, are more experts than others...
I only know for a fact, that I do not belong in the "expert" classification Sad ... yet Smile
/Bengt
Back to top
View user's profile Send private message Visit poster's website
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 -> Tips and Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6 ... 13, 14, 15  Next
Page 5 of 15

 
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