Recently Browsing 0 members
No registered users viewing this page.
I am trying to get the Text of given item in controllistview object (SysListView32).
ControlListView("Select", "", "[CLASS:SysListView32; INSTANCE:1]", "Select",0,0)
This statement is selecting the item but below statement is not getting the text of the item. It is returning item no not text.
$txtItem = ControlListView("Select", "", "[CLASS:SysListView32; INSTANCE:1]", "GetText",0)
Let me know if I am missing anything here.
I needed to create a simple i18n library for an open-source project I've worked on last week.
So I made this simple and easy to use.
When translating, you have two options: the first one is to use a global file on the following format:
[language_code] text_id=Translation text_with_format=Number: %.2f text_with_parameter=Hi %s [another_language_code] text_id=Tradução ... The second option is to separate every translation into files named language_code.lng in a folder of your choice. Note that every file on this folder will have the following format:
[language_code] text_id=Translation text_with_format=Number: %.2f text_with_parameter=Hi %s The language code can be ISO 639-1 (2 chars, like "en", "pt", "es") or culture code (including the country, like "en-US", "pt-BR", "es-ES"). You can use both these formats on the same file/project without any problem.
Finally, use the _() function to get your translation text. It accepts the following syntax:
_($sText_id [, $sPar1 [, $sParn ] ] ) The parameters are optional, but the maximum number of parameters is 32. If you need more than 32 parameters (sure?), please consider splitting your string into multiple ones.
Note that everything is explained on the Example.au3 (see online) and Example.lng (see online) file.
Interesting note (source):
Download: AutoIt Files
Fork me on Github
An extensive UDF to ease the internationalization of AutoIt scripts and programs. Add multi-lingual support to your scripts and programs in a consistent and portable manner.
Store messages in a human-readable INI format. Organize messages in different categories. Handle singular and plural string variants at run time. Expands meta-characters and all AutoIt macro's. Supports UTF-16 Little-Endian encoding. GUI Menu and Combo Create/Read helper functions. Command line utility to extract messages from AutoIt scripts. Fully portable! The download contains the following files:ReadMe.txt Instructions and information on the UDF. AU3Text-HowTo.txt Step by step instructions to convert programs for internationalization with AutoIt. AU3Text-Demo.au3 AU3Text demo. AU3Text-Extractor.au3 Source file for command line utility to extract AU3Text messages from scripts. You'll need to compile this script before you can use it. This is BETA software! LibAU3Text.au3 Main AU3Text library. LibAU3TextGUI.au3 AU3Text GUI helpers. LibAU3TextDev.au3 Additional developer functions. LibLocale.au3 Locale functions. Originally based on guinness' excellent _GetOSLanguage function, but has grown into a full stand-alone UDF. LibIni.au3 UTF-16 LE INI functions. LibStringFormatEx.au3 Modified StringFormat function. See http://www.autoitscript.com/forum/topic/139260-autoit-snippets/page__st__60#entry1010824 I18nAU3Text-Demo.en.lng English demo language file. I18nAU3Text-Demo.nl.lng Dutch demo language file. I18nAU3Text-Translation-HowTo.txt Basic translation instructions. ResAU3Text-Extractor.ico Pic unrelated :) A simple example of translating a string:
#include 'LibAU3Text.au3' _AU3Text_BindTextSection('MESSAGES', 'nl') ; Set translations to dutch. ; ... Create a GUI. ; Translate a string: GUICtrlCreateLabel(_AU3Text('The flying dutchman flies again.', 'FLYING_DUTCHMAN'), -1, -1) ; De vliegende hollander vliegt alweer. ; Translate a string with plural variants: GUICtrlCreateLabel(StringFormat(_AU3Text_Plural('Deleted %i file.', 2, 'DELETED_FILES'), 2), -1, -1) ; 2 bestanden verwijdert. ; Using shorthand functions: GUICtrlCreateLabel(_('The flying dutchman flies again.', 'FLYING_DUTCHMAN'), -1, -1) GUICtrlCreateLabel(StringFormat(_P('Deleted %i file.', 2, 'DELETED_FILES'), 2), -1, -1) ; Let AU3Text generate the INI keys, keys are MD5 hashes of the messages. GUICtrlCreateLabel(_('The flying dutchman flies again.'), -1, -1) GUICtrlCreateLabel(StringFormat(_P('Deleted %i file.', 2), 2), -1, -1) ; ... The UDF:
If you encounter any bugs or have any suggestions, requests or improvements, then please let me know.
edit 1: zip added
edit 2: If you compiled AU3Text-Extractor and want to test it, run it against AU3Text-Demo like this:
AU3Text-Extractor.exe Au3Text-Demo.au3 be This will create AU3Text-Demo.be.lng in the I18n directory.