Hi
im asking about good ideas of developing multilingual websites
i can save articles in db and there is a column called lang which has language value and load data based on a url parameter
this is my small idea
any other good ideas ?
the second question what is i have already a one language website and i want to develop it to accept more languages?
thanks in advance.
any ideas for developing multilingual websites
Moderator: General Moderators
Re: any ideas for developing multilingual websites
You can create a separate table for your language text.
For each block of english text, you can enter its other-language equivalent.
Only problem is, you got to enter the equivalent for all such block, which can be huge if you have a large database of translations. For non-english characters, store their html-entity codes.
Code: Select all
CREATE TABLE IF NOT EXISTS `language strings` (
`StringID` bigint(20) NOT NULL auto_increment,
`English` varchar(255) NOT NULL default '',
`French` text NOT NULL,
`Spanish` text NOT NULL,
`German` text NOT NULL,
PRIMARY KEY (`StringID`),
UNIQUE KEY `English` (`English`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1';Only problem is, you got to enter the equivalent for all such block, which can be huge if you have a large database of translations. For non-english characters, store their html-entity codes.
Re: any ideas for developing multilingual websites
do you mean that html entities are less in size that the actual representation that the actual characters of non English text?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: any ideas for developing multilingual websites
I often just create subdirectories for templates for each language like:
Then when they pick the language you insert the language code into the path when loading.
Code: Select all
templates/
template/EN/
template/ES/
template/FR/(#10850)
Re: any ideas for developing multilingual websites
It should be the same in size I guess.seco wrote:do you mean that html entities are less in size that the actual representation that the actual characters of non English text?
If you can store non-english characters directly, then your mysql-interface supports unicode. Internally, its still stored as html-entity-code.
Re: any ideas for developing multilingual websites
thanks for reply
arborint says a solution that create templates for each language and then choose the appropriate one
but my content is all dynamic i mean i load the data from db does your way for dynamic contents
would you mind clarify your way
thanks in advance.
arborint says a solution that create templates for each language and then choose the appropriate one
but my content is all dynamic i mean i load the data from db does your way for dynamic contents
would you mind clarify your way
thanks in advance.
Re: any ideas for developing multilingual websites
Its mostly done that way as loading time is minimized.arborint says a solution that create templates for each language and then choose the appropriate one
But if you have article content in a database and want to display a translated version of the article, then one way is to store the translations into the database too.
For smaller strings, you can store its translation into the database too, but your loading time would be much higher as you would end up making many queries to extract the translation text. Using cached results from the db-table is a good idea.