From: <rc...@us...> - 2015-01-24 17:32:04
|
Revision: 7097 http://sourceforge.net/p/web-erp/reponame/7097 Author: rchacon Date: 2015-01-24 17:32:11 +0000 (Sat, 24 Jan 2015) Log Message: ----------- Add info to Manual about Indian Numbering System. Add comments to code. Improvements to Cascading Style Sheet (CSS) for Manual. Modified Paths: -------------- trunk/doc/Change.log trunk/doc/Manual/ManualMultilanguage.html trunk/doc/Manual/ManualNewScripts.html trunk/doc/Manual/style/manual.css trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php trunk/includes/MiscFunctions.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-01-24 03:08:00 UTC (rev 7096) +++ trunk/doc/Change.log 2015-01-24 17:32:11 UTC (rev 7097) @@ -1,7 +1,7 @@ webERP Change Log +24/01/15 RChacon: Add info to Manual about Indian Numbering System. Add comments to code. Improvements to Cascading Style Sheet (CSS) for Manual. 23/01/15 RChacon: Generalise indian number format for country=India (languages: English, Hindi, Marathi, etc.). -Add translation for transaction type, script ID, manual references, class="number" to columns. 20/01/15 RChacon: Add translation for transaction type, script ID, manual references, class="number" to columns. 20/1/15 Exson: Remove die() function from Suppliers.php which will make adding or updating suppliers' data failed when google map is activated. Reported by Terry. 17/01/15 RChacon: Fix Czech language code, add info for Croatian language, add the script name and revision number and sort by language code. Modified: trunk/doc/Manual/ManualMultilanguage.html =================================================================== --- trunk/doc/Manual/ManualMultilanguage.html 2015-01-24 03:08:00 UTC (rev 7096) +++ trunk/doc/Manual/ManualMultilanguage.html 2015-01-24 17:32:11 UTC (rev 7097) @@ -8,8 +8,7 @@ <li><a href="http://lists.sourceforge.net/lists/listinfo/web-erp-translation">Join the mailing list here</a><br> Let the list know you're wanting to help with a translation - someone may already be working on it.</li> - <li>Obtain the latest messages.po file and enter the translations using your favourite editor (or poedit). The latest messages.po file is included with the latest archive:<br> - www_root/webERP/locale/en_GB/LC_MESSAGES/message.po< br /> Edit the file provided entering the translations for the strings labelled msgid in the string labelled msgstr. Watch for html strings embedded inside the strings the html will also be required in the translated string. Also be sure to ensure that each translated string is enclosed in speech marks ("). Please also complete the translation file header information - with your details so that you are accorded proper recognition for your contribution.</li> + <li>Obtain the latest messages.po file and enter the translations using your favourite editor (or poedit). The latest messages.po file is included with the latest archive:<br />www_root/webERP/locale/en_GB/LC_MESSAGES/message.po<br />Edit the file provided entering the translations for the strings labelled msgid in the string labelled msgstr. Watch for html strings embedded inside the strings the html will also be required in the translated string. Also be sure to ensure that each translated string is enclosed in speech marks ("). Please also complete the translation file header information - with your details so that you are accorded proper recognition for your contribution.</li> </ol> <p>It is especially important to ensure that the string "ISO-8859-1" (at the time of writing around line 19400 in the messages.po file) is translated to be the character set that you wish your translation to use. webERP uses the translated string here to send appropriate html headers so your browser knows how to interpret the characters sent.</p> @@ -24,6 +23,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> +<!-- Help BEGIN: TechnicalOverview --> <h2>Technical Overview</h2> <h3>How is it Done</h3> @@ -34,29 +34,24 @@ <p>New directories will need to be made up if a translator wishes to have a local version for their language. Under the locale directory the five character locale abbreviation code directory there is a further sub-directory called LC_MESSAGES - this is where the translation files exist. There are two files in each of these directories:</p> -<p></p> - <ol> - <li>messages.po this file contains all the strings to be translated. This is the only file of concern for translators</li> - - <li>messages.mo this is a binary machine searchable translation file used by gettext. The .mo file is automatically produced by a gettext utility (msgfmt.exe or msgfmt in *nix) using the messages.po file (the syntax from a command window is msgfmt.exe messages.po). The main effort is required to get the .po file translated - the .mo file is easily and happily created by the webERP project admin if required.</li> + <li><b>messages.po</b>. This file contains all the strings to be translated. This is the only file of concern for translators</li> + <li><b>messages.mo</b>. This is a binary machine searchable translation file used by gettext. The .mo file is automatically produced by a gettext utility (msgfmt.exe or msgfmt in *nix) using the messages.po file (the syntax from a command window is msgfmt.exe messages.po). The main effort is required to get the .po file translated - the .mo file is easily and happily created by the webERP project admin if required.</li> </ol> -<p>Any text editor can be used to edit the .po file (GNU Emacs contains specific functionality for editing .po files there is a special PO-Mode) - there is also a utility called poedit which is often recommended by translators.</p> +<p>Any text editor can be used to edit the .po file (GNU Emacs contains specific functionality for editing .po files there is a special PO-Mode) - there is also a utility called <a href="http://poedit.net/" target="_blank">Poedit - Gettext Translations Editor</a> which is often recommended by translators.</p> -<p></p> - <h3>Understanding the messages.po File</h3> -<p>The translation is performed by tranlating the strings in the messages.po file into the other language. It is important to work on the most recent messages.po file from the locale/en_GB/LC_MESSAGES/ deirectory in the CVS. This can be downloaded from http://web-erp.cvs.sourceforge.net/viewvc/*checkout*/web-erp/webERP/locale/en_GB/LC_MESSAGES/messages.po</p> +<p>The translation is performed by translating the strings in the messages.po file into the other language. It is important to work on the most recent messages.po file from the locale/en_GB/LC_MESSAGES/ directory in the CVS. This can be downloaded from http://web-erp.cvs.sourceforge.net/viewvc/*checkout*/web-erp/webERP/locale/en_GB/LC_MESSAGES/messages.po</p> <p>The messages.po is made up of sections</p> -<p>eg. for a French translation file</p> +<p>E.g. for a French translation file</p> <p>#: AccountGroups.php:8 index.php:890<br> msgid "An example string in English that needs to be translated"<br> -msgstr="Une corde d'exemple dans le ce anglais doit être traduite "</p> +msgstr="Une chaîne d'exemple en anglais qui doit être traduite"</p> <p>the line #: AccountGroups.php:8 index.php:890<br> means that the string following is used in the AccountGroups.php script on line 8 and the index.php script on line 890. It could be useful to understand the context of where the script is used. Strings that are used several times throughout the application only need to be translated once. In some cases the #: line showing where the string is used can be quite an extensive list of scripts.<br></p> @@ -66,13 +61,26 @@ <p>The effort of the translation is to edit the messages.po file and enter the language translation within the inverted commas of the msgstr.</p> +<h3><a id="IndianNumberingSystem">Indian Numbering System</a></h3> + +<p>Many people in India speak English but want to see numbers formatted in Indian Numbering System. The Indian Numbering System uses separators differently from the Arabic Numbering System; besides the three least significant digits of the integer part, a comma divides every two rather than every three digits, thus:</p> + +<ul> + <li>Arabic Numbering System: 1,234,567,890</li> + <li>Indian Numbering System: 1,23,45,67,890</li> +</ul> + +<p>Having a record in the LanguagesArray.php and an empty folder under ~/locale/en_IN.utf8 allows us to have English (British) language --no strings translated as there is no matching strings in a messages.mo-- but the number format in Indian Numbering System. See <a href="ManualContents.php?ViewTopic=NewScripts#MiscFunctions">MiscFunctions.php</a> in Manual, New Scripts, Directory Structure.</p> + <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> +<!-- Help END: TechnicalOverview --> + <h2>The .po File Header</h2> -<h4>The .po file starts with some initial comments which should also be completed</h4> +<p>The .po file starts with some initial comments which should also be completed</p> <p>"SOME DESCRIPTIVE TITLE", - should be replaced with <b><i>webERP - LANGUAGE Translation File</i></b> - where LANGUAGE is the language being translated into<br> # FIRST AUTHOR , YEAR. - should be your name and email address - with the year of the work being done</p> @@ -104,7 +112,7 @@ <li>ISO-8859-5 for Macedonian, Serbian,</li> - <li>ISO-8859-6 for Arabic,<</li></li> + <li>ISO-8859-6 for Arabic,</li> <li>ISO-8859-7 for Greek,</li> Modified: trunk/doc/Manual/ManualNewScripts.html =================================================================== --- trunk/doc/Manual/ManualNewScripts.html 2015-01-24 03:08:00 UTC (rev 7096) +++ trunk/doc/Manual/ManualNewScripts.html 2015-01-24 17:32:11 UTC (rev 7097) @@ -156,17 +156,13 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>MiscFunctions.php</h3> +<h3><a id="MiscFunctions">MiscFunctions.php</a></h3> <p>This script holds miscellaneous functions:</p> -<ul> - <li><i>TableRows</i> - Outputs the table row html tag ("<i><tr></i>") with the class to format the table row ("<i>OddTableRows</i>" or "<i>EvenTableRows</i>") and returns the row counter to determine background colour updated. It requires that the Row counter to determine background colour is initialised before using this function.<br /> - Example:<br /> - <code> - $k = False;// Row counter to determine background colour.<br /> - ...<br /> - $k = TableRows($k);// Outputs html table row with class (Odd|Even). - </code> - </li> -</ul> +<dl> + + <dt>locale_number_format($Number, $DecimalPlaces=0)</dt> + <dd>Displays numbers in locale of the user. See <a href="ManualContents.php?ViewTopic=Multilanguage#IndianNumberingSystem">Indian Numbering System</a> in Manual, Multilanguage, Technical Overview.</dd> + +</dl> \ No newline at end of file Modified: trunk/doc/Manual/style/manual.css =================================================================== --- trunk/doc/Manual/style/manual.css 2015-01-24 03:08:00 UTC (rev 7096) +++ trunk/doc/Manual/style/manual.css 2015-01-24 17:32:11 UTC (rev 7097) @@ -4,89 +4,115 @@ * */ body { -font-family:"Ubuntu", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; -font-size:.85em; -color:#0000; -font-weight:lighter; + color:#000; + font-family:"Ubuntu", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; + font-size:.85em; + font-weight:lighter; } img { -border:none; -width:50%; + border:none; + width:50%; } #pagetitle { -font-weight:400; -font-size:330%; -text-align:center; -color:#066307; -background:#6BA81E; -text-shadow:1px 1px #A9BD55; -border-radius: 5px; + background:#6BA81E; + border-radius:5px; + color:#066307; + font-size:330%; + font-weight:400; + text-align:center; + text-shadow:1px 1px #A9BD55; } h1,h2,h3,h4,h1 a,h2 a,h3 a,h4 a { -font-weight:400; + font-weight:400; } h1 { -color:#0D1F54; -background:#BED4EB; -text-shadow:1px 1px #293EF5; -padding:10px; -margin:1%; -border-radius: 5px; + background:#BED4EB; + border-radius:5px; + color:#0D1F54; + margin:1%; + padding:10px; + text-shadow:1px 1px #293EF5; } h2 { -color:#0D1F54; -background:#C8D5E3; -padding:8px 8px 8px 20px; -margin-left:1%; -margin-right:1%; -border-radius: 5px; + background:#C8D5E3; + border-radius:5px; + color:#0D1F54; + margin-left:1%; + margin-right:1%; + padding:8px 8px 8px 20px; } h3 { -color:#0D1F54; -background:#E1E6EC; -padding:8px 8px 8px 30px; -margin-left:1%; -margin-right:1%; -border-radius: 5px; + background:#E1E6EC; + border-radius:5px; + color:#0D1F54; + margin-left:1%; + margin-right:1%; + padding:6px 6px 6px 30px; } +h4 { + background:#F2EFEC; + border-radius:5px; + color:#0D1F54; + margin-left:1%; + margin-right:1%; + padding:4px 4px 4px 40px; + /* Heading level 4 format. */ +} + a { -text-decoration:none; + text-decoration:none; } a:hover { -color:#03c; + color:#03c; } -.right { -text-align:right; -} - .floatright { -float:right; + float:right; } .left { -text-align:left; + text-align:left; } .minitext { -margin-right:1%; -font-size:80%; + margin-right:1%; + font-size:80%; } +.right { + text-align:right; +} + +dl { + margin-left:2%; + /* Description list format. */ +} + +dt { + font-weight:bold; + /* Description list terms format. */ +} + +dd { + /* Description list descriptions format. */ +} + li.toc { -color:#03c; + color:#03c; } + input[type=checkbox] { - visibility: hidden; + visibility:hidden; } + p { -margin-left: 2%; + margin-left:2%; } Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2015-01-24 03:08:00 UTC (rev 7096) +++ trunk/includes/LanguageSetup.php 2015-01-24 17:32:11 UTC (rev 7097) @@ -1,16 +1,15 @@ <?php - /* $Id$ */ /* Set internal character encoding to UTF-8 */ mb_internal_encoding('UTF-8'); /* This file is included in session.inc or PDFStarter.php or a report script that does not use PDFStarter.php -to check for the existance of gettext function and setup the necessary enviroment to allow for automatic translation +to check for the existence of gettext function and setup the necessary environment to allow for automatic translation Set language - defined in config.php or user variable when logging in (session.inc) NB this language must also exist in the locale on the web-server -normally the lower case two character country code underscore uppercase +normally the lower case two character language code underscore uppercase 2 character country code does the trick except for en !!*/ @@ -26,18 +25,18 @@ //Check users' locale format via their language //Then pass this information to the js for number validation purpose -$Collect = array('US'=> array('en_US.utf8','en_GB.utf8','ja_JP.utf8','hi_IN.utf8','mr_IN.utf8','sw_KE.utf8','tr_TR.utf8','vi_VN.utf8','zh_CN.utf8','zh_HK.utf8','zh_TW.utf8'), - 'IN'=>array('en_IN.utf8'), +$Collect = array( + 'US'=>array('en_US.utf8','en_GB.utf8','ja_JP.utf8','hi_IN.utf8','mr_IN.utf8','sw_KE.utf8','tr_TR.utf8','vi_VN.utf8','zh_CN.utf8','zh_HK.utf8','zh_TW.utf8'), + 'IN'=>array('en_IN.utf8','hi_IN.utf8','mr_IN.utf8'), 'EE'=>array('ar_EG.utf8','cz_CZ.utf8','fr_CA.utf8','fr_FR.utf8','hr_HR.utf8','pl_PL.utf8','ru_RU.utf8','sq_AL.utf8','sv_SE.utf8'), 'FR'=>array('ar_EG.utf8','cz_CZ.utf8','fr_CA.utf8','fr_FR.utf8','hr_HR.utf8','pl_PL.utf8','ru_RU.utf8','sq_AL.utf8','sv_SE.utf8'), 'GM'=>array('de_DE.utf8','el_GR.utf8','es_ES.utf8','fa_IR.utf8','id_ID.utf8','it_IT.utf8','ro_RO.utf8','lv_LV.utf8','nl_NL.utf8','pt_BR.utf8','pt_PT.utf8')); -foreach ($Collect as $Key=>$Value){ - if (in_array($Language,$Value)){ +foreach($Collect as $Key=>$Value) { + if(in_array($Language,$Value)) { $Lang = $Key; $_SESSION['Lang'] = $Lang; } - } /*Since LanguagesArray requires the function _() to translate the language names - we must provide a substitute if it doesn't exist aready before we include includes/LanguagesArray.php Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2015-01-24 03:08:00 UTC (rev 7096) +++ trunk/includes/LanguagesArray.php 2015-01-24 17:32:11 UTC (rev 7097) @@ -29,7 +29,7 @@ $LanguagesArray['en_GB.utf8']['DecimalPoint'] = '.'; $LanguagesArray['en_GB.utf8']['ThousandsSeparator'] = ','; -$LanguagesArray['en_IN.utf8']['LanguageName'] = 'English India'; +$LanguagesArray['en_IN.utf8']['LanguageName'] = 'English India';// See Indian Numbering System in Manual, Multilanguage, Technical Overview. $LanguagesArray['en_IN.utf8']['WindowsLocale'] = 'english-in'; $LanguagesArray['en_IN.utf8']['DecimalPoint'] = '.'; $LanguagesArray['en_IN.utf8']['ThousandsSeparator'] = ','; @@ -175,4 +175,4 @@ $LanguagesArray['zh_TW.utf8']['ThousandsSeparator'] = ','; asort($LanguagesArray); -?> +?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2015-01-24 03:08:00 UTC (rev 7096) +++ trunk/includes/MiscFunctions.php 2015-01-24 17:32:11 UTC (rev 7097) @@ -333,8 +333,7 @@ function locale_number_format($Number, $DecimalPlaces=0) { global $DecimalPoint; global $ThousandsSeparator; -/* if ($_SESSION['Language']=='hi_IN.utf8' OR $_SESSION['Language']=='en_IN.utf8'){*/ - if(substr($_SESSION['Language'], 3, 2)=='IN') {// If country is India (??_IN.utf8). + if(substr($_SESSION['Language'], 3, 2)=='IN') {// If country is India (??_IN.utf8). See Indian Numbering System in Manual, Multilanguage, Technical Overview. return indian_number_format(floatval($Number),$DecimalPlaces); } else { if (!is_numeric($DecimalPlaces) AND $DecimalPlaces == 'Variable'){ @@ -452,4 +451,4 @@ echo ' ... ' . _('completed'); } -?> +?> \ No newline at end of file |