Skip to content

How to create a page with content in multiple languages

Bugo edited this page Mar 18, 2023 · 2 revisions
  • Activate "Enable user-selectable language support" option in your SMF settings (Configuration => Languages => Settings)

Option 1

  • Create a portal page of PHP type
  • Enter titles in multiple languages
  • Enter a content like this:
<?php

global $user_info;

if ($user_info['language'] == 'french') {
   echo 'French translation';
} elseif ($user_info['language'] == 'spanish') {
   echo 'Spanish translation';
} else {
   echo 'Your original text';
}

?>

Option 2

  • Install Show Specified Language modification
  • Create a portal page of BBCode type
  • Enter titles in multiple languages
  • Enter a content like this:
[language=english]Hi all![/language]
[language=spanish]Hola, esta es una prueba[/language]