Multilingual App Based on current user language $app_user['language']; 'Display Fields Rules'

Put your suggestions here.
Post Reply
yaoying
Posts: 133
Joined: 10 Apr 2023, 23:23
Name: 耀影
Location: 深圳
Company Name: 深圳市耀影科技有限公司
Contact:

Multilingual App Based on current user language $app_user['language']; 'Display Fields Rules'

Post by yaoying »

'Display Fields Rules' Add a list of languages that determine the value of the language field variable for the current 'login user'

Code: Select all

<?php
//Gets the current user language
$user_language = $app_user['language'];

// Display different fields according to user language
if ($user_language == 'en') {
  // Show English fields
  echo $app_fields_cache[1]['name'];
} else if ($user_language == 'zh') {
  // Display Chinese field
  echo $app_fields_cache[2]['name'];
} else {
  // Show Default Fields
  echo $app_fields_cache[0]['name'];
}
?>
And various reports, information page is added with display rule by judging that value of current user language

With such a display rule, the implementation of the multi-language APP can be better solved

viewtopic.php?p=17527&hilit=Multilingual#p17527
User avatar
Schelle
Posts: 28
Joined: 14 Sep 2023, 03:05
Name: Schelle Ticka
Location: Brisbane Australia

Re: Multilingual App Based on current user language $app_user['language']; 'Display Fields Rules'

Post by Schelle »

100% agree, having a Multilingual app is a must in the modern environment when teams are all over the world.
Post Reply