Skip to content

Commit

Permalink
Integrate ICU4X into Intl module (#2083)
Browse files Browse the repository at this point in the history
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->

This Pull Request integrates an `ICU4X` data provider API in our codebase, to make use of the internationalization APIs that this crate provides.

It changes the following:

- Creates an API for pluggable icu data providers at `Context` creation, adding an `Icu` struct to store the provider (and some other internationalization tools) at runtime.
- Slightly changes locale related functions to preserve the `Locale` type and ensure correctness. (Will make some other changes related to this).
- Integrates the `sys_locale` crate to fetch the current default locale of an user instead of always returning `en-US`.
  • Loading branch information
Razican committed Jun 8, 2022
1 parent d5ea870 commit d886b3a
Show file tree
Hide file tree
Showing 29 changed files with 580 additions and 291 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Explain what you expected to happen, and what is happening instead.
<!-- E.g.:
Running this code, `a` should be set to `10` and printed, but `a` is instead set to `20`. The expected behaviour can be found in the [ECMAScript specification][spec].
[spec]: https://www.ecma-international.org/ecma-262/10.0/index.html#sec-variable-statement-runtime-semantics-evaluation
[spec]: https://tc39.es/ecma262/#sec-variable-statement-runtime-semantics-evaluation
-->

**Build environment (please complete the following information):**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Explain the ECMAScript feature that you'd like to see implemented.
<!-- E.g.:
I would like to see `switch` statement parsing and execution implemented. [ECMAScript specification][spec].
[spec]: https://www.ecma-international.org/ecma-262/10.0/index.html#sec-switch-statement
[spec]: https://tc39.es/ecma262/#sec-switch-statement
-->

**Example code**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: doc
args: -v --document-private-items
args: -v --document-private-items --all-features
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: doc
args: -v --document-private-items
args: -v --document-private-items --all-features
- run: echo "<meta http-equiv=refresh content=0;url=boa_engine/index.html>" > target/doc/index.html
- run: |
if [ -d target/doc_upload ]; then rm -rf target/doc_upload; fi
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
args: --ignore-tests
args: --features intl --ignore-tests
- name: Upload to codecov.io
uses: codecov/codecov-action@v3

Expand All @@ -55,7 +55,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: -v
args: -v --features intl

test_on_macos:
name: Tests on MacOS
Expand All @@ -70,7 +70,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: -v
args: -v --features intl

fmt:
name: Rustfmt
Expand Down Expand Up @@ -163,4 +163,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: doc
args: -v --document-private-items
args: -v --document-private-items --all-features
171 changes: 82 additions & 89 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion boa_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "boa_cli"
version = "0.14.0"
edition = "2021"
rust-version = "1.58"
rust-version = "1.60"
authors = ["boa-dev"]
description = "Boa is a Javascript lexer, parser and Just-in-Time compiler written in Rust. Currently, it has support for some of the language."
repository = "https://github.com/boa-dev/boa"
Expand Down
Loading

0 comments on commit d886b3a

Please sign in to comment.