MrCreatoR Posted April 12, 2012 Share Posted April 12, 2012 (edited) Au3Localizer v1.0 Au3Localizer_1.0.zip Old versions Spoiler v0.1 - ATT.zip v0.2 - ATT.zip Introduction The idea started from my attempt to translate Control Viewer. I have started to translate this program manually using AppTranslation Module that i wrote some time ago. But while translating i was wondering, what if i could automate this process? Of course i understood that i can not automate this process completely, because it's not an easy task (programmatically) to distinguish between text lines that should be translated, from other lines that used by different functions/expressions (structures, strings parameters, etc.). At the beginning i was very skeptic about this issue and thought that it's way over my head, but eventually i decided to sit down and write this tool. Concept: Spoiler When Au3Localizer receives file path, it will split the file to separate lines. Then it gets from each line strings between single and double quotes (thank to asdf8). For these strings generated list element (ListViewItem) with certain excludes (see bellow). Using predefined pattern (Ignore Lines Patterns), Au3Localizer defines which lines it will put to the list. Some lines, also using other predefined pattern (Marked Lines Patterns), are highlighted with special marker (green arrow on the left of the ListView Item), these lines have high localization priority, it means that probably these lines should be localized. Upon completion of processing with selected settings, following files are added to the folder of selected script: Includes\Localize.au3 - Localizer module. Locales\English.lng, Russian.lng - Locale files. For convenient switching between locales, you can add to your script _Localize_SwitchLocaleGUI function call, together with _Localize_Register, that are defined in Localize.au3: $sDefLng = _Localize_SwitchLocaleGUI('My App', $hGUI, $sDefLng) _Localize_Register($LOCALES_DIR & '\' & $sDefLng & '.lng') After the script is localized, it can be executed with command line: /GenerateLocaleFile[="FileName"] If FileName set and exists, generates missing strings for this locale file If FileName set and NOT exists, creates this file in Locales Dir with all the localized strings If FileName NOT set, generates missing strings for all locale files in Locales Dir Usage: Spoiler At the firs step (when launching Au3Localizer) you can set localizer module settings... Au3 Script: Input script file path (the script to add the Localizer module) Localize Object Name: Object name of the localized strings (used as $oLocalize.%s) Module File Path Format: Localizer module file path format (%s\Includes\Localize.au3, %s replaced with full path to the root folder of the selected script (Au3 Script:) Locale File Path Format: Locale file path format that used by the module (%s\Locales\%d.lng, %s replaced with full path to selected script (Au3 Script:), %d replaced with locale name from the locales list (Locales:)) Locales: Locales list that your script will support Default Locale: Default locale that your script will use Marked Lines Patterns: RegExp pattern to highlight lines with special marker Ignore Lines Patterns: RegExp patterns that defines which lines to put to the list Next you select strings that should be used for localization process Double click on the item will open a window that displays a full line with the found string Then you click Localize and wait for Au3Localizer to complete that localization Now all you need to do is actually translate the generated strings in locale file(s) (Locales\English.lng) Any suggestions, or your own strings patterns that you discovered while using this tool are very welcome. The archive includes also separate UDF version to use manually (usage Example also provided), without Au3Localizer. P.S and Credits Spoiler AutoItObject_Internal by genius257 is used by Au3Localizer. First working result of this tool. Edited March 25, 2021 by MrCreatoR Update JScript 1 Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
FireFox Posted April 12, 2012 Share Posted April 12, 2012 (edited) This could be useful, thanks for sharing ! Edit : I'm available to translate anything into French. Br, FireFox. Edited April 12, 2012 by FireFox Link to comment Share on other sites More sharing options...
storme Posted April 15, 2012 Share Posted April 15, 2012 I think you have a great idea here! I havn't used it yet but it would have been invaluable in the past when I was trying to understand scripts I'd downlaoded from the French forum. A BIG thank you! John Morrison Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
ricky Posted April 16, 2012 Share Posted April 16, 2012 Hello, thanks for your very useful software... Why you didn't translate it? If you want I see a very good software made by MrCreatoR in the forum ... Ok, it's a french joke... For the future, why don't have a possibility to add new tranlation words in a script already translated? Link to comment Share on other sites More sharing options...
stormbreaker Posted April 16, 2012 Share Posted April 16, 2012 Thank you very much. You saved me loads of trouble. I can expect to finish my multi-lingual script sooner. Regards. ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
ldub Posted April 16, 2012 Share Posted April 16, 2012 Thank's a lot, I like it. With an online translator for the .lng files, it would be great : It would not be perfect, of course, but it would accelerate the tedious job. Regards Link to comment Share on other sites More sharing options...
MrCreatoR Posted June 13, 2012 Author Share Posted June 13, 2012 Thanks to all for the feedbacks!I'm available to translate anything into French.You can translate (download translated version here). Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
MrCreatoR Posted June 13, 2012 Author Share Posted June 13, 2012 For the future, why don't have a possibility to add new tranlation words in a script already translated?Good idea, but it will be complicated i think, i will try to add this feature. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Reaper HGN Posted June 15, 2012 Share Posted June 15, 2012 Very cool idea. I don't have a use at the moment, but I have done this in the past and think something that flags the possible lines like this does would have been very helpful. Link to comment Share on other sites More sharing options...
MrCreatoR Posted August 8, 2012 Author Share Posted August 8, 2012 (edited) Update!v0.2+ Added retranslate support. Allows to translate new added strings in the main script.+ Added command line parameter to ATT Module template to support language generation. If the program executed with "/GenerateLangFile:LangName" parameter, then language file is generated as LangName.lng (in defined languages dir). Useful if the user wants to make a new translation, and also when user wants to update the program but keep the custom translated strings (only new strings will be added to the specified language file).+ Now the function/variable name where the string is found, added as a prefix for variable names.* Small changes in the templates.* Fixed issue with wrong line number detection. Edited August 8, 2012 by MrCreatoR Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
JScript Posted September 10, 2012 Share Posted September 10, 2012 Excellent, I confess: I had not seen this topic! Thank you for sharing. Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
MrCreatoR Posted March 25, 2021 Author Share Posted March 25, 2021 (edited) Major Update! Quote v1.0 Project renamed to Au3Localizer. Rewrited almost completely. Now as main string representation used object instead of array. Updated patterns. Edited March 25, 2021 by MrCreatoR mLipok 1 Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
bovirus Posted April 6, 2022 Share Posted April 6, 2022 @MrCreatoR Could you pelase enable multilanguage for your Au3Localizer? Pelase Add English+Italian language string files. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now