Languages on the website


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
31 views
How to make a website...
Subdomains
ru.site.com, en.site.com, fr.site.com
or
site.com/ru/
site.com/fr/
site.com/en/

If the latter, then how to do links inside php
by | 31 views

7 Answers

0 like 0 dislike
The less nesting, the more page like search engines, i.e. under options en.site.ru/ and site.ru/en/ — the first would be a priority, though little gemorroynye to implement.
by
0 like 0 dislike
... obviously to each link need to attribute $language. '/link/'; ...
\r
I would replace the straight output link, the output through the "helper" where you can edit the link as you need, including append language prefix.
by
0 like 0 dislike
if the site information is better than a subdomain.
if something like a sphere or a blog, and translates only the interface is better worth the small price to other languages with passing the parameter as part of url or whistle.
\r
the language define so — look at the parameters of the address if is not present — look cook if no — look account details, if no — look $_SERVER['HTTP_ACCEPT_LANGUAGE'] and compare with the list of languages if no match — default give.
if language %lang%.domain.ru then domain.ru defined as the absence of this language and go through the above actions, then redirect to the appropriate subdomain.
by
0 like 0 dislike
What is the website? A framework of some kind? Engine? What? From scratch?
by
0 like 0 dislike
I think the first looks neater, but the disadvantages of this solution: configure Apache for name-based hosting, and need access to DNS, long update DNS zone site.com.
\r
The second is easier to implement (no time-consuming to update the DNS). You can create links to relative (as in PHP — I don't know).
by
0 like 0 dislike
and what's the problem with references in php? it supports relative paths
by
0 like 0 dislike
All language versions are on the domain site.com and the current user's language is taken from the cookie where it is stored or preferred language of the browser, or a conscious choice of the user.
The user selection is a link site.com/fr/, site.com/en/ etc handler which just sets the cookie and redirects either on the referrer (if it is within your site), or the main page of your website. Accordingly, all the labels are displayed on the website spec. a function argument which is a label — a short but clear description of the string, followed by hiding, for example T('PLEASE_LOGIN') displays the message "Please sign up" in the language of all labels and their translations into all languages are stored in one place.
This option does not suit you?
by

Related questions

0 like 0 dislike
5 answers
0 like 0 dislike
1 answer
0 like 0 dislike
4 answers
110,608 questions
257,187 answers
0 comments
40,470 users