-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
45 changed files
with
856 additions
and
119 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 +1,16 @@ | ||
[package] | ||
name = "rust" | ||
name = "trc" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "GPL3" | ||
authors = ["limuy"] | ||
description = "a easy-learn programming language" | ||
homepage = "https://github.com/limuy2022/trc" | ||
repository = "https://github.com/limuy2022/trc" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
rand = "0.8.5" | ||
clap = { version = "4.4.11", features = ["derive"] } | ||
clap = { version = "4.4.12", features = ["derive"] } | ||
gettext-rs = "0.7.0" |
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# There are the references for the developers | ||
|
||
1.the l10n and i18n settings for trc | ||
|
||
[gettext official docs](https://www.gnu.org/software/gettext/manual/index.html) | ||
[rust interface for gettest](//https://docs.rs/gettext-rs/latest/gettextrs/) | ||
|
||
For Chinese develops: | ||
[gettext manual1](https://www.cnblogs.com/chenxf0619/articles/4287608.html) | ||
[gettext manual2](https://www.cnblogs.com/richardtien/articles/1884670.html) |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# How to add translation to the project | ||
|
||
First, you can enter the language dir in the ```locales``` dir.If you want to add a new language.Please follow the following structure: | ||
|
||
```locales/language_[region[.encoding]]/LC_MESSAGES``` | ||
|
||
For example,```locales/en_US.UTF-8/LC_MESSAGES```,```locales/en_US/LC_MESSAGES```,```locales/en/LC_MESSAGES```. | ||
|
||
Then,create a translation file named ```trans.po``` in the dir. | ||
|
||
Please refer to the [Translation Reference](./reference.md) to study how to add translation in the ```.po``` file. | ||
|
||
After you finished the ```.po``` file.You can compile it to the binary file ```.mo``` that the Trc finally use.You can simply run the python script ```script/gen_locales.py``` to rebuilt all the language resources files.You can also run ```msgfmt -o trans.mo trans.po``` to jsut built this file.The former way is a little slower,but is more easy for beginners. | ||
|
||
If there isn't ```msgfmt``` command in you Operating System.You can install it by the package manager or you can use ```msgfmt.py``` in python tools.It can work greatly,too. | ||
|
||
Thank you for your contribution! |
Oops, something went wrong.