Page in several languages

Asked

Viewed 48 times

1

How are pages made that are available in multiple languages? They are actually multiple HTML pages linked handmade in different languages or have some form for it?

I’m making a simple website for myself and would like to make it available in multiple languages how can I do this?

  • 1

    What language do you want to use? Because each language has its specific tool.

  • 1

    There are countless ways to do that. The simplest is to treat the language still on the server side and assemble the body of the response with the translated texts, which may be stored in a file or in a database. You can do it with Javascript as well, but the page load time tends to increase. That said, I think your question is too broad with the data that was posted. If you can limit the problem further, maybe you can answer.

  • 1

    @Wictorchaves He spoke "language" and not "language" :)

  • I guess I wasn’t clear, by language I meant language.

  • 1

    I once made a simple site in Portuguese and English, but as it had little text, I only used if else on the server side. In case it’s a site with a lot of content, I think it’s like @Andersoncarloswoss said, store all the text in each language you use in a database or file, and pull it according to the user’s choice.

  • @Henriquebretone, yes I understood, but it is because there are tools ready for this, like android for example, it has a file called "string.xml" where you put the text of the app in it, you create one for each language you will work.

  • I appreciate the comments I just wanted to know how these pages are made same.

Show 2 more comments

1 answer

1


If it is one or several pages regardless of whether it is in several languages this will be defined by the general architecture of how the site is assembled. It can be multiple pages, it can be a template that has the texts filled with what comes from a database or file according to what is selected, it can be a single page that loads the texts with AJAX or something similar.

First define how you will do in one language and then define how you will do in several.

Making a single page for several languages is more work than people realize because the texts are not the same size and this creates complications. That’s why some people prefer to do everything by hand. If making a template to use in all languages needs to be very well done to handle different text sizes without getting weird, especially without bursting text, but also leaving undue spaces.

If you do this you have to decide where to put the texts, it’s usually in a database. Then you need to decide whether the pages will be generated dynamically or statically. Ideally texts should be loaded and used as required in variables or maps (arrays even), or if precise, since the language identifier already determines which texts will be picked up.

If you choose to capture the texts by AJAX it should not be a site because you may have indexing problems.

Remember that images that have text need to be different, so their Urls should be differentiated as well.

Nor did I enter into the merit of alphabets quite different from our (Roman) and written in another direction, after all it is rare to do for such different languages.

Obviously the details of how to do can vary greatly and this is too broad to answer without knowing the need.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.