Skip to main content
Inspiring
April 10, 2019
Answered

Best method to create an alternate language version of your website?

  • April 10, 2019
  • 1 reply
  • 1138 views

(There's an almost-zero percent chance that there will ever be a 3rd language, so we're talking strictly alternating between 2 languages.)

I was thinking of a link at the top of the page that triggers a (PHP?) event that will reload "self" except with "_alt" at the end of the file name -- so "domain.com/page.php" becomes "domain.com/page_alt.php" -- and vice versa if already on a page ending with "_alt" (so it removes it to revert to original language version of the page).

Is this as good a method as any other?

If so, what would that syntax look like?

Thanks!

This topic has been closed for replies.
Correct answer Nancy OShea

Content is stored in a database.  User selects a language which generates a stored session to "remember" which language until user leaves the site.

If your site is built on WordPress, get the WP Multilingual plugin.

WPML - The WordPress Multilingual Plugin

For static sites, you'll  need to create 2 or more sites, 1 in each language.

yourdomain.com/en/content...

yourdomain.com/fr/content...

yourdomain.com/de/content...

1 reply

Nancy OShea
Community Expert
Nancy OSheaCommunity ExpertCorrect answer
Community Expert
April 10, 2019

Content is stored in a database.  User selects a language which generates a stored session to "remember" which language until user leaves the site.

If your site is built on WordPress, get the WP Multilingual plugin.

WPML - The WordPress Multilingual Plugin

For static sites, you'll  need to create 2 or more sites, 1 in each language.

yourdomain.com/en/content...

yourdomain.com/fr/content...

yourdomain.com/de/content...

Nancy O'Shea— Product User & Community Expert
BenPleysier
Community Expert
Community Expert
April 10, 2019

Nancy's reply is the same as mine.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Under S.Author
Inspiring
April 11, 2019

BenPleysier  wrote

Nancy's reply is the same as mine.

I'll leave it marked as correct for others, because it really does look like the smartest solution on the table.

As a designer, I don't usually get my hands this deep into the code. Clients typically develop the back-end part themselves (I'm just stubborn about cutting it up and making it work before I hand it in); but since this would be for my personal website, I'm on my own for this one and already spent too much time on it already.

Given my lack of general experience with databases, could you give me a quick band-aid fix that would do something similar to what was described in the OP? IE, alternating between *.php and *_alt.php versions of the page via a link at the top and footer of the page.

I'm sensing this would be easy enough to do via PHP in the href value telling the browser to reload "self" + "_alt" (and the opposite if "_alt" is already present) but I don't actually know PHP, so...