473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Multilanguage Webseite - Include Text

I want to include a block of text in my homepage, which will be in the
corresponding language depending of the chosen language. I would like
to use something like the files.properties that I have seen in Java. Is
there something similar in PHP?
Any idea will be welcome!
Thanks.
Bettina

www.coaster.ch

Jul 17 '05 #1
4 1506
There is multi-language extensions in PEAR but there is also a pretty
easy way to do it yourself...

Create all text into an array that uses a certain language. Create a
file for each language to keep the variable space down etc...

Mike
I want to include a block of text in my homepage, which will be in the
corresponding language depending of the chosen language. I would like
to use something like the files.properties that I have seen in Java. Is
there something similar in PHP?
Any idea will be welcome!
Thanks.
Bettina

www.coaster.ch

Jul 17 '05 #2
I don't understand exactly what do you mean. In the array I would have
the texts in the different languages? Do you mean with files, php files
or inc files. What would I store in these files?

Jul 17 '05 #3
be*****@coaster.ch wrote:
I don't understand exactly what do you mean. In the array I would have
the texts in the different languages? Do you mean with files, php files
or inc files. What would I store in these files?


Here is a plain example....

create files with whatever extension you like...

en-us.php for example:

$lang['name_you_want_to_reference_by'] = 'This is what I want to
reference by!';
then you can just put all of the languages in variables like that and
only include the file you need for your languages.

Mike
Jul 17 '05 #4
What about using a big list of defines instead of an array. That is how
it is done in Mambo and a bunch of other php programs. What are the
preformance tradeoffs?

Thanks,
Peter

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mariano López | last post by:
I'm trying to make a multilanguage website. When the user enters the site, I want to detect the language and automatically make a redirection. How can I do this? And how should I organize my data...
0
by: Giovane Calabrese | last post by:
ok. im try to make a multilanguage system based on that tutorial : http://www.123aspx.com/redir.aspx?res=29112 in my aspx pages all text are in labels , and i want to take the name labels...
8
by: Aftab Alam | last post by:
Hello All I wanted to know that how can I build an application which takes arabic or urdu input I mean when I type something in my applications edit box it writes arabic. please do let me know...
1
by: | last post by:
Could you be more precise? Do you want to print a pre- defined text or random text? Do you want the user to select it, or look it up in the regional settings of windows? >-----Original...
5
by: Michal Táborský | last post by:
I am wondering, if it's effective to use text arrays to store multilanguage information. We used to do it like this: CREATE TABLE product ( id serial NOT NULL, price float4, ... )
2
by: Pitaridis Aristotelis | last post by:
I would like to make a multilanguage project such a way that I will be able to give a sample text file to various pepole around the world in order to translate it in various language. How can I...
6
by: Pawe³ Piotrowski | last post by:
Hi! What are the best practises when building WebService supporting multilanguage users? For example, when WebService checks some business rules and returns message to the user. Best regards ...
15
by: AG | last post by:
I have seen the samples for multilanguage support regarding what is normally static content. Can anyone point me to a good sample for multilanguage support for dynamic content. Like a gridview...
1
by: paolob | last post by:
I need to provide multilanguage support to my application. I alredy writed a multilanguage test application, using VS6 and resource only dll. Now i'm using Visual Studio 2005, I find out that it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.