Difference between revisions of "App languages.php"

From FusionPBX
Jump to: navigation, search
(To do list)
(Prefixes)
 
(54 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
The app_languages.php is an array of all the words, phrases and sentences used in the project.
 
The app_languages.php is an array of all the words, phrases and sentences used in the project.
  
===To do list===
+
<!--
All of them need to be done the highest priority ones cannot be automated. The lowest priority are ones that I can automate some of it.
+
===Completed===
  
Highest priority
+
* schemas
* <strike>time_conditions</strike> - COMPLETE (rinor)
+
* active queues (fifo_list)
* call center active - <b>mark fix bug first (white page)</b>
+
* queues (fifo)
* <strike>conferences active</strike> - COMPLETE (soapee01)
+
* core/user
* <strike>content</strike> - COMPLETE (soapee01)
+
* sql_query
* <strike>dialplan inbound</strike> - COMPLETE (rinor)
+
* call block
* <strike>dialplan outbound</strike> - COMPLETE (soapee01)
+
* core/upgrade schema
* exec - in review by mcrane (soapee01)
 
* <strike>log_viewer</strike> - COMPLETE (soapee01)
 
* xmpp
 
* traffic graph
 
* <strike>users</strike> was already done. unless mcrane means core/users
 
* <strike>music_on_hold</strike> - COMPLETE (soapee01)
 
* <strike>click_to_call</strike> - COMPLETE (soapee01)
 
Lower Priority
 
* gateways
 
* extensions
 
* dialplan
 
* destinations
 
* contacts
 
* call_flows
 
* hardware_phones
 
* call_center
 
* ivr_menu
 
* modules
 
 
* hot_desking
 
* hot_desking
 
* sip_profiles
 
* sip_profiles
* hunt_group
+
* hunt_groups
* sql_query
 
* fifo
 
* fifo_list
 
 
* vars
 
* vars
* virtual tables
+
* modules
 +
* call_center
 +
* call center active
 +
* ivr_menu
 +
* dialplans
 +
* core/menu
 +
* core/databases
 
* core/apps
 
* core/apps
* core/backaup
+
* call_flows
* core/databases
 
 
* core/default_settings
 
* core/default_settings
 
* core/domains
 
* core/domains
* core/menu
+
* devices
* core/upgrade
+
* xmpp
* core/user
+
* contacts
* grammar_edit (assigned to mark)
+
* destinations
* php_edit (assigned to mark)
 
* xml edit (assigned to mark)
 
* provision_editor (assigned to mark)
 
 
 
===Recently Completed===
 
 
* recordings - soapee01
 
* recordings - soapee01
 
* registrations - soapee01
 
* registrations - soapee01
Line 62: Line 41:
 
* voicemail_greetings
 
* voicemail_greetings
 
* xml_cdr
 
* xml_cdr
* and more...
+
* time_conditions - rinor
 +
* conferences active - soapee01
 +
* content - soapee01
 +
* dialplan inbound - rinor
 +
* dialplan outbound - soapee01
 +
* exec - soapee01
 +
* log_viewer - soapee01
 +
* traffic graph - (SVG excluded)
 +
* app/users
 +
* music_on_hold -soapee01
 +
* click_to_call - soapee01
 +
* gateways - mcrane
 +
* extensions
 +
* grammar_edit
 +
* php_edit
 +
* xml edit
 +
* provision_editor
 +
* invoices
 +
-->
  
 
===Guidelines===
 
===Guidelines===
Line 72: Line 69:
 
===Prefixes===
 
===Prefixes===
 
* '''title''' - the title of the page
 
* '''title''' - the title of the page
 +
* '''header''' - the header of the page
 
* '''description''' - information to describe the page or an item on the page
 
* '''description''' - information to describe the page or an item on the page
 
* '''button''' - the label for the buttons
 
* '''button''' - the label for the buttons
 
* '''confirm''' - a message used to confirm and action like delete
 
* '''confirm''' - a message used to confirm and action like delete
 +
* '''message''' - the response after an action is taken
 
* '''label''' - the label for items on the page
 
* '''label''' - the label for items on the page
 +
* '''option''' - the options in an html select box
  
 
===Languages===
 
===Languages===
Each word, phrase, or sentence has the language declared with the 2 letter iso code for the language and the dialect.
+
Each word, phrase, or sentence has the language declared with the 2 language code with s dash seperating the region. There is one difference the region is entirely in lower case. For additional information see the following.
  
http://msdn.microsoft.com/en-us/library/ms533052%28v=vs.85%29.aspx
+
http://www.w3.org/International/articles/language-tags/
 +
 
 +
http://www.iana.org/assignments/language-subtag-registry
  
 
* en-us
 
* en-us
Line 95: Line 97:
  
 
  <?php
 
  <?php
+
 
 
  $text['title-conference-center']['en-us'] = 'Conference Center';
 
  $text['title-conference-center']['en-us'] = 'Conference Center';
 
  $text['title-conference-center']['pt-pt'] = '';
 
  $text['title-conference-center']['pt-pt'] = '';
 +
 +
$text['header-conference-center']['en-us'] = 'Conference Center';
 +
$text['header-conference-center']['pt-pt'] = '';
 
   
 
   
 
  $text['description-conference-center']['en-us'] = 'Conference Center is used to setup one or more conference rooms with a name, extension number, a required pin number length, and a description.';
 
  $text['description-conference-center']['en-us'] = 'Conference Center is used to setup one or more conference rooms with a name, extension number, a required pin number length, and a description.';

Latest revision as of 16:05, 21 June 2013

The app_languages.php is an array of all the words, phrases and sentences used in the project.


Guidelines

The words used in the text variable name

  • separated with a dash.
  • begin with a prefix
  • are lower case

Prefixes

  • title - the title of the page
  • header - the header of the page
  • description - information to describe the page or an item on the page
  • button - the label for the buttons
  • confirm - a message used to confirm and action like delete
  • message - the response after an action is taken
  • label - the label for items on the page
  • option - the options in an html select box

Languages

Each word, phrase, or sentence has the language declared with the 2 language code with s dash seperating the region. There is one difference the region is entirely in lower case. For additional information see the following.

http://www.w3.org/International/articles/language-tags/

http://www.iana.org/assignments/language-subtag-registry

  • en-us
  • es-mx
  • de-ch
  • de-at
  • fr-ca
  • fr-ch
  • pt-pt
  • pt-br

Example File

An excerpt from the app_languages.php for Conference Center.

<?php
	$text['title-conference-center']['en-us'] = 'Conference Center';
	$text['title-conference-center']['pt-pt'] = ;

	$text['header-conference-center']['en-us'] = 'Conference Center';
	$text['header-conference-center']['pt-pt'] = ;

	$text['description-conference-center']['en-us'] = 'Conference Center is used to setup one or more conference rooms with a name, extension number, a required pin number length, and a description.';
	$text['description-conference-center']['pt-pt'] = ;

	$text['label-name']['en-us'] = 'Name';
	$text['label-name']['pt-pt'] = ;

	$text['label-extension']['en-us'] = 'Extension';
	$text['label-extension']['pt-pt'] = ;

	$text['label-delete']['en-us'] = 'Delete';
	$text['label-delete']['pt-pt'] = ;

	$text['label-edit']['en-us'] = 'Edit';
	$text['label-edit']['pt-pt'] = ;

	$text['button-view']['en-us'] = 'View';
	$text['button-view']['pt-pt'] = ;

	$text['button-back']['en-us'] = 'Back';
	$text['button-back']['pt-pt'] = 'Voltar';

	$text['confirm-update']['en-us'] = 'Update Complete';
	$text['confirm-update']['pt-pt'] = 'Actualização Completa';

	$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
	$text['confirm-delete']['pt-pt'] = ;

	$text['button-add']['en-us'] = 'Add';
	$text['button-add']['pt-pt'] = ;

	$text['button-save']['en-us'] = 'Save';
	$text['button-save']['pt-pt'] = 'Guardar';

?>

To use inside the code on each page that displays text. Place the following code at the top just after the permision_exists

//add multi-lingual support
	require_once "app_languages.php";
	foreach($text as $key => $value) {
		$text[$key] = $value[$_SESSION['domain']['language']['code']];
	}

To place a word, phrase or sentence it would be used in the code like the following example.

echo "<td align='left' width='30%' nowrap='nowrap'>".$text['title-conference-centers']."</td>\n";

An additional example.

echo "	<tr>\n";
echo "		<td align='left' colspan='2'>\n";
echo "			".$text['description-conference-centers']."\n";
echo "		</td>\n";
echo "	</tr>\n";
echo "</table>\n";