[feature-request] Translate ComboBox.Items content with LCLTranslator
Original Reporter info from Mantis: cpicanco
-
Reporter name: Rafael Picanco
Original Reporter info from Mantis: cpicanco
- Reporter name: Rafael Picanco
Description:
I would like to use LCLTranslator to change the default languange at runtime, without reopening the application. Right now I am filling TString Items with normal resourcestrings and using the XMLPropstorage to load them back like this:
procedure TFormUserConfig.XMLPropStorage1RestoreProperties(Sender: TObject);
var
Texts : array [0..4] of string;
ItemIndexes : array [0..4] of integer;
ComboBoxes : array [0..4] of TComboBox;
i: Integer;
begin
ComboBoxes[0] := ComboBoxLanguage;
ComboBoxes[1] := ComboBoxGridType;
ComboBoxes[2] := ComboBoxRandomize;
ComboBoxes[3] := ComboBoxFillTargetColumn;
ComboBoxes[4] := ComboBoxBlocCounter;
for i := Low(ComboBoxes) to High(ComboBoxes) do
begin
ItemIndexes[i] := ComboBoxes[i].ItemIndex;
Texts[i] := ComboBoxes[i].Text;
end;
SetDefaultLang(XMLPropStorage1.StoredValue['language']);
for i := Low(ComboBoxes) to High(ComboBoxes) do
begin
ComboBoxes[i].ItemIndex := ItemIndexes[i];
ComboBoxes[i].Text := Texts[i];
end;
It is ugly and it means a lot of work in the long run. That why a direct translation would be great.
Mantis conversion info:
- Mantis ID: 32411
- OS: Bunsen Labs
- OS Build: Hydrogen
- Platform: Linux
- Version: 1.8RC4