Locale in PHP for multi language site [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Im new to PHP and im building a site that need to be with multi language support, can some one tell me is there any best functions to achieve/convert one language content to another in php?

Well: "How long is a piece of string?" comes to my mind as a similar question. ;-)
No, basically you need to parameterize all your messages and text content and make it available in both languages. This can be done by having two (possibly associative) arrays between which you can switch using a language key (in this example it is the first index: 0:English, 1:German):
For example:
$msg=array( // first language English
array( 'login'->'Please enter your user name',
'bye'->'Thank you for visiting this site').
// then a second language (German)
array( 'login'->'Bitte egeben Sie Ihren Benutzernamen ein',
'bye'->'Vielen Dank für Ihren Besuch')
// and possibly other languages to follow ..
//,array( 'login'->'...'),'bye'->'...')
);

Related

PHP duplicate content detection system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Are there any popular PHP libraries or services that can help detect duplicate content?
I run a site that has user generated content and I want to detect content that are similar or duplicated. Are there any popular libraries out there that can help with this?
Text similarity/plagiat/duplicate is a big topic. There are so many algos and solutions.
Some projects use the "adaptive local alignment of keywords" (you will find info on that on google.)
Also, you can check this (Check the 3 links in the answer, very instructive):
Cosine similarity vs Hamming distance
Hope this will help.

Generate Random Sentence [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to create random sentences. I can't create any lists or populate anything myself. I will end up asking questions that analyze the sentence's words.
I don't understand how to use PHP to arrange verbs and nouns to create complete sentences.
I'm not asking for an external reference, just how to use PHP to generate random sentences.
Is it possible to grab a sentence of a web page and test to see if it is grammatically correct?
Thanks!
On this site you will get your wordlists. If you separately load them into your database, you can save the part of speech too.
Simple english grammar helps you building the sentence ;)
Oh, I'm sorry. Did not read that you want meaningful sentences.
You can use the tips above to check the grammar of the sentences too ;)

Looking for language translation function for PHP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I would like to add language translation to my site. Is there any freeware (or at least inexpensive packages for a one-time fee) that will work more-or-less like this:
$french_text = translate ($german_text, 'german', 'french');
I don't expect it to support every language in the world, but to be useful it should at least support most European languages. Also, being an English site, it's acceptable to me if it needs to use English as an intermediate language like this:
$english_text = translate ($german_text, 'german', english');
$french_text = translate ($english_text, 'english', 'french');
Does anything like this exist for PHP?
You've got mainly two options (that i know of, theres probably a ton more).
You've got PHPs intl stuff, or you can use the Google Translate API

Replacing server-side language by JavaScript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I would like to know if it is possible to replace a server side language (PHP, C#, Java EE, etc) by JavaScript to do the same work (accessing a database, using sessions, etc).
I hate PHP the more I use it, I'm too lazy to learn the EE part of Java, and I don't know C#, and since I like JavaScript, I'd like to use it for that.
Is it possible / doable ? If yes, can you point me into the right direction to get the required software ?
Thanks for your help !
You should have a look at Node.JS... It is basically server side Javascript.
http://nodejs.org/

Batch code indenters and beautifiers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Does anyone here know of good batch file code indenters or beautifiers?
Specifically for PHP, JS and SGML-languages.
Preferably with options as to style.
The following page has code on it to tidy Javascript (written in javascript as well):
http://www.howtocreate.co.uk/tutorials/jsexamples/JSTidy.html
There are various ways to tidy SGML based files (i.e. XML) - HTMLTidy will often do the trick, and there are various 'pretty print' implementations in various languages out there.
And finally a link to a web site with PHP code for pretty printing PHP: http://tobyinkster.co.uk/blog/2007/07/17/php-pretty-printer/
For HTML/XML HTML Tidy is the best option:
http://tidy.sourceforge.net/

Categories