Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Commit

Permalink
Document new ICU usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Berrysoft committed Aug 23, 2022
1 parent 4283e3b commit ae2e075
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
steps:
- script: |
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev libicu-dev
sudo apt install libwebkit2gtk-4.0-dev
condition: eq(variables.platform, 'linux-x64')
displayName: "Install dependencies on Linux"
Expand All @@ -50,7 +50,7 @@ jobs:
deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse
EOT
sudo apt update
sudo apt install libc6-dev-i386:amd64 libc6-dev-arm64-cross:amd64 gcc-aarch64-linux-gnu:amd64 binutils-aarch64-linux-gnu:amd64 libwebkit2gtk-4.0-dev:amd64 libicu-dev:amd64 libwebkit2gtk-4.0-dev:arm64 libicu-dev:arm64
sudo apt install libc6-dev-i386:amd64 libc6-dev-arm64-cross:amd64 gcc-aarch64-linux-gnu:amd64 binutils-aarch64-linux-gnu:amd64 libwebkit2gtk-4.0-dev:amd64 libwebkit2gtk-4.0-dev:arm64
mkdir .cargo
cat >> .cargo/config <<EOF
[target.$(target)]
Expand Down
2 changes: 1 addition & 1 deletion bins/gal-gui/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"copyright": "",
"deb": {
"depends": [
"libicu63 | libicu68 | libicu69 | libicu70 | libicu71"
"libwebkit2gtk-4.0-37"
]
},
"externalBin": [],
Expand Down
11 changes: 2 additions & 9 deletions book/src/config/i18n.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# Internationalization
## ICU
The i18n feature are supported by ICU:

| Platform | Library |
| ------------------ | ------------------ |
| Windows (10 1903+) | `icu.dll` |
| Linux | `libicuuc.so` |
| macOS | `libicucore.dylib` |

We use ICU to canonicalize locale names, and choose the best fit locale for current system.
The i18n feature are supported by [ICU4X](https://github.com/unicode-org/icu4x) with [CLDR](https://github.com/unicode-org/cldr) data.
We use CLDR to choose the best fit locale for current system.

## Simplify translation
The translation of the texts is always a difficult job. You don't need to copy all commands as is.
Expand Down
4 changes: 2 additions & 2 deletions book/src/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All platforms need [Rust](https://www.rust-lang.org/) and [Nodejs](https://nodej
* Nodejs: 14.18+/16+ required by [Vite](https://vitejs.dev/).

### Windows
Windows 10 1903+ is required because we need `icu.dll`. We may consider extend this support to 1703+(with `icuuc.dll`).
Windows 10+ is recommended but any Windows that Rust supports is OK.

[WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) is required by [Tauri](https://tauri.app/). It comes with the latest Edge browser.

Expand All @@ -15,7 +15,7 @@ To run the Makefile toolchain, you need GNU Make from [MSYS2](https://www.msys2.
Note that if you have a WSL `bash.exe` in PATH before MSYS2 one, the `npm` command may fail.

### Linux
`libicu` and `webkit2gtk` is needed. We only support `webkit2gtk-4.0` required by [Tauri](https://tauri.app/).
`webkit2gtk` is needed. We only support `webkit2gtk-4.0` required by [Tauri](https://tauri.app/).

### macOS
Generally we don't need anything more, but you should ensure there a `make`.
Expand Down
4 changes: 1 addition & 3 deletions utils/gal-locale/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! The internal locale lib.
//!
//! This crate provides the [`Locale`] and [`Locale`] types.
//! They are internally a null-terminated string,
//! and use icu4c to parse and choose.
//! This crate provides the [`Locale`] type.

#![warn(missing_docs)]
#![feature(once_cell)]
Expand Down

0 comments on commit ae2e075

Please sign in to comment.