From: Matthieu H. <mat...@ha...> - 2014-10-17 12:27:19
|
Hi team, I now have a debut of script core for locale file generation from source code. I now have the following perl command (tested in MinGW shipped with Git under Windows): user@xxxx /C/share/Mail2Voice/gui/panels $ perl -ne '/([a-zA-Z0-9]*).Text *= *"(.*)"/ && print " <setting name=\"$1\" value=\"$2\" />\n"' configurationControl.Designer.cs This command outputs: <setting name="appLangLabel" value="Lang:" /> <setting name="appVoiceLabel" value="Voice:" /> <setting name="mainButtonSpeechPreviewCheckBox" value="Speech announcement for menus on mouse hover" /> <setting name="inServerParamsGroupBox" value="Incoming server" /> <setting name="testImapButton" value="Test" /> <setting name="imapSSLCheckbox" value="Secured" /> <setting name="inServerPortLabel" value="Port:" /> <setting name="inServerAddressLabel" value="IMAP server address:" /> <setting name="outServerParamsGroupBox" value="Outgoing server" /> <setting name="smtpSSLCheckbox" value="Secured" /> <setting name="testSmtpButton" value="Test" /> <setting name="outServerPortLabel" value="Port :" /> <setting name="outServerAddressLabel" value="SMTP server address:" /> <setting name="accountNameLabel" value="Name:" /> <setting name="loginParamsGroupBox" value="Login infos" /> <setting name="accountPasswordLabel" value="Password:" /> <setting name="accountAddressLabel" value="Email address:" /> <setting name="accountParamsGroupBox" value="Account settings" /> <setting name="defaultMsgParamsGroupBox" value="Default message" /> <setting name="defaultMsgContentLabel" value="Message:" /> <setting name="defaultMsgObjectLabel" value="Object:" /> <setting name="globalParamsGroupBox" value="Global settings" /> <setting name="activateLogsCheckBox" value="Enable logs" /> <setting name="activateTrashCheckBox" value="Enable trash" /> <setting name="advancedParamsGroupBox" value="Advanced settings" /> <setting name="activateUpdateCheckCheckBox" value="Check for updates" /> <setting name="activateDetailedLogsCheckBox" value="Enable detailed logs" /> <setting name="addressBookParamsGroupBox" value="Addressbook" /> <setting name="importAddressBookButton" value="Import addressbook\r\n(.csv file)\r\n" /> <setting name="cancelButton" value="Cancel" /> <setting name="saveButton" value="Save" /> So this is a viable solution although there can be other prettier alternatives (but I'm not an expert). For the moment I will go with this and complete the script to process every .Designer.cs file and concatenate results in the targeted XML file. Cheers, Matthieu Hazon |