{"id":249,"date":"2011-05-05T09:15:45","date_gmt":"2011-05-05T14:15:45","guid":{"rendered":"http:\/\/xlinesoft.com\/blog\/?p=249"},"modified":"2011-05-06T14:17:21","modified_gmt":"2011-05-06T19:17:21","slug":"localizing-phprunnerasprunnerpro-applications","status":"publish","type":"post","link":"https:\/\/xlinesoft.com\/blog\/2011\/05\/05\/localizing-phprunnerasprunnerpro-applications\/","title":{"rendered":"Localizing PHPRunner\/ASPRunnerPro applications"},"content":{"rendered":"<p>In this article we will cover all the aspects of creating multilingual websites with the help of PHPRunner. This process includes the following steps:<\/p>\n<ul>\n<li><a href=\"#transl_system\">Translation of system messages<\/a><\/li>\n<li><a href=\"#transl_names\">Translation of table\/field names and custom labels<\/a><\/li>\n<li><a href=\"#transl_data\">Translation of data from the database<\/a><\/li>\n<\/ul>\n<h2 class=\"p_Heading2\"><a name=\"transl_system\"><\/a><span class=\"f_Heading2\">Translation of system messages<\/span><\/h2>\n<p>First of all, you need to define the language(s) of standard texts in the website interface or &#8220;system messages&#8221;.<\/p>\n<p>On the <a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/miscellaneous_settings.htm#misc_lang\">Miscellaneous<\/a> page you can choose one or more languages which your website will support. Use the <span style=\"font-weight: bold;\">Language<\/span> drop-down box if you like to choose one language. By clicking <span style=\"font-weight: bold;\">Multiple languages<\/span> button you can select several languages and give the user ability to choose language while logging in.<\/p>\n<p>PHPRunner includes translations of system messages into the following languages:<\/p>\n<div style=\"text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 12px 0px 12px 0px;\">\n<table style=\"background-color: #eaeaea; border: solid 1px #e1e1e1; border-spacing: 4px;\" border=\"1\" cellspacing=\"4\" cellpadding=\"4\" bgcolor=\"#eaeaea\">\n<tbody>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Afrikaans<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Arabic<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Bosnian<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Catalan<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Chinese<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Croatian<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Czech<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Danish<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Dutch<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">DutchB<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">English<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Farsi<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">French<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">German<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Greek<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Hebrew<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Hongkong<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Hungarian<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Indonesian<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Italian<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Japanese<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Malay<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Norwegian<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Phillipines<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Polish<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Portugal<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Portuguese<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Romanian<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Russian<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Slovak<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Spanish<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Swedish<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Taiwan<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Thai<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Turkish<\/span><\/p>\n<\/td>\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Urdu<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Translations of system messages are stored in the language files (<span style=\"font-style: italic;\">*.lng) <\/span>located<span style=\"font-style: italic;\"> <\/span>in the <span style=\"font-style: italic;\">lang<\/span> directory (<span style=\"font-style: italic;\">C:\\Program Files\\PHPRunner5.3\\lang<\/span>). For example, system messages in English language is stored in the <span style=\"font-style: italic;\">English.lng<\/span> file:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-252\" title=\"Language files (*.lng)\" src=\"http:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lng_file_edit.gif\" alt=\"Language files (*.lng)\" width=\"657\" height=\"504\" srcset=\"https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lng_file_edit.gif 657w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lng_file_edit-300x230.gif 300w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lng_file_edit-150x115.gif 150w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lng_file_edit-400x306.gif 400w\" sizes=\"(max-width: 657px) 100vw, 657px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>To change the translation of system messages in some language, modify the corresponding language file (<span style=\"font-style: italic;\">*.lng)<\/span>.<\/p>\n<p>To add translation of system messages in new language, create a copy of file <span style=\"font-style: italic;\">English.lng<\/span> and translate all phrases there. Then modify the file <span style=\"font-style: italic;\">languages.cfg<\/span> that is also located in the <span style=\"font-style: italic;\">lang<\/span> directory by adding this line (change the values listed in <span style=\"color: #ff0000;\">red<\/span> to match your specific needs):<\/p>\n<div style=\"text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 12px 0px 12px 10px;\">\n<table style=\"background-color: #eaeaea; border: solid 1px #e1e1e1; border-spacing: 2px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"3\" bgcolor=\"#eaeaea\">\n<tbody>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"border: none;\" valign=\"top\">\n<p class=\"p_CodeExample\"><span class=\"f_CodeExample\">&lt;language <\/span><span class=\"f_CodeExample\">filename<\/span><span class=\"f_CodeExample\">=&#8221;<\/span><span class=\"f_CodeExample\" style=\"color: #ff0000;\">YourLanguageFile<\/span><span class=\"f_CodeExample\">.lng&#8221; name=&#8221;<\/span><span class=\"f_CodeExample\" style=\"color: #ff0000;\">YourLanguageName<\/span><span class=\"f_CodeExample\">&#8221; lcid=&#8221;<\/span><span class=\"f_CodeExample\" style=\"color: #ff0000;\">YourLocaleID<\/span><span class=\"f_CodeExample\">&#8221; codepage=&#8221;<\/span><span class=\"f_CodeExample\" style=\"color: #ff0000;\">YourCodepage<\/span><span class=\"f_CodeExample\">&#8221; charset=&#8221;<\/span><span class=\"f_CodeExample\" style=\"color: #ff0000;\">YourCharset<\/span><span class=\"f_CodeExample\">&#8221; \/&gt;<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>where<\/p>\n<ul>\n<li>filename &#8211; name of the new .lng file.<\/li>\n<li><em>name <\/em>&#8211; language name as it would appear in the PHPRunner wizard.<\/li>\n<li><em>lcid <\/em>&#8211; locale ID. <a href=\"http:\/\/xlinesoft.com\/articles\/asp_regional_settings.htm\" target=\"_blank\">List of Locale IDs<\/a>.<\/li>\n<li><em>codepage <\/em>&#8211; codepage code. <a href=\"http:\/\/en.wikipedia.org\/wiki\/Code_page\" target=\"_blank\">List of codepage codes<\/a>.<\/li>\n<li><em>charset <\/em>&#8211; charset code. <a href=\"http:\/\/www.webcheatsheet.com\/html\/character_sets_list.php\" target=\"_blank\">List of charset codes<\/a>.<\/li>\n<\/ul>\n<p><a name=\"transl_names\"><\/a><span class=\"f_Heading2\">Translation of table\/field names and custom labels<\/span><\/p>\n<p>Use <a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/miscellaneous_settings.htm#misc_label_ed\">Label Editor<\/a> on the <span style=\"font-weight: bold;\">Miscellaneous<\/span> page to translate table and field names\/labels (<span style=\"font-weight: bold;\">Table labels<\/span> tab). Also you can add and translate custom labels there (<span style=\"font-weight: bold;\">Custom labels<\/span> tab) and add tooltips to the Edit forms (<span style=\"font-weight: bold;\">Edit form tooltips<\/span> tab).<\/p>\n<p>Use custom labels to translate <span style=\"text-decoration: underline;\"><a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/menu_builder.htm\">menu items<\/a><\/span>, <a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/fields_order_and_totals.htm#tab_section\">tab\/section<\/a> names, error messages in <span style=\"text-decoration: underline;\"><a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/validation_types.htm#regexp\">regular expressions<\/a><\/span> and your own <span style=\"text-decoration: underline;\"><a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/validation_types.htm#own_validation_type\">validation plugins<\/a><\/span> etc. When creating menu item, new tab\/section or regular expression, use the <span style=\"font-weight: bold;\">Multilanguage&#8230;<\/span> button to create and translate custom label. Use Label Editor (<span style=\"font-weight: bold;\">Custom labels<\/span> tab) to create custom labels for error messages in your own validation plugins. In Label Editor you can also create your own custom labels to display some messages to a user.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-251\" title=\"Label editor - custom labels\" src=\"http:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/label_editor_custom.gif\" alt=\"Label editor - custom labels\" width=\"600\" height=\"400\" srcset=\"https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/label_editor_custom.gif 600w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/label_editor_custom-300x200.gif 300w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/label_editor_custom-150x100.gif 150w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/label_editor_custom-400x266.gif 400w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Use the methods listed below to access labels from the ASP\/PHP code<\/p>\n<p><strong>PHP<\/strong><\/p>\n<div style=\"text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 35px;\">\n<table style=\"border: none; border-spacing: 0px; border-collapse: collapse;\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n<tbody>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; background-color: #c2cfd5; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\" bgcolor=\"#c2cfd5\">\n<p class=\"p_TableBold\"><span class=\"f_TableBold\">Method<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; background-color: #c2cfd5; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\" bgcolor=\"#c2cfd5\">\n<p class=\"p_TableBold\"><span class=\"f_TableBold\">Description<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetTableCaption($table)<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns table caption.<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; background-color: #f5f5f5; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\" bgcolor=\"#f5f5f5\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetFieldLabel($table, $field)<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; background-color: #f5f5f5; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\" bgcolor=\"#f5f5f5\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns field label.<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetCustomLabel(&#8220;LABEL_ID&#8221;)<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns custom label.<\/span><\/p>\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\" style=\"font-style: italic;\">LABEL_ID<\/span><span class=\"f_Tablenormal\"> &#8211; <\/span>custom label identifier.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; background-color: #f5f5f5; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\" bgcolor=\"#f5f5f5\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetFieldToolTip($table, $field)<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; background-color: #f5f5f5; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\" bgcolor=\"#f5f5f5\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns field edit tooltip.<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">mlang_message($tag)<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns standard message. You can find the list of message tags in the file <\/span><span style=\"font-style: italic;\">English.lng <\/span>(<span class=\"f_Tablenormal\" style=\"font-style: italic;\">C:\\Program Files\\PHPRunner5.3\\<\/span><span style=\"font-style: italic;\">lang\\English.lng<\/span>).<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><strong>ASP<\/strong><\/p>\n<div style=\"text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 35px;\">\n<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" style=\"border: none; border-spacing:0px; border-collapse: collapse;\">\n<tr style=\"text-align:left;vertical-align:top;\">\n<td valign=\"top\" width=\"38%\" bgcolor=\"#c2cfd5\" style=\"width:38%; background-color:#c2cfd5; border: solid 1px #ece9d8;\">\n<p class=\"p_TableBold\"><span class=\"f_TableBold\">Method<\/span><\/p>\n<\/td>\n<td valign=\"top\" width=\"62%\" bgcolor=\"#c2cfd5\" style=\"width:62%; background-color:#c2cfd5; border: solid 1px #ece9d8;\">\n<p class=\"p_TableBold\"><span class=\"f_TableBold\">Description<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align:left;vertical-align:top;\">\n<td valign=\"top\" width=\"38%\" style=\"width:38%; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetTableCaption(table)<\/span><\/p>\n<\/td>\n<td valign=\"top\" width=\"62%\" style=\"width:62%; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns table caption.<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align:left;vertical-align:top;\">\n<td valign=\"top\" width=\"38%\" bgcolor=\"#f5f5f5\" style=\"width:38%; background-color:#f5f5f5; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetFieldLabel(table, field)<\/span><\/p>\n<\/td>\n<td valign=\"top\" width=\"62%\" bgcolor=\"#f5f5f5\" style=\"width:62%; background-color:#f5f5f5; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns field label.<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align:left;vertical-align:top;\">\n<td valign=\"top\" width=\"38%\" style=\"width:38%; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetCustomLabel(&quot;LABEL_ID&quot;)<\/span><\/p>\n<\/td>\n<td valign=\"top\" width=\"62%\" style=\"width:62%; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns custom label.<\/span><\/p>\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\" style=\"font-style: italic;\">LABEL_ID<\/span><span class=\"f_Tablenormal\"> &#8211; <\/span>custom label identifier.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align:left;vertical-align:top;\">\n<td valign=\"top\" width=\"38%\" bgcolor=\"#f5f5f5\" style=\"width:38%; background-color:#f5f5f5; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetFieldToolTip(table, field)<\/span><\/p>\n<\/td>\n<td valign=\"top\" width=\"62%\" bgcolor=\"#f5f5f5\" style=\"width:62%; background-color:#f5f5f5; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns field edit tooltip.<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align:left;vertical-align:top;\">\n<td valign=\"top\" width=\"38%\" style=\"width:38%; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">mlang_message(tag)<\/span><\/p>\n<\/td>\n<td valign=\"top\" width=\"62%\" style=\"width:62%; border: solid 1px #ece9d8;\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns standard message. You can find the list of message tags in the file <\/span><span style=\"font-style: italic;\">English.lng <\/span>(<span class=\"f_Tablenormal\" style=\"font-style: italic;\">C:\\Program Files\\ASPRunnerPro6.3\\<\/span><span style=\"font-style: italic;\">lang\\English.lng<\/span>).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p style=\"margin: 0px 0px 0px 35px;\"><span style=\"font-family: 'Arial';\"> <\/span><\/p>\n<p class=\"p_Tablenormal\">Use the methods listed below to access labels from the Javascript code:<\/p>\n<div style=\"text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 12px 0px 12px 35px;\">\n<table style=\"border: none; border-spacing: 0px; border-collapse: collapse;\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n<tbody>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; background-color: #c2cfd5; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\" bgcolor=\"#c2cfd5\">\n<p class=\"p_TableBold\"><span class=\"f_TableBold\">Method<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; background-color: #c2cfd5; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\" bgcolor=\"#c2cfd5\">\n<p class=\"p_TableBold\"><span class=\"f_TableBold\">Description<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">GetCustomLabel(&#8220;LABEL_ID&#8221;)<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns custom label.<\/span><\/p>\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\" style=\"font-style: italic;\">LABEL_ID<\/span><span class=\"f_Tablenormal\"> &#8211; <\/span>custom label identifier.<\/p>\n<\/td>\n<\/tr>\n<tr style=\"text-align: left; vertical-align: top;\">\n<td style=\"width: 38%; background-color: #f5f5f5; border: solid 1px #ece9d8;\" width=\"38%\" valign=\"top\" bgcolor=\"#f5f5f5\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Runner.lang.constants.CONSTANT_ID<\/span><\/p>\n<\/td>\n<td style=\"width: 62%; background-color: #f5f5f5; border: solid 1px #ece9d8;\" width=\"62%\" valign=\"top\" bgcolor=\"#f5f5f5\">\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\">Returns standard message. <\/span><\/p>\n<p class=\"p_Tablenormal\"><span class=\"f_Tablenormal\" style=\"font-style: italic;\">CONSTANT_ID<\/span><span class=\"f_Tablenormal\"> &#8211; message constant identifier. You can find the list of constants in the file <\/span><span class=\"f_Tablenormal\" style=\"font-style: italic;\">RunnerLang.js<\/span><span class=\"f_Tablenormal\"> (<\/span><span class=\"f_Tablenormal\" style=\"font-style: italic;\">C:\\Program Files\\PHPRunner5.3\\source\\include\\common\\runnerJS\\constants\\language\\RunnerLang.js)<\/span><span class=\"f_Tablenormal\">.<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-weight: bold;\">Example 1<\/span>. Use of custom label in ASP\/PHP code<\/p>\n<p>If you have created custom label <span style=\"font-style: italic;\">Message1<\/span> and want to place this message on a page, which will vary depending on the selected language, add PHP code snippet to the page and use the following code in it:<\/p>\n<p><strong>PHP<\/strong><\/p>\n<pre lang=\"php\">echo GetCustomLabel(\"Message1\");<\/pre>\n<p><strong>ASP<\/strong><\/p>\n<pre lang=\"asp\">Response.Write GetCustomLabel(\"Message1\")<\/pre>\n<p><span style=\"font-weight: bold;\">Example 2<\/span>. Use of custom label in Javascript code<\/p>\n<p>If you have created custom label <span style=\"font-style: italic;\">Error_Message_1 <\/span>for your validation plugin, use <span class=\"f_CodeExample\">GetCustomLabel(&#8220;<\/span><span class=\"f_CodeExample\" style=\"color: #ff0000;\">Error_Message_1<\/span><span class=\"f_CodeExample\">&#8220;)<\/span> code in your javascript function. Note that <span style=\"font-style: italic;\">GetCustomLabel<\/span> function is applicable only for editing fields like Add\/Edit\/Register\/List with inline add\/edit.<\/p>\n<p><span style=\"font-weight: bold;\">Example 3<\/span>. Use of field label instead of field name<\/p>\n<p>In this code snippet that sends email with new data we use <span class=\"f_Tablenormal\" style=\"font-style: italic;\">GetFieldLabel<\/span><span class=\"f_Tablenormal\"> method to get field label. Don&#8217;t forget to <\/span>replace <span style=\"font-style: italic;\">table_name<\/span> with the correct name of the table.<\/p>\n<p><strong>PHP<\/strong><\/p>\n<pre lang=\"php\">\/\/**********  Send email with new data  ************\r\n\r\n$email=\"test@test.com\";\r\n$from=\"admin@test.com\";\r\n$msg=\"\";\r\n$subject=\"New data record\";\r\n\r\n\r\nforeach($values as $field=>$value)\r\n{\r\n\r\nif(!IsBinaryType(GetFieldType($field)))\r\n  $msg.= GetFieldLabel(\"table_name\", $field) .\" : \".$value.\"\\r\\n\";\r\n}\r\n \r\n$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));\r\nif(!$ret[\"mailed\"])\r\n echo $ret[\"message\"];\r\n<\/pre>\n<p><strong>ASP<\/strong><\/p>\n<pre lang=\"asp\">'**********  Send email with new data  ************\r\n\r\nDim dkeys, tmpDict, msg, n\r\nmsg =\"\"\r\n    dkeys = values.keys\r\n    For n = 0 To values.Count-1\r\n        if not IsBinaryType(GetFieldType(dkeys(n),\"\")) then\r\n            msg = msg & GetFieldLabel(\"table_name\",dkeys(n)) & \" : \" & values(dkeys(n)) & vbcrlf\r\n        end if\r\n    Next\r\n\r\nset tmpDict = CreateObject(\"Scripting.Dictionary\")\r\ntmpDict(\"to\")=\"--rbegin--test@test.com--rend--\"\r\ntmpDict(\"subject\")=\"--rbegin--Sample subject--rend--\"\r\ntmpDict(\"body\")=msg\r\nset ret=runner_mail(tmpDict)\r\nif not ret(\"mailed\") then\r\n    response.write ret(\"message\")\r\nend if\r\n<\/pre>\n<div class=\"p_Heading2\"><a name=\"transl_data\"><\/a><span class=\"f_Heading2\">Translation of data from the database<\/span><\/div>\n<p>We can propose two approaches to the translation data from the database:<\/p>\n<p><span style=\"font-weight: bold;\">1.<\/span> To store data for each language in a separate table and redirect users to the page, depending on the selected language.<\/p>\n<p>Example. To implement this approach we use the following code in the <span style=\"text-decoration: underline;\"><a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/before_process.htm\">BeforeProcessList<\/a><\/span> event of <span style=\"font-style: italic;\">mydata_english<\/span> table:<\/p>\n<p><strong>PHP<\/strong><\/p>\n<pre lang=\"php\">if ($_SESSION[\"language\"]==\"Spanish\")\r\n {\r\n  header(\"Location: mydata_spanish_list.php\");\r\n  exit();\r\n }\r\nelse if ($_SESSION[\"language\"]==\"French\")\r\n   {\r\n    header(\"Location: mydata_french_list.php\");\r\n    exit();\r\n   }<\/pre>\n<p><strong>ASP<\/strong><\/p>\n<pre lang=\"asp\">\r\n\r\nif SESSION(\"language\")=\"Spanish\" then\r\n  Response.Redirect \"mydata_spanish_list.asp\"\r\nelse if SESSION(\"language\")=\"French\"\r\n  Response.Redirect \"mydata_french_list.asp\"\r\nend if\r\n<\/pre>\n<p><span style=\"font-weight: bold;\">2.<\/span> To store data for all languages ??in one table by adding new field for storing language. This approach is easier to configure.<\/p>\n<p>To implement this approach, you can use the method described in the <a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/modify_sql_query_on_the_fly.htm\">Dynamic SQL query<\/a> topic and the following code in the <span style=\"text-decoration: underline;\"><a href=\"http:\/\/xlinesoft.com\/phprunner\/docs\/before_sql_query.htm\">Before SQL Query<\/a><\/span> event of the List page:<\/p>\n<p><strong>PHP<\/strong><\/p>\n<pre lang=\"php\">$strWhereClause = whereAdd($strWhereClause, \"language='\". $_SESSION[\"language\"] .\"'\");<\/pre>\n<p><strong>ASP<\/strong><\/p>\n<pre lang=\"asp\">strWhereClause = whereAdd(strWhereClause,\"language='\" & SESSION(\"language\") & \"'\"<\/pre>\n<p>If you have lookup table were data is stored on multiple languages, use the following code in the WHERE clause in the Lookup wizard to display the data only for the currently selected language:<\/p>\n<p><strong>PHP<\/strong><\/p>\n<pre lang=\"php\">\" language='\". $_SESSION[\"language\"] .\"'\"<\/pre>\n<p><strong>ASP<\/strong><\/p>\n<pre lang=\"asp\">\"language='\" & SESSION(\"language\") & \"'\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-253\" title=\"Multilanguage lookup wizard\" src=\"http:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lookup_mult_lang.gif\" alt=\"Multilanguage lookup wizard\" width=\"779\" height=\"574\" srcset=\"https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lookup_mult_lang.gif 779w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lookup_mult_lang-300x221.gif 300w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lookup_mult_lang-150x110.gif 150w, https:\/\/xlinesoft.com\/blog\/wp-content\/uploads\/2011\/05\/lookup_mult_lang-400x294.gif 400w\" sizes=\"(max-width: 779px) 100vw, 779px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we will cover all the aspects of creating multilingual websites with the help of PHPRunner. This process includes the following steps: Translation of system messages Translation of table\/field names and custom labels Translation of data from the database Translation of system messages First of all, you need to define the language(s) of standard texts in the website interface or &#8220;system messages&#8221;. On the Miscellaneous page you can choose one or more languages which your website will support. Use the Language drop-down box&#8230;<span class=\"clearfix clearfix-post\"><\/span><a href=\"https:\/\/xlinesoft.com\/blog\/2011\/05\/05\/localizing-phprunnerasprunnerpro-applications\/\" class=\"more-link\">Continue Reading <span class=\"screen-reader-text\">&#8220;Localizing PHPRunner\/ASPRunnerPro applications&#8221;<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4,8],"tags":[],"_links":{"self":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts\/249"}],"collection":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":17,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":264,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions\/264"}],"wp:attachment":[{"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/media?parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/categories?post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlinesoft.com\/blog\/wp-json\/wp\/v2\/tags?post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}