Skip to content

Commit

Permalink
Updated Crago.toml and README.asciidoc files due to bumping versions …
Browse files Browse the repository at this point in the history
…of ICU4X to 1.2.0, rusqlite to 1.29.0, and rust to 1.70.0. Also added the Italian translations to the i18n sqlite files. Updated 'lexer.rs' to re-enable the grapheme segmenter now that it is no longer experimental.
  • Loading branch information
rizzen-yazston committed Jul 4, 2023
1 parent 53034be commit a17f15b
Show file tree
Hide file tree
Showing 19 changed files with 123 additions and 107 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
= Changelog
Rizzen Yazston

== i18n 0.6.0 (2023-06-??)
== i18n 0.6.0 (2023-07-0?)

WARNING: This update has API breaking changes for some `i18n` crates.

Breaking change is the result of changing how ICU data providers are used and passed to various components, thus many examples are affected even if the module is not affected by the ICU data provider change.

* Updated various `Cargo.toml` files:

** Bumped rust-version to "1.70.0".

** Bumped all ICU4X crates version to "1.2.0".

** Bumped rusqlite crate version to "1.29.0".

* Added the `icu` crate:

** Added `IcuDataProvider`, `DataProviderWrapper`, and `IcuError`.
Expand All @@ -31,6 +39,8 @@ Breaking change is the result of changing how ICU data providers are used and pa

** Made `Lexer` struct private, made both `tokenise()` and `add_previous_characters()` methods as normal functions, removed `try_new` method and added `&Rc<IcuDataProvider>` to `tokenise()` function parameters.

** Re-enabled the string segmenter function, as the issue in icu_segmenter 0.8.0 was fixed in icu_segmenter 1.2.0, allowing proper counting of graphemes in a string slice.

** Removed the `error.rs` as neither of the functions returns errors.

** Updated the `lib.rs` to remove `error` module.
Expand Down
2 changes: 1 addition & 1 deletion crates/i18n/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "i18n-rizzen-yazston"
version = "0.5.0"
authors = ["Rizzen Yazston"]
edition = "2021"
rust-version = "1.67.0"
rust-version = "1.70.0"
description = "The `i18n` crate of the Internationalisation project."
license = "BSD-3-Clause"
readme = "README.asciidoc"
Expand Down
18 changes: 9 additions & 9 deletions crates/icu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "i18n_icu-rizzen-yazston"
version = "0.5.0"
authors = ["Rizzen Yazston"]
edition = "2021"
rust-version = "1.67.0"
rust-version = "1.70.0"
description = "The `i18n_icu` crate of the Internationalisation project."
license = "BSD-3-Clause"
readme = "README.asciidoc"
Expand All @@ -18,16 +18,16 @@ keywords = ["internationalization", "localization", "icu4x"]
categories = ["internationalization", "localization", "rust-pattern"]

[dependencies]
icu_provider = "1.1.0"
icu_properties = "1.1.0"
icu_segmenter = "0.8.0"
icu_plurals = "1.1.0"
icu_decimal = "1.1.0"
icu_calendar = "1.1.0"
icu_datetime = "1.1.0"
icu_provider = "1.2.0"
icu_properties = "1.2.0"
icu_segmenter = "1.2.0"
icu_plurals = "1.2.0"
icu_decimal = "1.2.0"
icu_calendar = "1.2.0"
icu_datetime = "1.2.0"

[dependencies.fixed_decimal]
version = "0.5.2"
version = "0.5.3"
# Needed for floating point support.
features = [ "ryu" ]

Expand Down
16 changes: 8 additions & 8 deletions crates/icu/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ Stefano Angeleri for advice on various design aspects of implementing the compon

```
[dependencies]
icu_provider = "1.1.0"
icu_provider = "1.2.0"

# These are required for the DataProvider.
icu_properties = "1.1.0"
icu_segmenter = "0.8.0"
icu_plurals = "1.1.0"
icu_decimal = "1.1.0"
icu_calendar = "1.1.0"
icu_datetime = "1.1.0"
icu_properties = "1.2.0"
icu_segmenter = "1.2.0"
icu_plurals = "1.2.0"
icu_decimal = "1.2.0"
icu_calendar = "1.2.0"
icu_datetime = "1.2.0"

# This is required for the DataProvider.
[dependencies.fixed_decimal]
version = "0.5.2"
version = "0.5.3"
# Needed for floating point support.
features = [ "ryu" ]
```
Expand Down
32 changes: 16 additions & 16 deletions crates/lexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "i18n_lexer-rizzen-yazston"
version = "0.5.0"
authors = ["Rizzen Yazston"]
edition = "2021"
rust-version = "1.67.0"
rust-version = "1.70.0"
description = "The `i18n_lexer` crate of the Internationalisation project."
license = "BSD-3-Clause"
readme = "README.asciidoc"
Expand All @@ -19,53 +19,53 @@ categories = ["internationalization", "localization", "rust-pattern"]

[dependencies]
i18n_icu-rizzen-yazston = { version = "0.5.0", path = "../icu" }
icu_provider = "1.1.0"
icu_properties = "1.1.0"
icu_segmenter = "0.8.0"
icu_plurals = "1.1.0"
icu_decimal = "1.1.0"
icu_calendar = "1.1.0"
icu_datetime = "1.1.0"
icu_provider = "1.2.0"
icu_properties = "1.2.0"
icu_segmenter = "1.2.0"
icu_plurals = "1.2.0"
icu_decimal = "1.2.0"
icu_calendar = "1.2.0"
icu_datetime = "1.2.0"

[dependencies.fixed_decimal]
version = "0.5.2"
version = "0.5.3"
# Required for floating point support
features = [ "ryu" ]

[dev-dependencies]

