-
Notifications
You must be signed in to change notification settings - Fork 47
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
Little concern about language translation #1274
Comments
You are right that translation hasn't been well supported in the past. I consider those listbox problems as bugs in the code generation templates. Those should be easy to fix. For version 4, translation is going to be handled in a separate repo - the i18n repo. It has mechanisms so that every repo can translate itself. |
Please test to see if this fixes the problems you described. |
I did a test. It's good at the beginning, the list shows translations well, but in the edit mode the ListBox does not show translations :(. I also looked at UnitTest. I do not know if they are interrelated. Anyway, I'll put error messages here:
@spekary, how are we going? |
As far as I think, $NameArray is the place where the translation function would be needed here: /**
* Create item list for use by lstProjectStatusType
*/
public function lstProjectStatusType_GetItems() {
return ProjectStatusType::$NameArray;
} |
Here I found that the translation function has been redrawn multiple times, which is not needed: /**
* Create and setup QListBox lstProjectStatusType
* @param string $strControlId optional ControlId to use
* @return QListBox
*/
public function lstProjectStatusType_Create($strControlId = null) {
$this->lstProjectStatusType = new QListBox($this->objParentObject, $strControlId);
$this->lstProjectStatusType->Name = QApplication::Translate('Project Status Type');
$this->lstProjectStatusType->Required = true;
$this->lstProjectStatusType->PreferredRenderMethod = 'RenderWithName';
$this->lstProjectStatusType->LinkedNode = QQN::Project()->ProjectStatusTypeId;
if (!$this->strProjectStatusTypeNullLabel) {
if (!$this->lstProjectStatusType->Required) {
$this->strProjectStatusTypeNullLabel = QApplication::Translate('- None -');
}
elseif (!$this->blnEditMode) {
$this->strProjectStatusTypeNullLabel = QApplication::Translate('- Select One -');
}
}
$this->lstProjectStatusType->AddItem(QApplication::Translate($this->strProjectStatusTypeNullLabel), null);
$this->lstProjectStatusType->AddItems($this->lstProjectStatusType_GetItems());
$this->lstProjectStatusType->SelectedValue = $this->objProject->ProjectStatusTypeId;
return $this->lstProjectStatusType;
} |
Now my topic can be closed. Reference: #1277 |
Previously, there was a bad situation where the translation code was not supported.
We was to do a lot of crafts.
There is a much better situation right now. It's very easy to add if needed, for example, one example:
to
Or in other places that were easy to add. At the _type table, I had difficulty translating. I went on a mild resistance path, I wrote directly into my mother tongue. But this is not the right solution, because multi-lingual support is needed.
I found one solution for the list only:
to
But the translation works only in the list. The form listbox does not show translation support, more precisely at code level:
I've been looking for a solution for a long time, but I have not found a better deal. Do you have better thoughts or solutions? Or, the _type table translation option is excluded?
I put one screenshot here:
Thanks in advance!
The text was updated successfully, but these errors were encountered: