<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://gwiki3.thatlinuxbox.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bttalic</id>
		<title>GeeklogWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://gwiki3.thatlinuxbox.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bttalic"/>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/Special:Contributions/Bttalic"/>
		<updated>2026-04-05T06:22:19Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.5</generator>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6360</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6360"/>
				<updated>2013-09-20T09:58:34Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|upright=0.5|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
&lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Badge1.png‎|thumb]]&lt;br /&gt;
|[[File:Badge2.png‎|thumb]]&lt;br /&gt;
|[[File:Badge3.png‎|thumb]]&lt;br /&gt;
|[[File:Badge4.png‎|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
[[File:CrowdTranslator_Translations_table.png|thumb|center|upright=3.0]]&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
[[File:CrowdTranslator_Peers.png|thumb|left||Adding Peers]]&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
[[File:CrowdTranslator_Submit_remote.png|thumb|right||Sending Translations]]&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Submit_remote.png&amp;diff=6359</id>
		<title>File:CrowdTranslator Submit remote.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Submit_remote.png&amp;diff=6359"/>
				<updated>2013-09-20T09:56:47Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Peers.png&amp;diff=6358</id>
		<title>File:CrowdTranslator Peers.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Peers.png&amp;diff=6358"/>
				<updated>2013-09-20T09:55:54Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Translations_table.png&amp;diff=6357</id>
		<title>File:CrowdTranslator Translations table.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Translations_table.png&amp;diff=6357"/>
				<updated>2013-09-20T09:52:48Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6356</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6356"/>
				<updated>2013-09-20T09:51:42Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|upright=0.5|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
&lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Badge1.png‎|thumb]]&lt;br /&gt;
|[[File:Badge2.png‎|thumb]]&lt;br /&gt;
|[[File:Badge3.png‎|thumb]]&lt;br /&gt;
|[[File:Badge4.png‎|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6355</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6355"/>
				<updated>2013-09-20T09:47:40Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Badge1.png‎|thumb]]&lt;br /&gt;
|[[File:Badge2.png‎|thumb]]&lt;br /&gt;
|[[File:Badge3.png‎|thumb]]&lt;br /&gt;
|[[File:Badge4.png‎|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6354</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6354"/>
				<updated>2013-09-20T09:46:40Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Badge1.png‎|thumb]]&lt;br /&gt;
