-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
601dad3
commit 5e4f457
Showing
1 changed file
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
# i18n_au3 | ||
# i18n AU3 | ||
Transliteration library for AutoIt | ||
|
||
How 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. See (Example.au3)[Example.au3] and (Example.ini)[Example.ini]. |