-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impact of switching from lowercase to uppercase first character #50
base: master
Are you sure you want to change the base?
Conversation
This is what needs to be changed when switching from e.g. "add new line" to "Add New Line", plus other minor fixes. The gettext translation terms must match case and spacing.
- Added trim to gettext in the class' staticVar_init() functions to remove leading/trailing spaces before translating. - Translated certain terms found in the search class. - Added sorting capability to array of classes (function l_select_field_from_object) using usort. - The program name can be read from a public or public static class property. - A few more translations, as required by the Purchasing Module's Requisition.
The "Added sorting capability to array of classes" commit, refers to sorting lists, like the currency one and maybe others which are long and may require some effort in order to locate a specific value within them. |
Appreciate your effort but don't think we need to have the sorting parameter in select_field as that's already taken care of by the object itself (the object used in the function). |
Sorting can be done using the existing second parameter. So, no need to add a new one |
Hi @inoerp. These are the two class_inofrm.inc functions used to process the currency classes' currency code into an html select list:
Which then calls: `public function select_field_from_object($name, $object, $objectValueKey, $objectDescriptionKey, $value = "", $id = "", $divClass = "", $required = "", $readonly = "", $convertToText = "", $nonArrayName = "", $disabled = "", $dataname = '') { if ($required == 1) { if ($disabled == 1) {
} if ($convertToText == 1) { return $element_select_field; The second parameter of this function is $object, which is the array of currency classes that contain the currency code in need of sorting, and we're talking about sorting this array of classes using one of their class properties (the currency code) as the criteria, which is covered by the usort added to this function. Can you please help me point out which parameter is the one that sorts the array of objects using a class property as the criteria? Regards! |
- Translation paths' titles will now be hinted translated. - Class inv_serial_number is translated too. - Added more terms to the translation domain files.
can't we pass the parameter $object after sorting ? Below is the code for currency Below is the code for findBy_parentId $stmt = $dbc->connection->prepare(" $sql "); |
The function will need to be hardcoded like this:
This will only work with currencies, but I can do the same thing if I find another array of classes that requires sorting. I already tested it and it works as expected. I'm going to provide a commit that will remove my previous attempt and will provide this modification. Regards |
- Usort was placed inside the currencies() function.
You don't need that either as sorting is done findBy_parentId Just need to modify the parameter to option_line_code from option_line_value |
- I didn't check the findBy_parentId method, so I didn't know it could sort.
…ntity I'm saying capabilities because there are too many pages and I can't add all the translation terms to the domain files at this moment. Some are going to be picked up because they already exist in the domain files, though. I had to enter the ampersand html entity name in order for it to be displayed correctly. It's taking into consideration the space before and after that I found in almost all of the page titles class properties.
For the two latest commits, I'm going to apply the htmlentities() function so that we don't need to write the page title strings as html entities. I'll provide later a commit applying this modification. |
…ted to text I checked again, and the ampersand now shows as expected, so the ampersand html entity code was replaced by the ampersand text, as it was before.
This is what needs to be changed when switching from e.g. "add new line"
to "Add New Line", plus other minor fixes. The gettext translation terms
must match case and spacing.