[dev-dependencies.icu_provider]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde", "deserialize_bincode_1" ]

[dev-dependencies.icu_properties]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_segmenter]
version = "0.8.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_plurals]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_calendar]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_datetime]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_testdata]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider and icu_segmenter
features = [ "buffer", "icu_segmenter" ]

Expand Down
16 changes: 15 additions & 1 deletion crates/lexer/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@ Stefano Angeleri for advice on various design aspects of implementing the compon
```
[dependencies]
i18n_icu-rizzen-yazston = "0.5.0"
icu_provider = "1.1.0"
icu_provider = "1.2.0"

# These are required for the DataProvider.
icu_properties = "1.2.0"
icu_segmenter = "1.2.0"
icu_plurals = "1.2.0"
icu_decimal = "1.2.0"
icu_calendar = "1.2.0"
icu_datetime = "1.2.0"

# This is required for the DataProvider.
[dependencies.fixed_decimal]
version = "0.5.3"
# Needed for floating point support.
features = [ "ryu" ]
```

== Examples
Expand Down
10 changes: 1 addition & 9 deletions crates/lexer/src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ pub fn tokenise<'a,
let mut iterator = string.as_ref().char_indices();
while let Some( ( position, character ) ) = iterator.next() {
lexer.position_byte = position;

// These are left here until the GraphemeClusterSegmenter works correctly, currently buggy.
//println!( "Byte position: {}", lexer.position_byte );
//println!( "Character position: {}", lexer.position_character );
//println!( "Grapheme position: {}", lexer.position_grapheme );

if lexer.data_provider.pattern_white_space().as_borrowed().contains( character ) {
if state == LexerStates::Identifier {
add_previous_characters( &mut lexer, &mut tokens, TokenType::Identifier, string.as_ref() );
Expand Down Expand Up @@ -279,9 +273,7 @@ P: ?Sized + DataProvider<PatternSyntaxV1Marker> + DataProvider<PatternWhiteSpace
let slice = &string.as_ref()[ lexer.token_position_byte .. lexer.position_byte ];
let len_byte = lexer.position_byte - lexer.token_position_byte;
let len_character = lexer.position_character - lexer.token_position_character;
// GraphemeClusterSegmenter is currently buggy, thus is commented out.
//let len_grapheme = lexer.data_provider.grapheme_segmenter().segment_str( slice ).count();
let len_grapheme = 1; // Temporary statement.
let len_grapheme = lexer.data_provider.grapheme_segmenter().segment_str( slice ).count() - 1;
tokens.push( Rc::new(
Token {
token_type: token,
Expand Down
32 changes: 16 additions & 16 deletions crates/message/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "i18n_message-rizzen-yazston"
version = "0.0.0"
authors = ["Rizzen Yazston"]
edition = "2021"
rust-version = "1.65.0"
rust-version = "1.70.0"
description = "The `i18n-message` crate of the Internationalisation project."
license = "BSD-3-Clause"
readme = "README.asciidoc"
Expand All @@ -25,53 +25,53 @@ i18n_provider-rizzen-yazston = { version = "0.5.0", path = "../provider/core" }
i18n_provider_sqlite3-rizzen-yazston = { version = "0.5.0", path = "../provider/sqlite3" }
i18n_utility-rizzen-yazston = { version = "0.5.0", path = "../utility" }
tree-rizzen-yazston = "0.4.0"
icu_provider = "1.1.0"
icu_properties = "1.1.0"
icu_segmenter = "0.8.0"
icu_plurals = "1.1.0"
icu_decimal = "1.1.0"
icu_calendar = "1.1.0"
icu_datetime = "1.1.0"
icu_provider = "1.2.0"
icu_properties = "1.2.0"
icu_segmenter = "1.2.0"
icu_plurals = "1.2.0"
icu_decimal = "1.2.0"
icu_calendar = "1.2.0"
icu_datetime = "1.2.0"

[dependencies.fixed_decimal]
version = "0.5.2"
version = "0.5.3"
# Required for floating point support
features = [ "ryu" ]

[dev-dependencies]

[dev-dependencies.icu_provider]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde", "deserialize_bincode_1" ]

[dev-dependencies.icu_properties]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_segmenter]
version = "0.8.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_plurals]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_calendar]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_datetime]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider
features = [ "serde" ]

[dev-dependencies.icu_testdata]
version = "1.1.0"
version = "1.2.0"
# Needed for BufferProvider and icu_segmenter used in i18n_lexer.
features = [ "buffer", "icu_segmenter" ]

Expand Down
20 changes: 10 additions & 10 deletions crates/message/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ i18n_provider-rizzen-yazston = "0.5.0"
i18n_provider_sqlite3-rizzen-yazston = "0.5.0"
i18n_utility-rizzen-yazston = "0.5.0"
tree-rizzen-yazston = "0.4.0"
icu_provider = "1.1.0"
icu_provider = "1.2.0"

# These are required for the DataProvider.
icu_properties = "1.1.0"
icu_segmenter = "0.8.0"
icu_plurals = "1.1.0"
icu_decimal = "1.1.0"
icu_calendar = "1.1.0"
icu_datetime = "1.1.0"
icu_properties = "1.2.0"
icu_segmenter = "1.2.0"
icu_plurals = "1.2.0"
icu_decimal = "1.2.0"
icu_calendar = "1.2.0"
icu_datetime = "1.2.0"

# These are required for the DataProvider.
# This is required for the DataProvider.
[dependencies.fixed_decimal]
version = "0.5.2"
# Required for floating point support
version = "0.5.3"
# Needed for floating point support.
features = [ "ryu" ]
```

Expand Down
Binary file modified crates/message/i18n/i18n_message.sqlite3
Binary file not shown.
Loading

0 comments on commit a17f15b

Please sign in to comment.