|[[File:Badge2.png‎|thumb]]&lt;br /&gt;
|[[File:Badge3.png‎|thumb]]&lt;br /&gt;
|[[File:Badge4.png‎|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6353</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6353"/>
				<updated>2013-09-20T09:46:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Badge1.png‎|thumb]&lt;br /&gt;
|[[File:Badge2.png‎|thumb]]&lt;br /&gt;
|[[File:Badge3.png‎|thumb]]&lt;br /&gt;
|[[File:Badge4.png‎|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6352</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6352"/>
				<updated>2013-09-20T09:45:48Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Badge1.png‎|thumb]&lt;br /&gt;
|[File:Badge2.png‎|thumb]]&lt;br /&gt;
|[[File:Badge3.png‎|thumb]]&lt;br /&gt;
|[[File:Badge4.png‎|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6351</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6351"/>
				<updated>2013-09-20T09:45:01Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Badge1.png‎|thumb]&lt;br /&gt;
|[File:Badge2.png‎|thumb]]&lt;br /&gt;
|[[File:Badge3.png‎|thumb]]&lt;br /&gt;
|[[File:Badge4.png‎|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6350</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6350"/>
				<updated>2013-09-20T09:42:17Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
[[File:Badge1.png‎|thumb|left|]][[File:Badge2.png‎|thumb|center|]][[File:Badge3.png‎|thumb|center|]][[File:Badge4.png‎|thumb|right|]]&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6349</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6349"/>
				<updated>2013-09-20T09:41:37Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
[[File:Badge1.png‎|thumb|right|]][[File:Badge2.png‎|thumb|right|]][[File:Badge3.png‎|thumb|right|]][[File:Badge4.png‎|thumb|right|]]&lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge4.png&amp;diff=6348</id>
		<title>File:Badge4.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge4.png&amp;diff=6348"/>
				<updated>2013-09-20T09:40:40Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge3.png&amp;diff=6347</id>
		<title>File:Badge3.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge3.png&amp;diff=6347"/>
				<updated>2013-09-20T09:40:36Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge2.png&amp;diff=6346</id>
		<title>File:Badge2.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge2.png&amp;diff=6346"/>
				<updated>2013-09-20T09:40:31Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge1.png&amp;diff=6345</id>
		<title>File:Badge1.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:Badge1.png&amp;diff=6345"/>
				<updated>2013-09-20T09:40:17Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6344</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6344"/>
				<updated>2013-09-20T09:39:30Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
[[File:CorwdTranslator_Badges_notification..png|thumb|left||Example of notification]]&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:CorwdTranslator_Badges_notification..png&amp;diff=6343</id>
		<title>File:CorwdTranslator Badges notification..png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:CorwdTranslator_Badges_notification..png&amp;diff=6343"/>
				<updated>2013-09-20T09:38:04Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6342</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6342"/>
				<updated>2013-09-20T09:37:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
[[File:CrowdTranslator_Form.png|thumb|right|alt=The translation submission form.|The translation submission form]]&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Form.png&amp;diff=6341</id>
		<title>File:CrowdTranslator Form.png</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=File:CrowdTranslator_Form.png&amp;diff=6341"/>
				<updated>2013-09-20T09:35:17Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6340</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6340"/>
				<updated>2013-09-20T09:33:55Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites(2) from submitting translations(1)&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
(1)&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
(2)Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
==Remote submission of translations==&lt;br /&gt;
&lt;br /&gt;
The plugin allows communication between several instances of Geeklog. That is a collection of translations from one site can be transferred to another. In order to achieve this the sender must get approved from the receiver. In fact the only way (currently) is to contact the site admin and request an account. To access this part of the plugin click the 'Manage Remote Submission' from the admin panel. Setting up remote senders is easy enough, as is sending data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Allowing remote submission===&lt;br /&gt;
&lt;br /&gt;
By simply imputing a new site name and password you have allowed a new user(remote site) to submit translations to your database. After that give the credentials to the remote site's Admin and you are ready to go. &lt;br /&gt;
Previously submitted translations are not accepted.&lt;br /&gt;
Only translations with more than 1 up vote will be sent.&lt;br /&gt;
&lt;br /&gt;
===Sending translations===&lt;br /&gt;
&lt;br /&gt;
To send translations it is necessary to specify the website you are sending to, if this website is www.geeklog.net you would enter geeklog.net. Other than that you will need to provide the site name and credentials the remote site admin created for you and the language you are sending. (the list of languages is generated from the entries in you database)&lt;br /&gt;
&lt;br /&gt;
===Bragging rights===&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;new&amp;quot; feature is the iframe you can add to your website, if you have submitted translations to a remote website you will get code which can be included in your site. For now it will simply display the number of translations you have submitted to the remote site. In the future instead of this the badges available to local users should be displayed.&lt;br /&gt;
&lt;br /&gt;
==Managing local and remote users==&lt;br /&gt;
&lt;br /&gt;
Most user management is done inside the translations table.(see Translations management section of this document). The difference between sites and users is that users can simply be unblocked from the admin panel, sites however are permanently deleted, to allow a site to submit translations again you have to create a new account for them&lt;br /&gt;
&lt;br /&gt;
==Packing translations==&lt;br /&gt;
&lt;br /&gt;
To pack translations you simply have to click the text pack this in the admin panel. This will create and output a PHP file inside the language folder. It will take translations from your website and generate a file with the same structure Geeklog uses.&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;amp;action=edit, Developer documentation]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6339</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6339"/>
				<updated>2013-09-20T09:30:02Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
* Block users/sites** from submitting translations*&lt;br /&gt;
* Delete translations&lt;br /&gt;
* Query by:&lt;br /&gt;
* User or Site**&lt;br /&gt;
* Language&lt;br /&gt;
* Votes&lt;br /&gt;
* Time posted&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
**Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6338</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6338"/>
				<updated>2013-09-20T09:29:20Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
Block users/sites** from submitting translations*&lt;br /&gt;
Delete translations&lt;br /&gt;
Query by:&lt;br /&gt;
User or Site**&lt;br /&gt;
Language&lt;br /&gt;
Votes&lt;br /&gt;
Time posted&lt;br /&gt;
*&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
**Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6337</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6337"/>
				<updated>2013-09-20T09:29:02Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
Block users/sites** from submitting translations*&lt;br /&gt;
Delete translations&lt;br /&gt;
Query by:&lt;br /&gt;
User or Site**&lt;br /&gt;
Language&lt;br /&gt;
Votes&lt;br /&gt;
Time posted&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;*Note&amp;lt;/span&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
**Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6336</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6336"/>
				<updated>2013-09-20T09:28:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
Block users/sites** from submitting translations*&lt;br /&gt;
Delete translations&lt;br /&gt;
Query by:&lt;br /&gt;
User or Site**&lt;br /&gt;
Language&lt;br /&gt;
Votes&lt;br /&gt;
Time posted&lt;br /&gt;
&amp;lt;font color=#FFF5F5&amp;gt;*Note&amp;lt;/font&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
**Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6335</id>
		<title>Crowdsourcing Translations</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations&amp;diff=6335"/>
				<updated>2013-09-20T09:27:51Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
CrowdTranslator is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
This is a being developed by [http://www.linkedin.com/profile/view?id=188717601, Benjamin Talic] under the mentorship of [http://www.linkedin.com/profile/view?id=11473251, Dirk Haun] as a project during the Google Summer of Code 2013. &lt;br /&gt;
&lt;br /&gt;
The plugin uses a side block to provide a form for translation submitting, it will add badges to user profiles, the public page is intended for users to manage their translations, the admin page will allow overall translations management. &lt;br /&gt;
&lt;br /&gt;
==What are the plugins features?==&lt;br /&gt;
* Translations submission&lt;br /&gt;
* Gamification badges&lt;br /&gt;
* Translations management and Simple translation queries&lt;br /&gt;
* Remote submission of translations&lt;br /&gt;
* Managing local and remote users&lt;br /&gt;
* Translation packing&lt;br /&gt;
&lt;br /&gt;
==Translations submission==&lt;br /&gt;
The translations are submitted via a form on the left side block. The left side is used because left side blocks are available on more pages than the right side blocks.&lt;br /&gt;
&lt;br /&gt;
The form provides users with the possibility to select or change the selected language. Users can type in any language they want but a list of languages is generated from the database of previously translated and languages Geeklog ships with as a auto suggest for users while typing in. This allows users to create new languages but should prevent creating duplicate entries. &lt;br /&gt;
&lt;br /&gt;
The form provides buttons for highlighting phrases on the page, or removing the highlight. To keep everything as small as possible the form shows a limited number of phrases at once but the users can scroll up and down. &lt;br /&gt;
If a certain phrase already has a submitted translation the translation is shown and users have the possibility to vote those translations up or down. After a certain number of negative votes the translation will be deleted. &lt;br /&gt;
&lt;br /&gt;
The form also provides users with guidelines on how to use the translator. &lt;br /&gt;
Finally if the user earns a badge a notification will be shown. &lt;br /&gt;
&lt;br /&gt;
==Gamification==&lt;br /&gt;
Currently the plugin supports 4 types of badges, 2 of which are continuous. The continuous badges will grow in level once a user has reached the necessary goal.&lt;br /&gt;
Additional badges might be added. If you do have requests for badges look up the code documentation, or the authors contact information or Geeklog's developer mailing list.&lt;br /&gt;
&lt;br /&gt;
==Translations management==&lt;br /&gt;
Translations management is divided into to two &amp;quot;levels&amp;quot; the global,admin management and the single user management. The single user management is available in the CrowdTranslator public page and allows users to manage their own translations. The global translations management is available through the CrowdTranslator admin panel. Visually and functionally the two are very similar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table not only provides you with a preview of translated phrases but also lets you:&lt;br /&gt;
Block users/sites** from submitting translations*&lt;br /&gt;
Delete translations&lt;br /&gt;
Query by:&lt;br /&gt;
User or Site**&lt;br /&gt;
Language&lt;br /&gt;
Votes&lt;br /&gt;
Time posted&lt;br /&gt;
&amp;lt;font color=red&amp;gt;*Note&amp;lt;/font&amp;gt;: Blocking a user will also delete their translations&lt;br /&gt;
**Site refers to websites which you have allowed to submit translations to your website&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]][[Category:User Documentation]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6334</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6334"/>
				<updated>2013-09-20T09:20:23Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
=====Function addslashesPacking=====&lt;br /&gt;
In order to prevent escaping phrase caracters (e.g. Don't =&amp;gt; Don\'t) this function will do custom escaping&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| this_quote_type|| The quote type used for the current line (s for ' or d for &amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||string|| value|| The actual string we are escaping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| the escaped string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function getPhraseFromDB=====&lt;br /&gt;
Checks if current LANG element is translated (inside the database) if it is it will be formated and returned&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_key|| the current array key&lt;br /&gt;
|-&lt;br /&gt;
||string|| value2|| the curretn phrase&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_subindex|| if set the index of the sub-array default value = -1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| eaither value2 or the translation found in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_content|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| The currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_sub_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_conten|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| value2|| The currently processed sub array&lt;br /&gt;
|-&lt;br /&gt;
||array|| key2|| The currently processed sub array name/index&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string|| language_array|| empty - the value will be extracted from the metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/admin/crowdtranslator===&lt;br /&gt;
====send_remote.php====&lt;br /&gt;
=====Function add_remote_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function credentials_form=====&lt;br /&gt;
Generates the form for submiting translations to a remote web page&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the form&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_peer_list=====&lt;br /&gt;
Get the list of sites allowed to submit translations&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_remote_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====string_extract.js====&lt;br /&gt;
&lt;br /&gt;
=====Members=====&lt;br /&gt;
language_strings&lt;br /&gt;
&lt;br /&gt;
=====Function add_autocomplete_to_language_input=====&lt;br /&gt;
Gets list of available languages for translation via AJAX call&lt;br /&gt;
and uses jQueryUI to create auto-complete option for the language selection input&lt;br /&gt;
&lt;br /&gt;
=====Function add_notification=====&lt;br /&gt;
Adds notification to side view if awards have been given&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| awards|| 		award number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a new peer is created&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Issuing AJAX call to put a user on the block list&lt;br /&gt;
&lt;br /&gt;
=====Function del_cookie=====&lt;br /&gt;
Deletes a cookie, it is used to delete the selected_language cookie&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Issuing AJAX call to delete a translation from the database&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| id||		The translation id&lt;br /&gt;
|-&lt;br /&gt;
||string|| translation||		the translation text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function doSearch=====&lt;br /&gt;
The function finds the searched text and highlights it&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| c_name||		Name of the cookie&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_all_badges=====&lt;br /&gt;
Issues AJAX call to display all available badges&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| admin||		Indicating if showing all badges awarded to a user or all badges available&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_base_url=====&lt;br /&gt;
Creates the base url for AJAX calls and resource retrieval (e.g. images)&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Sends a AJAX request to get formatted LANG strings and the actual translation form&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
&lt;br /&gt;
=====Function hide_guidelines=====&lt;br /&gt;
Hides guidelines for translator usage&lt;br /&gt;
&lt;br /&gt;
=====Function hide_language_input=====&lt;br /&gt;
if a language for translation if picked by the user the form is hidden&lt;br /&gt;
&lt;br /&gt;
=====Function mark_bad_inputs=====&lt;br /&gt;
Adds a css class to faulty inputs so they are easily recognizable, Gives a preview of those at the beginning of the form&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| bad_inputs||		array of numbers marking the input id of the faulty inputs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function pack_translation=====&lt;br /&gt;
Does the AJAX call to pack_translation.php which will do the actual translation packing&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| language||		the language name which should be packed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function highlight=====&lt;br /&gt;
adds CSS class to highlight selected string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function prep_doSearch=====&lt;br /&gt;
Prepares the search removing and from passed strings&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Issuing AJAX call to remove a user from the block list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_highlight=====&lt;br /&gt;
removes CSS class of highlighted string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a peer is deleted&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| peer_name||		The string we are searching for&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_submited=====&lt;br /&gt;
removes successfully submitted inputs&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| good_inputs||		array of numbers marking the input id of the successfully saved inputs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function show=====&lt;br /&gt;
Shows content of hidden divs&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| id|| the id of the function calls&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function show_guidelines=====&lt;br /&gt;
Shows guidelines for CrowdTranslator usage&lt;br /&gt;
&lt;br /&gt;
=====Function show_language_input=====&lt;br /&gt;
if the user wants to change the picked language this function will show the translation form again and reset navigation variables&lt;br /&gt;
&lt;br /&gt;
=====Function show_more_translations=====&lt;br /&gt;
Issues AJAX call to retrieve next/previous translations, change order of translations or increase translations display per page&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| id|| number of translations per page&lt;br /&gt;
|-&lt;br /&gt;
||integer|| start||first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer|| admin||indicating if admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||string|| order_by||indicating the ordering of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function show_next=====&lt;br /&gt;
Will show the next 6 (or less) input fields of the translation form If neccessary disables the arrow for showing next translations&lt;br /&gt;
=====Function show_previous=====&lt;br /&gt;
Will show the previous 6 (or less) input fields of the translation form If neccessary disables the arrow for showing previous translations&lt;br /&gt;
&lt;br /&gt;
=====Function show_progress_bar=====&lt;br /&gt;
Will show a graphical representation of the amount of translated strings to the current language&lt;br /&gt;
=====Function translation_table_change_limit=====&lt;br /&gt;
Changing the number of translations shown per page&lt;br /&gt;
=====Function translator_form_submit=====&lt;br /&gt;
The call is handled via AJAX after the response is sent faulty inputs, if any will be marked as such the user is notified about successfully saved inputs, those input boxes will be removed&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
A request is sent to mark the vote in the database if the translation is deleted because of too many bad votes (currently 5) the translation is deleted and the page reloaded othervise the object which made the request is highlighted and disabled&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| sign|| the vote -1 or 1 depending on user choice&lt;br /&gt;
|-&lt;br /&gt;
||string|| id||the id of the language_string associated with the string which is voted&lt;br /&gt;
|-&lt;br /&gt;
||object|| object||the object which made the call&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Summer of Code]]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6333</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6333"/>
				<updated>2013-09-20T03:58:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
=====Function addslashesPacking=====&lt;br /&gt;
In order to prevent escaping phrase caracters (e.g. Don't =&amp;gt; Don\'t) this function will do custom escaping&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| this_quote_type|| The quote type used for the current line (s for ' or d for &amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||string|| value|| The actual string we are escaping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| the escaped string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function getPhraseFromDB=====&lt;br /&gt;
Checks if current LANG element is translated (inside the database) if it is it will be formated and returned&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_key|| the current array key&lt;br /&gt;
|-&lt;br /&gt;
||string|| value2|| the curretn phrase&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_subindex|| if set the index of the sub-array default value = -1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| eaither value2 or the translation found in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_content|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| The currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_sub_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_conten|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| value2|| The currently processed sub array&lt;br /&gt;
|-&lt;br /&gt;
||array|| key2|| The currently processed sub array name/index&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string|| language_array|| empty - the value will be extracted from the metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/admin/crowdtranslator===&lt;br /&gt;
====send_remote.php====&lt;br /&gt;
=====Function add_remote_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function credentials_form=====&lt;br /&gt;
Generates the form for submiting translations to a remote web page&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the form&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_peer_list=====&lt;br /&gt;
Get the list of sites allowed to submit translations&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_remote_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====string_extract.js====&lt;br /&gt;
&lt;br /&gt;
=====Members=====&lt;br /&gt;
language_strings&lt;br /&gt;
&lt;br /&gt;
=====Function add_autocomplete_to_language_input=====&lt;br /&gt;
Gets list of available languages for translation via AJAX call&lt;br /&gt;
and uses jQueryUI to create auto-complete option for the language selection input&lt;br /&gt;
&lt;br /&gt;
=====Function add_notification=====&lt;br /&gt;
Adds notification to side view if awards have been given&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| awards|| 		award number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a new peer is created&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Issuing AJAX call to put a user on the block list&lt;br /&gt;
&lt;br /&gt;
=====Function del_cookie=====&lt;br /&gt;
Deletes a cookie, it is used to delete the selected_language cookie&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Issuing AJAX call to delete a translation from the database&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| id||		The translation id&lt;br /&gt;
|-&lt;br /&gt;
||string|| translation||		the translation text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function doSearch=====&lt;br /&gt;
The function finds the searched text and highlights it&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| c_name||		Name of the cookie&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_all_badges=====&lt;br /&gt;
Issues AJAX call to display all available badges&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| admin||		Indicating if showing all badges awarded to a user or all badges available&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_base_url=====&lt;br /&gt;
Creates the base url for AJAX calls and resource retrieval (e.g. images)&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Sends a AJAX request to get formatted LANG strings and the actual translation form&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
&lt;br /&gt;
=====Function hide_guidelines=====&lt;br /&gt;
Hides guidelines for translator usage&lt;br /&gt;
&lt;br /&gt;
=====Function hide_language_input=====&lt;br /&gt;
if a language for translation if picked by the user the form is hidden&lt;br /&gt;
&lt;br /&gt;
=====Function mark_bad_inputs=====&lt;br /&gt;
Adds a css class to faulty inputs so they are easily recognizable, Gives a preview of those at the beginning of the form&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| bad_inputs||		array of numbers marking the input id of the faulty inputs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function pack_translation=====&lt;br /&gt;
Does the AJAX call to pack_translation.php which will do the actual translation packing&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| language||		the language name which should be packed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function highlight=====&lt;br /&gt;
adds CSS class to highlight selected string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function prep_doSearch=====&lt;br /&gt;
Prepares the search removing and from passed strings&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Issuing AJAX call to remove a user from the block list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_highlight=====&lt;br /&gt;
removes CSS class of highlighted string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a peer is deleted&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| peer_name||		The string we are searching for&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_submited=====&lt;br /&gt;
removes successfully submitted inputs&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| good_inputs||		array of numbers marking the input id of the successfully saved inputs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function show=====&lt;br /&gt;
Shows content of hidden divs&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| id|| the id of the function calls&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function show_guidelines=====&lt;br /&gt;
Shows guidelines for CrowdTranslator usage&lt;br /&gt;
&lt;br /&gt;
=====Function show_language_input=====&lt;br /&gt;
if the user wants to change the picked language this function will show the translation form again and reset navigation variables&lt;br /&gt;
&lt;br /&gt;
=====Function show_more_translations=====&lt;br /&gt;
Issues AJAX call to retrieve next/previous translations, change order of translations or increase translations display per page&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| id|| number of translations per page&lt;br /&gt;
|-&lt;br /&gt;
||integer|| start||first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer|| admin||indicating if admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||string|| order_by||indicating the ordering of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function show_next=====&lt;br /&gt;
Will show the next 6 (or less) input fields of the translation form If neccessary disables the arrow for showing next translations&lt;br /&gt;
=====Function show_previous=====&lt;br /&gt;
Will show the previous 6 (or less) input fields of the translation form If neccessary disables the arrow for showing previous translations&lt;br /&gt;
&lt;br /&gt;
=====Function show_progress_bar=====&lt;br /&gt;
Will show a graphical representation of the amount of translated strings to the current language&lt;br /&gt;
=====Function translation_table_change_limit=====&lt;br /&gt;
Changing the number of translations shown per page&lt;br /&gt;
=====Function translator_form_submit=====&lt;br /&gt;
The call is handled via AJAX after the response is sent faulty inputs, if any will be marked as such the user is notified about successfully saved inputs, those input boxes will be removed&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
A request is sent to mark the vote in the database if the translation is deleted because of too many bad votes (currently 5) the translation is deleted and the page reloaded othervise the object which made the request is highlighted and disabled&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| sign|| the vote -1 or 1 depending on user choice&lt;br /&gt;
|-&lt;br /&gt;
||string|| id||the id of the language_string associated with the string which is voted&lt;br /&gt;
|-&lt;br /&gt;
||object|| object||the object which made the call&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6332</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6332"/>
				<updated>2013-09-20T03:57:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
=====Function addslashesPacking=====&lt;br /&gt;
In order to prevent escaping phrase caracters (e.g. Don't =&amp;gt; Don\'t) this function will do custom escaping&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| this_quote_type|| The quote type used for the current line (s for ' or d for &amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||string|| value|| The actual string we are escaping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| the escaped string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function getPhraseFromDB=====&lt;br /&gt;
Checks if current LANG element is translated (inside the database) if it is it will be formated and returned&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_key|| the current array key&lt;br /&gt;
|-&lt;br /&gt;
||string|| value2|| the curretn phrase&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_subindex|| if set the index of the sub-array default value = -1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| eaither value2 or the translation found in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_content|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| The currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_sub_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_conten|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| value2|| The currently processed sub array&lt;br /&gt;
|-&lt;br /&gt;
||array|| key2|| The currently processed sub array name/index&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string|| language_array|| empty - the value will be extracted from the metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/admin/crowdtranslator===&lt;br /&gt;
====send_remote.php====&lt;br /&gt;
=====Function add_remote_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function credentials_form=====&lt;br /&gt;
Generates the form for submiting translations to a remote web page&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the form&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_peer_list=====&lt;br /&gt;
Get the list of sites allowed to submit translations&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_remote_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====string_extract.js====&lt;br /&gt;
&lt;br /&gt;
=====Members=====&lt;br /&gt;
language_strings&lt;br /&gt;
&lt;br /&gt;
=====Function add_autocomplete_to_language_input=====&lt;br /&gt;
Gets list of available languages for translation via AJAX call&lt;br /&gt;
and uses jQueryUI to create auto-complete option for the language selection input&lt;br /&gt;
&lt;br /&gt;
=====Function add_notification=====&lt;br /&gt;
Adds notification to side view if awards have been given&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| awards|| 		award number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a new peer is created&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Issuing AJAX call to put a user on the block list&lt;br /&gt;
&lt;br /&gt;
=====Function del_cookie=====&lt;br /&gt;
Deletes a cookie, it is used to delete the selected_language cookie&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Issuing AJAX call to delete a translation from the database&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| id||		The translation id&lt;br /&gt;
|-&lt;br /&gt;
||string|| translation||		the translation text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function doSearch=====&lt;br /&gt;
The function finds the searched text and highlights it&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| c_name||		Name of the cookie&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_all_badges=====&lt;br /&gt;
Issues AJAX call to display all available badges&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| admin||		Indicating if showing all badges awarded to a user or all badges available&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_base_url=====&lt;br /&gt;
Creates the base url for AJAX calls and resource retrieval (e.g. images)&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Sends a AJAX request to get formatted LANG strings and the actual translation form&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
&lt;br /&gt;
=====Function hide_guidelines=====&lt;br /&gt;
Hides guidelines for translator usage&lt;br /&gt;
&lt;br /&gt;
=====Function hide_language_input=====&lt;br /&gt;
if a language for translation if picked by the user the form is hidden&lt;br /&gt;
&lt;br /&gt;
=====Function mark_bad_inputs=====&lt;br /&gt;
Adds a css class to faulty inputs so they are easily recognizable, Gives a preview of those at the beginning of the form&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| bad_inputs||		array of numbers marking the input id of the faulty inputs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function pack_translation=====&lt;br /&gt;
Does the AJAX call to pack_translation.php which will do the actual translation packing&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| language||		the language name which should be packed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function highlight=====&lt;br /&gt;
adds CSS class to highlight selected string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function prep_doSearch=====&lt;br /&gt;
Prepares the search removing and from passed strings&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Issuing AJAX call to remove a user from the block list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_highlight=====&lt;br /&gt;
removes CSS class of highlighted string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a peer is deleted&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| peer_name||		The string we are searching for&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_submited=====&lt;br /&gt;
removes successfully submitted inputs&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| good_inputs||		array of numbers marking the input id of the successfully saved inputs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function show=====&lt;br /&gt;
Shows content of hidden divs&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| id|| the id of the function calls&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function show_guidelines=====&lt;br /&gt;
Shows guidelines for CrowdTranslator usage&lt;br /&gt;
&lt;br /&gt;
=====Function show_language_input=====&lt;br /&gt;
if the user wants to change the picked language this function will show the translation form again and reset navigation variables&lt;br /&gt;
&lt;br /&gt;
=====Function show_more_translations=====&lt;br /&gt;
Issues AJAX call to retrieve next/previous translations, change order of translations or increase translations display per page&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| id|| number of translations per page&lt;br /&gt;
|-&lt;br /&gt;
||integer|| start||first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer|| admin||indicating if admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||string|| order_by||indicating the ordering of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function show_next=====&lt;br /&gt;
Will show the next 6 (or less) input fields of the translation form If neccessary disables the arrow for showing next translations&lt;br /&gt;
=====Function show_previous=====&lt;br /&gt;
Will show the previous 6 (or less) input fields of the translation form If neccessary disables the arrow for showing previous translations&lt;br /&gt;
&lt;br /&gt;
=====Function show_progress_bar=====&lt;br /&gt;
Will show a graphical representation of the amount of translated strings to the current language&lt;br /&gt;
=====Function translation_table_change_limit=====&lt;br /&gt;
Changing the number of translations shown per page&lt;br /&gt;
=====Function translator_form_submit=====&lt;br /&gt;
The call is handled via AJAX after the response is sent faulty inputs, if any will be marked as such the user is notified about successfully saved inputs, those input boxes will be removed&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
A request is sent to mark the vote in the database if the translation is deleted because of too many bad votes (currently 5) the translation is deleted and the page reloaded othervise the object which made the request is highlighted and disabled&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| sign|| the vote -1 or 1 depending on user choice&lt;br /&gt;
|-&lt;br /&gt;
||string|| id||the id of the language_string associated with the string which is voted&lt;br /&gt;
|-&lt;br /&gt;
||object|| object||the object which made the call&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6331</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6331"/>
				<updated>2013-09-20T03:48:12Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
=====Function addslashesPacking=====&lt;br /&gt;
In order to prevent escaping phrase caracters (e.g. Don't =&amp;gt; Don\'t) this function will do custom escaping&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| this_quote_type|| The quote type used for the current line (s for ' or d for &amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||string|| value|| The actual string we are escaping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| the escaped string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function getPhraseFromDB=====&lt;br /&gt;
Checks if current LANG element is translated (inside the database) if it is it will be formated and returned&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_key|| the current array key&lt;br /&gt;
|-&lt;br /&gt;
||string|| value2|| the curretn phrase&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_subindex|| if set the index of the sub-array default value = -1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| eaither value2 or the translation found in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_content|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| The currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_sub_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_conten|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| value2|| The currently processed sub array&lt;br /&gt;
|-&lt;br /&gt;
||array|| key2|| The currently processed sub array name/index&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string|| language_array|| empty - the value will be extracted from the metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/admin/crowdtranslator===&lt;br /&gt;
====send_remote.php====&lt;br /&gt;
=====Function add_remote_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function credentials_form=====&lt;br /&gt;
Generates the form for submiting translations to a remote web page&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the form&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_peer_list=====&lt;br /&gt;
Get the list of sites allowed to submit translations&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_remote_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====string_extract.js====&lt;br /&gt;
&lt;br /&gt;
=====Members=====&lt;br /&gt;
language_strings&lt;br /&gt;
&lt;br /&gt;
=====Function add_autocomplete_to_language_input=====&lt;br /&gt;
Gets list of available languages for translation via AJAX call&lt;br /&gt;
and uses jQueryUI to create auto-complete option for the language selection input&lt;br /&gt;
&lt;br /&gt;
=====Function add_notification=====&lt;br /&gt;
Adds notification to side view if awards have been given&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| awards|| 		award number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a new peer is created&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Issuing AJAX call to put a user on the block list&lt;br /&gt;
&lt;br /&gt;
=====Function del_cookie=====&lt;br /&gt;
Deletes a cookie, it is used to delete the selected_language cookie&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Issuing AJAX call to delete a translation from the database&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| id||		The translation id&lt;br /&gt;
|-&lt;br /&gt;
||string|| translation||		the translation text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function doSearch=====&lt;br /&gt;
The function finds the searched text and highlights it&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| c_name||		Name of the cookie&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_all_badges=====&lt;br /&gt;
Issues AJAX call to display all available badges&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||int|| admin||		Indicating if showing all badges awarded to a user or all badges available&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_base_url=====&lt;br /&gt;
Creates the base url for AJAX calls and resource retrieval (e.g. images)&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Sends a AJAX request to get formatted LANG strings and the actual translation form&lt;br /&gt;
&lt;br /&gt;
=====Function getCookie=====&lt;br /&gt;
Gets the script saved cookie&lt;br /&gt;
&lt;br /&gt;
=====Function hide_guidelines=====&lt;br /&gt;
Hides guidelines for translator usage&lt;br /&gt;
&lt;br /&gt;
=====Function hide_language_input=====&lt;br /&gt;
if a language for translation if picked by the user the form is hidden&lt;br /&gt;
&lt;br /&gt;
=====Function mark_bad_inputs=====&lt;br /&gt;
Adds a css class to faulty inputs so they are easily recognizable, Gives a preview of those at the beginning of the form&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| bad_inputs||		array of numbers marking the input id of the faulty inputs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function pack_translation=====&lt;br /&gt;
Does the AJAX call to pack_translation.php which will do the actual translation packing&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| language||		the language name which should be packed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function highlight=====&lt;br /&gt;
adds CSS class to highlight selected string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function prep_doSearch=====&lt;br /&gt;
Prepares the search removing and from passed strings&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| text||		The string we are searching for&lt;br /&gt;
|-&lt;br /&gt;
||string|| value||		The value, either color or inherit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Issuing AJAX call to remove a user from the block list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_highlight=====&lt;br /&gt;
removes CSS class of highlighted string(s) on page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Does a AJAX call to lib-translator.php a peer is deleted&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| peer_name||		The string we are searching for&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6330</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6330"/>
				<updated>2013-09-20T03:11:17Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: /* Function extract_metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
=====Function addslashesPacking=====&lt;br /&gt;
In order to prevent escaping phrase caracters (e.g. Don't =&amp;gt; Don\'t) this function will do custom escaping&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| this_quote_type|| The quote type used for the current line (s for ' or d for &amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||string|| value|| The actual string we are escaping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| the escaped string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function getPhraseFromDB=====&lt;br /&gt;
Checks if current LANG element is translated (inside the database) if it is it will be formated and returned&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_key|| the current array key&lt;br /&gt;
|-&lt;br /&gt;
||string|| value2|| the curretn phrase&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_subindex|| if set the index of the sub-array default value = -1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| eaither value2 or the translation found in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_content|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| The currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_sub_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_conten|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| value2|| The currently processed sub array&lt;br /&gt;
|-&lt;br /&gt;
||array|| key2|| The currently processed sub array name/index&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string|| language_array|| empty - the value will be extracted from the metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/admin/crowdtranslator===&lt;br /&gt;
====send_remote.php====&lt;br /&gt;
=====Function add_remote_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function credentials_form=====&lt;br /&gt;
Generates the form for submiting translations to a remote web page&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the form&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_peer_list=====&lt;br /&gt;
Get the list of sites allowed to submit translations&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_remote_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6329</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6329"/>
				<updated>2013-09-20T03:10:25Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
=====Function addslashesPacking=====&lt;br /&gt;
In order to prevent escaping phrase caracters (e.g. Don't =&amp;gt; Don\'t) this function will do custom escaping&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| this_quote_type|| The quote type used for the current line (s for ' or d for &amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||string|| value|| The actual string we are escaping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| the escaped string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function getPhraseFromDB=====&lt;br /&gt;
Checks if current LANG element is translated (inside the database) if it is it will be formated and returned&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_key|| the current array key&lt;br /&gt;
|-&lt;br /&gt;
||string|| value2|| the curretn phrase&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_subindex|| if set the index of the sub-array default value = -1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| eaither value2 or the translation found in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_content|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| The currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_sub_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_conten|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| value2|| The currently processed sub array&lt;br /&gt;
|-&lt;br /&gt;
||array|| key2|| The currently processed sub array name/index&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string|| language_array|| empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string|| language_array|| empty - the value will be extracted from the metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/admin/crowdtranslator===&lt;br /&gt;
====send_remote.php====&lt;br /&gt;
=====Function add_remote_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function credentials_form=====&lt;br /&gt;
Generates the form for submiting translations to a remote web page&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the form&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_peer_list=====&lt;br /&gt;
Get the list of sites allowed to submit translations&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| HTML code for the list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_remote_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6328</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6328"/>
				<updated>2013-09-20T02:59:03Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
=====Function addslashesPacking=====&lt;br /&gt;
In order to prevent escaping phrase caracters (e.g. Don't =&amp;gt; Don\'t) this function will do custom escaping&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| this_quote_type|| The quote type used for the current line (s for ' or d for &amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||string|| value|| The actual string we are escaping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| the escaped string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function getPhraseFromDB=====&lt;br /&gt;
Checks if current LANG element is translated (inside the database) if it is it will be formated and returned&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_key|| the current array key&lt;br /&gt;
|-&lt;br /&gt;
||string|| value2|| the curretn phrase&lt;br /&gt;
|-&lt;br /&gt;
||string|| array_subindex|| if set the index of the sub-array default value = -1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| eaither value2 or the translation found in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_content|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| current_array|| The currently processed array&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function print_sub_array=====&lt;br /&gt;
Will format the array output for the new language file, the output is generated line by line - each line is one array element&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| file_conten|| the previously generated content of the file&lt;br /&gt;
|-&lt;br /&gt;
||array|| value2|| The currently processed sub array&lt;br /&gt;
|-&lt;br /&gt;
||array|| key2|| The currently processed sub array name/index&lt;br /&gt;
|-&lt;br /&gt;
||string|| spacing|| The indentation used&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type|| The type of quotes (' or &amp;quot;) used for the current line&lt;br /&gt;
|-&lt;br /&gt;
||array|| quote_type_count|| counter keeping track on which quote should be used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6327</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6327"/>
				<updated>2013-09-20T02:45:12Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_users_translating=====&lt;br /&gt;
Returns number of users translating&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of users using the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_votes_count=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of votes casted across translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function give_award=====&lt;br /&gt;
The award is given to the user by saving it to the awarded_gems table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id = null||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$award_lvl = 0||	 award_lvl the level of the award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_block=====&lt;br /&gt;
Removes specified user from block list&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id ID of user to be un-blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_peer=====&lt;br /&gt;
Removes remote submission credentials from the database as well as translations submitted by the remote site&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function save_to_database=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	$process_q||	 process_q array of objects/translations to be saved to the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function submit_translation=====&lt;br /&gt;
After translations are submitted an AJAX call is issued to this functions, it will process the submitted translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 json encoded string holding data on number of valid and invalid translations, number of given awards and the percent of translation for the current language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function vote=====&lt;br /&gt;
Saves the user vote or updates existing vote notifies the JS if the page has to be reloaded-this happens if a translation is deleted&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
||string||	 JSON encoded string with failure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6326</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6326"/>
				<updated>2013-09-20T02:37:00Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_headers=====&lt;br /&gt;
The html code of the table header for the table displaying translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin if set to 1 the table will have a username header&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit number of translations to be shown, used for onclick method setting inside the headers&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
||string||	 HTML code for the table header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_query=====&lt;br /&gt;
Assembles query used for the translations table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterions If 1 we are using admin mode where the translators user name has to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start||	 start First translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by||	 order_by The ordering rule used in the query&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit The number of translations to be shown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 returns The sql query assembled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_with_negative_vote_count=====&lt;br /&gt;
Returns number of translations with negative approval count&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of translations with negative aproval_count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_badges=====&lt;br /&gt;
Retrieves badges accumulated in admin mode retrieves all available badges&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 limit The number of badges to be displayed&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin = 0||	 admin Weather to use user or admin mode&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$show_not_awarded = true||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translated_languages=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$user_id = null||	 user_id If set to null the function will return all languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string|| The	 HTML of the progress bars for each retrieved language&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_translations_table=====&lt;br /&gt;
Makes the translations table for users&lt;br /&gt;
&lt;br /&gt;
See: get_translations_table_table for translations table in admin mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_user_votes=====&lt;br /&gt;
Get the number of votes casted by current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer|| returns	 number of votes casted by current user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6325</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6325"/>
				<updated>2013-09-20T02:26:19Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most up votes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer	 biggest number of up votes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_total_approval_for_user=====&lt;br /&gt;
Get the sum of all approvals across translations for current user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||  the sum of all approvals for a single user&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_count=====&lt;br /&gt;
Returns number of translations submitted by single user or in total depending on rge $admin param&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin Indicates if the function will return the number of votes submitted by one user or in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 returns number of translations submitted by current user/in total&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translated_languages=====&lt;br /&gt;
Returns HTML code for the progress bars of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 HTML code of progress bars for languages being translated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translation_percent=====&lt;br /&gt;
Calculates the percentage of translation for a language&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$language = null||	 language The for which the percentage is calculated&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||float||	 The percentage of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_options=====&lt;br /&gt;
When an AJAX call is used to show the table with translations the params are retrieved here&lt;br /&gt;
See: get_translations_table_query()&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $limit||	 &amp;amp;limit the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $start||	 &amp;amp;start the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $order_by||	 &amp;amp;order_by the ordering of translations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table=====&lt;br /&gt;
Makes the translations table for admins&lt;br /&gt;
&lt;br /&gt;
See: get_user_translations_table for translations table in user mode&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = 5||	 limit number of translations shown per page, default value is 5&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$start = -1||	 start first translation to be shown , default value -1&lt;br /&gt;
|-&lt;br /&gt;
||string||	$order_by = '`posted`, `id` DESC'||	 order_by the ordering of the translation default value 'posted, id DESC'&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string	 HTML code of the table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_translations_table_finalize=====&lt;br /&gt;
Assembles last row of the translations table ncludes the click for Previous show, Next show and input box for limit&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$previous||	 previous indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$next||	 next indicates the first translation to be shown&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$admin||	 admin used for onclick method inside the code indicating if the table is admin mode or user mode&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit||	 limit used for onclick method inside the code indicating the number of translations to be shown&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$order_by = '`posted`, `id` DESC'||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string	 display HTML code of the last table row which includes the click for Previous show, Next show and input box for limit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6324</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6324"/>
				<updated>2013-09-20T02:16:35Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages_translated_count=====&lt;br /&gt;
Returns number of languages being translated&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of distinct language names in the database&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_most_upvotes=====&lt;br /&gt;
Returns translation with the most upvotes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$criterion||	 criterion if set to zero returns the bigest number of upvotes for translations by current user, otherwise the bigest number of upvotes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer	 bigest number of upvotes for single translation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_original_language_values=====&lt;br /&gt;
Script will take extracted array data find the original array values from the database where all variables and html tags have been replaced with &amp;lt;tag&amp;gt; and create the HTML of the translation form before it is saved to the database&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded data holding the translation form, language strings, tagged strings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_page_url=====&lt;br /&gt;
Returns current page url&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 Current page url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_subindex=====&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Function get_subindex&lt;br /&gt;
Returns the array sub-index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$array||	 array array name from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$index||	 index array index from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array sub-index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6323</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6323"/>
				<updated>2013-09-20T02:09:10Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
|-&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_array=====&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_index=====&lt;br /&gt;
Returns the array index from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array=====&lt;br /&gt;
Generates an array of objects holding translations and their metadata&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	 Objects holding translations and their metadata&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function get_language_array_references_from_included=====&lt;br /&gt;
Generates a list of LANG array elements which are used in pages included in the current page&lt;br /&gt;
&lt;br /&gt;
See: documentation on language mapping and how the plugin works&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $reference||	 &amp;amp;reference the array of previously found LANG references&lt;br /&gt;
|-&lt;br /&gt;
||array||	$included||	 included the array of previously processed included url's&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $includes||	 includes the array of url's to be processed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_languages=====&lt;br /&gt;
the script will return all available languages for translation it will make a list of both languages from the language folder and previously user created languages&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6322</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6322"/>
				<updated>2013-09-20T02:04:15Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|-&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function check_post_variable=====&lt;br /&gt;
Check if post variable is set and non=empty&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	$post_var	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 True if the POST variable specified is set and non-empty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function delete_translation=====&lt;br /&gt;
Removing a single translation from translations table as well as its votes from votes table&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$id = null||	 id the unique id of the translation to be removed&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if the deletion was successful, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function display_badge=====&lt;br /&gt;
When displaying badges this is where the actual HTML code is assembled&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||object||	$gem||	 gem The badge data retrieved from database&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count Keeps count on number of displayed gems, gems will be displayed 4 in a row&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$lvl = ''||	&lt;br /&gt;
|-&lt;br /&gt;
||mixed	$disabled = ''	||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function extract_metadata=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$metadata||	 metadata passed on via POST&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $language_array||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $array_key||	 language_array empty - the value will be extracted from the metadata string&lt;br /&gt;
|-&lt;br /&gt;
||mixed||	&amp;amp; $array_subindex||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Function get_array&lt;br /&gt;
Returns the array name from the metadata string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$string||	 string metadata string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 array name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6321</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6321"/>
				<updated>2013-09-20T01:56:37Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||$user_id = null|| user_id ID of user to be blocked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function check_if_awarded=====&lt;br /&gt;
Check if award with id gem_id is given to user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if user has award&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6320</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6320"/>
				<updated>2013-09-20T01:51:36Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_translation=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$translation_count||	 translation_count number of translation the user has submited&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 true if award is given, false otherwise&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_nth_vote=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function awards=====&lt;br /&gt;
Checks for the awards the user has not received and if criteria is met assigns them for repetitive awards the check is always done&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	 number of awards given&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function block_user=====&lt;br /&gt;
Puts specified user on block list, deletes his translations and votes for those translations and awarded gems&lt;br /&gt;
{|  class=&amp;quot;summary&amp;quot; id=&amp;quot;parameters&amp;quot;&lt;br /&gt;
|+Parameters summary&lt;br /&gt;
|-  id=&amp;quot;$user_id&amp;quot;&lt;br /&gt;
|  class=&amp;quot;name&amp;quot; | &amp;lt;code&amp;gt;integer&amp;lt;/code&amp;gt;&lt;br /&gt;
|  class=&amp;quot;value&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;$user_id&amp;lt;/var&amp;gt; = &amp;lt;span class=&amp;quot;php-keyword1&amp;quot;&amp;gt;null&amp;lt;/span&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
			user_id ID of user to be blocked&lt;br /&gt;
		&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6319</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6319"/>
				<updated>2013-09-20T01:41:09Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function add_peer=====&lt;br /&gt;
Add new credentials to the database, allowing a new site to submit remote translations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 JSON encoded strying with failiure or success message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_first_vote=====&lt;br /&gt;
award for first vote&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function award_mark=====&lt;br /&gt;
nth vote award&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$gem_id||	 gem_id the id under which the award has been given&lt;br /&gt;
||integer||	&amp;amp; $award_lvl||	 award_lvl the level of the award - for continuos awards&lt;br /&gt;
||integer||	&amp;amp; $award_mark||	 award_mark the limit required to get the next award lvl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6318</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6318"/>
				<updated>2013-09-20T01:36:37Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6317</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6317"/>
				<updated>2013-09-20T01:36:04Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
||string||	&amp;amp;$form||	 The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down|| Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6316</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6316"/>
				<updated>2013-09-20T01:34:49Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
||string||	&amp;amp; $form||	 form The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 value current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base_url base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_up||	 disable_up Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down||	 disable_down Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6315</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6315"/>
				<updated>2013-09-20T01:34:13Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
||string||	&amp;amp; $form||	 form The HTML of the translation form&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$count||	 count number of current input field&lt;br /&gt;
|-&lt;br /&gt;
||object||	$value||	 value current translation object, holds all relevant data for the string&lt;br /&gt;
|-&lt;br /&gt;
||string||	$base_url||	 base_url base url for the required resources&lt;br /&gt;
|-&lt;br /&gt;
||string	$disabled_up||	 disable_up Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|-&lt;br /&gt;
||string||	$disabled_down||	 disable_down Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6314</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6314"/>
				<updated>2013-09-20T01:33:20Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===public_html/crowdtranslator===&lt;br /&gt;
====index.php====&lt;br /&gt;
&lt;br /&gt;
=====Function logedin_user_display=====&lt;br /&gt;
Generates the output for loged in users&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
|| string||	 HTML output for loged in users&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function get_info_text=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|| returns|| 	 info text for the plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====lib-translator.php====&lt;br /&gt;
=====Function add_form_element=====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
||string||	&amp;amp; $form||	 form The HTML of the translation form&lt;br /&gt;
||integer||	$count||	 count number of current input field&lt;br /&gt;
||object||	$value||	 value current translation object, holds all relevant data for the string&lt;br /&gt;
||string||	$base_url||	 base_url base url for the required resources&lt;br /&gt;
||string	$disabled_up||	 disable_up Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
||string||	$disabled_down||	 disable_down Will either be empty string or disable if the vote button should be disabled&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====packing.php====&lt;br /&gt;
&lt;br /&gt;
====recieve_remote.php====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6313</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6313"/>
				<updated>2013-09-20T01:17:45Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
====autoinstall====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6312</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6312"/>
				<updated>2013-09-20T01:15:41Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function get_language_array_names=====&lt;br /&gt;
Gets the list of array names used by Geeklog, it connects to the current language file and parses it as a string&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||array ||	 the array of language array names&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Function remove_standard=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $line||	  the string from which tags are to be removed&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_begin||	the begining of the tag&lt;br /&gt;
|-&lt;br /&gt;
||string||	$key_end||	 the end of the tag&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $array||	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function remove_tags=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	$line||	 the array element from which the tags are removed&lt;br /&gt;
|-&lt;br /&gt;
||array||	&amp;amp; $tags|| after the tags are removed they are keept here for later assembly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6311</id>
		<title>Crowdsourcing Translations/Developer Documentation</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Crowdsourcing_Translations/Developer_Documentation&amp;diff=6311"/>
				<updated>2013-09-20T01:03:38Z</updated>
		
		<summary type="html">&lt;p&gt;Bttalic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that allows &amp;quot;crowdsourcing&amp;quot; the translation of Geeklog, i.e. once installed, it allows users to contribute translations of Geeklog's user interface texts for other languages.&lt;br /&gt;
&lt;br /&gt;
This is a being developed by Benjamin Talic as a [[SoC crowdsourcing translations|project]] during the [[Google Summer of Code]] 2013.&lt;br /&gt;
&lt;br /&gt;
==Major Design Decisions ==&lt;br /&gt;
* Any logged-in user should be able to contribute a translation&lt;br /&gt;
* Users can be blocked from contributing by the Admin&lt;br /&gt;
* Ideally, the plugin should also allow translations of plugins (bundled and 3rd party). We'll start with core texts but try to keep things generic, adding plugin support later when possible.&lt;br /&gt;
* To be able to find translations on a page at plugin installation pages are mapped into the database, data on which phrases on which pages is saved along with which pages are included in it&lt;br /&gt;
* Remote contribution is allowed via a form&lt;br /&gt;
* Gamification is added to the plugin&lt;br /&gt;
* The plugin is placed on the left side block - the left side block is shown on more pages&lt;br /&gt;
&lt;br /&gt;
==PHP Documentation==&lt;br /&gt;
===plugins/crowdtranslator===&lt;br /&gt;
&lt;br /&gt;
====sql====&lt;br /&gt;
=====translations table=====&lt;br /&gt;
Saves the submitted translations&lt;br /&gt;
=====originals table=====&lt;br /&gt;
Saves the original phrase values, changing HTML and PHP code with &amp;lt;tag&amp;gt; and &amp;lt;var&amp;gt;&lt;br /&gt;
=====votes table=====&lt;br /&gt;
Saves data on votes for translations&lt;br /&gt;
=====gems table=====&lt;br /&gt;
'List' of available gems&lt;br /&gt;
=====awarded_gems table=====&lt;br /&gt;
Data on which user got which gem awarded&lt;br /&gt;
=====language_map table=====&lt;br /&gt;
Saves data on which phrases are used on which page and which page is included on it&lt;br /&gt;
=====blocked_users table=====&lt;br /&gt;
A list of users blocked from submitting&lt;br /&gt;
=====remote_credentials table=====&lt;br /&gt;
List of sites allowed to submit translations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====custom_string_replace.php====&lt;br /&gt;
Code is taken from stackoverflow, provided by user [http://stackoverflow.com/users/526741/bfrohs, bfrohs]&lt;br /&gt;
=====Function str_lreplace=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|-&lt;br /&gt;
| mixed || $search || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function str_replace_limit=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$search||	 The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$replace||	 The replacement value that replaces found search values. An array may be used to designate multiple replacements.&lt;br /&gt;
|-&lt;br /&gt;
||mixed ||	$subject||	 The string or array being searched and replaced on, otherwise known as the haystack. If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well.&lt;br /&gt;
|-&lt;br /&gt;
||string||	&amp;amp; $count||	 If passed, this will be set to the number of replacements performed.&lt;br /&gt;
|-&lt;br /&gt;
||integer||	$limit = -1||	 The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||string||	 This function returns a string with the replaced values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Function valid_integer=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
| mixed || $string || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value summary&lt;br /&gt;
|-&lt;br /&gt;
||boolean||	 Returns boolean TRUE if string is a valid integer, or FALSE if it is not&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====functions.inc====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====install_defaults.php====&lt;br /&gt;
Take a look at [http://wiki.geeklog.net/index.php/Plugin_Development, Geeklog plugin developer Guide]&lt;br /&gt;
====language_maper.php====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
====language_markup.php====&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| array || $matches || matches matches found using the regex, for includes and LANG's&lt;br /&gt;
|| array || &amp;amp; $push_array || the array holding all found matches without duplicates&lt;br /&gt;
|}&lt;br /&gt;
=====Function extract_from_matches=====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameters summary&lt;br /&gt;
|-&lt;br /&gt;
|| string || $path || path of the current folder&lt;br /&gt;
|}&lt;br /&gt;
=====Function language_maper=====&lt;br /&gt;
Will do the LANG array mapping&lt;br /&gt;
&lt;br /&gt;
==JavaScript Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
* Ideally, translators should be able to see the text strings in context to help with the translation. - implemented&lt;br /&gt;
** If that turns out not to be possible, we'll show them without context.&lt;br /&gt;
* It's acceptable if the translation option slows things down. If it slows down things noticably, add a &amp;quot;translation mode&amp;quot;, so users can decide between using the site normally or helping with the translation. - not necessary&lt;br /&gt;
&lt;br /&gt;
==More Resources==&lt;br /&gt;
Read more about this:&lt;br /&gt;
* [http://summergeeek.blogspot.com/2013/06/big-decisions.html, Blog]&lt;br /&gt;
* [http://project.geeklog.net/cgi-bin/hgwebdir.cgi/gsoc-2013-btalic/summary, Repository]&lt;br /&gt;
* [http://wiki.geeklog.net/index.php?title=Crowdsourcing_Translations, User documentation]&lt;/div&gt;</summary>
		<author><name>Bttalic</name></author>	</entry>

	</feed>