Jump to content

Recommended Posts

Posted (edited)

_Translate

Simple translation library/UDF for AutoIt

Inspired by gettext and AU3Text.

Usage

Extractor

  1. Place compiled eci.exe binary under eci\build folder
  2. Run Extract.au3 script to interactively extract all translatable strings from your script

NOTE: The extractor will only extract translatable strings from your code (i.e strings wrapped in the _ function):

#include "_.au3"

ConsoleWrite("This string will NOT be extracted")
ConsoleWrite(_("This string will be extracted"))

UDF

  1. Include _.au3 in your script
  2. Call _Translate_LoadTable with path of your translation table
  3. Use _ to wrap all of your strings which need to be translated

View code at GitHub - Download code as ZIP - Download compiled eci.exe

Edited by TheDcoder
Update instructions

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

  • 5 months later...
Posted

Not working for me, eci.exe returns empty string.

I use Win 10 Home x64.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted
  On 3/11/2021 at 3:15 AM, TheDcoder said:

Have you tried it on another PC?

Expand  

No.

 

  On 3/11/2021 at 4:26 AM, TheDcoder said:

The program only extracts strings inside this function

Expand  

Well, i used your Extract.au3 from the archive, it runs the eci.exe only from there.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted
  On 3/11/2021 at 8:51 AM, MrCreatoR said:

Well, i used your Extract.au3 from the archive, it runs the eci.exe only from there.

Expand  

Yes, but I was referring to the target script which you choose after running extract.au3, the tool only extracts strings inside the translation function, this makes the job easier by not extracting all the other strings that might be in the script.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

I don't understand, then what i should do to see the results of eci.exe?

I thought that this tool can help in getting strings table quicker.

 

Your readme files sais:

  Quote

1. Place compiled [`eci.exe`](https://www.autoitscript.com/forum/files/file/510-_translate-eci-string-extractor) binary under `eci\build` folder
2. Run `Extract.au3` script to interactively extract all translatable strings from your script

Expand  

So this is what i am trying to do. But no success, i don't get translatable strings.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

@MrCreatoR Sorry about the confusion, I realize that the instructions are a bit vague.

  On 3/11/2021 at 4:27 PM, MrCreatoR said:

I don't understand, then what i should do to see the results of eci.exe?

Expand  

You should give it a script which contains code calling the underscore (_) function, it will only extract strings if your code uses that function to wrap strings like this:

#include "_.au3"

ConsoleWrite("This string will NOT be extracted")
ConsoleWrite(_("This string will be extracted"))

 

Edit: I have updated the instructions to be more clear, I have also added a warning in the extractor script :)

Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

Now i understand, thanks for clarification.

It was interesting for me to see how it takes the strings from script, i mean the logic behind detecting translatable strings and distinguish them from other strings that should not be translated.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...