Skip to content

Latest commit

 

History

History
803 lines (402 loc) · 27.7 KB

CHANGELOG.asciidoc

File metadata and controls

803 lines (402 loc) · 27.7 KB

Changelog

i18n 0.10.1 (2024-11-15)

  • Update affects the Sqlite data provider:

    • Dropped the non-component based schema to simply data repository management. Affected .sqlite3 databases were migrated to the component based schema, where the filename is used to populate the component column entries.

    • Added schema verification function.

    • Minor documentation formatting.

Project wide changes

  • Added #![allow(unexpected_cfgs)] to files containing optional feature options, to eliminate warnings from being emitted.

  • Migrated the .sqlite3 databases in the crate’s subdirectory l10n to the component based schema.

i18n_provider_sqlite3

  • In error.rs:

    • Added new error variants that are used in the verify_schema() function.

  • In provider.rs:

    • New public function verify_schema(). Reason for public is to allow the localisation editor to verify the database structure before editing of the contents. In addition, the schema version is returned, so that the provider and localisation editor can take appropriate actions, such as adjusting query statements, migrating from older version to newer version, etc.

    • Added internal enum DefaultValue added, to pass the expected default value of a column.

    • Added internal functions table_exists() and columns_check().

i18n 0.10.0 (2024-08-02)

Warning
This update has API breaking changes.
  • Primary focus of this version was eliminating of String duplications, particular from the internal cache.

  • Changed the string returned type from TaggedString to a tuple (RefCount<String>, RefCount<LanguageTag>), where RefCount is either Rc or Arc. This change allows the user of this library to discard the language tag with ease, without expensive copying of the String. However TaggedString will still remains in the i18n_utility crate, for those who still want the convenience of keeping string tagged with language.

  • Added to LanguageTag struct a method for creating an ICU LanguageIdentifier or Locale (with feature icu_extended) instance.

  • On the LanguageTagRegistry, made the caching of LanguageIdentifier or Locale instances optional by providing a dedicated method icu_language that will return a cached reference counted instance. If not already present in the cache, the method will create and add the instance immediately to the cache, then return the reference counted instance.

Project wide changes

  • Altered the affected unit tests for the changes made.

  • Updated examples and documentation to reflect the changes made to structs, enums and methods.

  • Updated Cargo.toml to latest dependencies versions.

i18n_localiser

  • In error.rs:

    • Added new variant NeverReached to the LocaliserError enum.

  • In formatter.rs:

    • Implemented new variant Localised in PlaceholderValue match statements.

    • Other minor editing.

  • In localiser.rs:

    • Changed the TaggedString to (String, RefCount<LanguageTag>) for methods: format(), format_with_defaults(), literal(), literal_with_defaults(), format_localisation_data(), format_localisation_data_with_defaults(), format_error(), format_error_with_defaults(), and internal methods.

    • Implemented new variant Localised in PlaceholderValue match statements.

i18n_provider

  • In provider.rs:

    • Changed the TaggedString to (String, RefCount<LanguageTag>) for methods: string(), string_exact_match(), and strings().

i18n_provider_sqlite3

  • In provider.rs:

    • Changed the TaggedString to (String, RefCount<LanguageTag>) for methods: string(), string_exact_match(), strings(), and all internal methods.

i18n_utility

  • In language.rs:

    • Added new method ice_language() to the LanguageTag type.

    • For the LanguageTagRegistry:

      • changed the caching of LanguageIdentifier or Locale instances to be optional, that is no longer creates LanguageIdentifier or Locale instance and add to the cache when validating the supplied language tag.

      • changed tag() method to only validate the supplied language tag without creating LanguageIdentifier or Locale instances.

      • removed methods: locale() and tag_and_locale() as cache is made optional.

      • added icu_language() method to obtain cached LanguageIdentifier or Locale instance for the supplied LanguageTag.

  • In tagged_string:

    • Added new method as_string() to return a reference &String.

  • In types.rs:

    • Added new variant Localised(RefCount<String>, RefCount<LanguageTag>) to the PlaceholderValue enum.

i18n 0.9.2 (2024-07-23)

  • Added script directional support.

  • Added icu_locid_transform dependency to various Cargo.toml

  • Added new feature icu_extended for expanded support. Provides additional scripts data, that is currently not available in icu_locid_transform.

i18n_localiser

  • Added scripts.rs containing script direction data provider for the icu_extended feature, and added entry in lib.rs.

  • In localiser.rs added script direction support to the localiser, and added new public methods script_data() and script_data_for_language_tag().

i18n_utility

  • Added scripts.rs and added entry in lib.rs.

i18n 0.9.1 (2024-03-24)

  • Fixed logging of debugging information

  • Fixed project’s root README.asciidoc.

Project wide changes

  • Changed debug information statements from println!() to trace!().

  • Changed [cfg(feature = "log")] to [cfg(feature = "logging")] in source files of crates having logging feature.

  • Fixed logging statements, that was not processed during compiling with the feature logging due to incorrect #[cfg(feature = "log")] statements.

i18n

  • Removed comments from lib.rs.

i18n_provider_sqlite3

  • Changed remaining (missed) AsRef<str> to &str of internal methods.

i18n 0.9.0 (2024-03-21)

Warning
This update has API breaking changes, Cargo feature changes, crates merging.
  • Updated the description in the project’s README.asciidoc.

  • Source code clean up with the aid of cargo clippy and cargo fmt.

  • Streamlined the process of setting up the i18n environment.

  • Merged crate i18n_icu into i18n_lexer, and crate i18n_pattern into i18n_localiser.

  • Added experimental directory for prototyping and development of sub projects.

    • Added new subproject i18n_renderer for rendering text for various script types. Still in early stage.

Project wide changes

  • Cargo features changes:

    • Added icu_extended to make use of more detailed information ICU types, such as Locale instead of LanguageIdentifier.

    • Renamed blob to icu_blob, compiled_data to icu_compiled_data, fs to icu_fs, log to logging.

  • Changed various functions and methods to use explicit &str instead of trait AsRef<str>, to avoid issues with passing AsRef<str> in internal called functions and methods.

  • Where required updated the Cargo.toml, README.asciidoc, tests, examples and documentation.

i18n

  • Removed dependency crates i18n_icu and i18n_pattern.

i18n_icu

  • Merged i18n_icu crate into i18n_lexer crate.

  • Removed the directory crates/icu after merging.

i18n_lexer

  • Rewrote Lexer into an owned iterator LexerIterator.

  • Added new LexerError type to error.rs.

  • Renamed localisation repository from i18n_icu.sqlite3 to i18n_lexer.sqlite3 and added entries for LexerError.

i18n_localiser

  • Streamlined the i18n environment:

    • Made the formatter.rs to be private as the Formatter instances are created by the Localiser methods,

    • The creation of the Tree instance and the lexer are now embedded in the `Formatter::try_new()',

    • Made the parser.rs to be private due to the Tree creation is embedded in Formatter::try_new(),

    • Made the LexerIterator to be called from Formatter::try_new(),

    • As a result of streamlining the environment, the embedded Tree never gets a chance to be modified, thus a new custom stripped down optimised tree was created. As the tree being internal immutable, many sanity checks was removed and other unused methods was removed. The new tree.rs made to be private. Embedded the LexerIterator and the parser source code within the Tree:try_new().

  • Modified various methods to use the new Tree.

  • Removed the crate dependency tree-rizzen-yazston.

  • Removed parser.rs.

  • Changed AsRef<str> to &str of various methods of various structs of the crate’s modules.

  • Merged the i18n_pattern.sqlite3 into i18n_localiser.sqlite3, and added entries for the new TreeError.

  • Various files, changed language tag parameters to use LanguageTag struct instead.

i18n_pattern

  • Merged i18n_pattern crate into i18n_localiser crate.

  • Removed the directory crates/pattern after merging.

i18n_provider_sqlite3

  • Fixed log messages.

  • Changed AsRef<str> to &str of internal methods.

  • Various files, changed language tag parameters to use LanguageTag struct instead.

i18n_utility

  • Modified registry.rs:

    • Renamed registry.rs to language.rs.

    • Added LanguageTag struct to hold the result language tag.

    • Altered LanguageTagRegistry struct and methods to use LanguageTag.

  • Modified tagged_string.rs to use new LanguageTag instead of String.

i18n_renderer [experimental]

  • For the rendering of text for various script types. This will also be a separate crate to the i18n meta crate, as not all projects using the meta crate will not require the rendering of text.

i18n 0.8.0 (2024-02-03)

Warning
This update has moved some enums, structs, and traits to other crates. Check the use paths in rust files of projects depending on individual crates of the i18n project.
  • Add support for recursive localisation strings. To achieve this goal, needed to move various files, data structures, and traits between the various crates.

  • Updated various error.rs files to reflect the changes to the traits.rs file in i18n_utility crate.

  • Updated localisation Sqlite3 databases of various crates.

  • Updated Cargo.toml, documentation, examples and tests where necessary to reflect the changes done within the project.

i18n crate

  • In Cargo.toml added feature dependencies due to Formatter being moved from the i18n_pattern crate to the i18n_localiser crate in order to avoid cyclic crate dependencies.

i18n_icu crate

  • Corrected identifier strings for IcuError.

  • Added Clone attribute to DataProvider and IcuError enums.

  • Implemented the new traits of i18n_utility crate for IcuError enum.

i18n_localiser crate

  • Moved formatter.rs from i18n_pattern crate to i18n_localiser crate.

  • Moved FormatterError from i18n_pattern crate to i18n_localiser crate.

  • Moved localisation strings for Formatter from i18n_pattern crate to i18n_localiser crate.

  • Added Clone attribute to LocaliserError and FormatterError enums.

  • Implemented the new traits of i18n_utility crate for LocaliserError and FormatterError enums.

  • Add two new methods using LocalisationData instead of &str type for component and identifier parameters: format_localisation_data() and format_localisation_data_with_defaults().

  • Added two new convenient methods: format_error() and format_error_with_defaults().

i18n_pattern crate

  • Moved formatter.rs to i18n_localiser crate.

  • Moved FormatterError to i18n_localiser crate.

  • Moved localisation strings for Formatter to i18n_localiser crate.

  • Moved PlaceholderValue to i18n_utility crate’s types.rs.

  • Added Clone attribute to ParserError and CommandError enums.

  • Implemented the new traits of i18n_utility crate for ParserError and CommandError enums.

i18n_provider crate

  • Added Debug to ComponentDetails, LanguageData, and RepositoryDetails.

  • Changed trait LocalisationProvider to LocalisationProviderTrait to be more clear.

  • Added new ProviderError enum to separate common errors, that are not Sqlite based.

  • Change method signatures to allow trait to be object safe, removing the generic <T: AsRef<str>>, and replacing T with &str.

  • Implemented the new traits of i18n_utility crate for ProviderError enum.

  • Add localisation directory l10n to contain the common localisation strings separated from the Sqlite based localisation string.

  • TODO (just noted here): Improve error message for variant InvalidDefaultLanguage.

i18n_provider_sqlite3 crate

  • Added Clone attribute to ProviderSqlite3Error enum.

  • Added new SchemaError to improve error reporting of schema issues.

  • Implemented the new traits of i18n_utility crate for ProviderSqlite3Error and SchemaError enums.

  • Altered various implementations of the LocalisationProviderTrait to be object safe.

  • Improved default_language() method along with database improvements.

i18n_utility crate

  • Modified traits.rs:

    • Changed LocalisationErrorTrait to a simple super trait combining LocalisationTrait and Error traits. Removed the methods error_type() and error_variant().

    • Changed LocalisationTrait removing identifier and component methods, and adding localisation_data() method.

  • Created file types.rs:

    • Created new LocalisationData struct, which supports recursive localisation strings and also supports literal localisation strings by using None for the values field,

    • Moved PlaceholderValue enum from i18n_pattern crate’s types.rs.

  • Implemented the new traits of i18n_utility crate for RegistryError enum.

  • Moved the localisation strings to i18n_localiser crate, and removed the directory l10n.

i18n 0.7.0 (2023-12-17)

Warning
This update has API breaking changes for almost all i18n crates.

Overview

  • Redesigned IcuDataProvider to make use of new internal data feature in icu 1.3.0, and to resolve issue related to generic DataProvider issue with applications' main() method.

  • Added support for rust’s concurrency to the i18n_ crates, by using Arc and Mutex instead Rc and RefCell when enabling the crate feature sync. Where necessary also passes sync also to the ICU4X crates, that this project depends on.

  • Changed LString to TaggedString considering it is a string being tagged to some identifier, and is generic in design to be used outside of the project, where tagged strings are required.

  • Redesigned of LStringProvider for clearer usage including name changed to LocalisationProviderTrait, and added information methods for the data repository. LStringProviderSqlite3 updated to implement the changes, including name changed to LocalisationProviderSqlite3, and implement new required methods. There may be additional methods in the future.

  • Added log support to various crates.

  • Added two traits for aiding in localising structs and enums. Implemented for the error types of the i18n crates.

  • Next version: See what new ICU4X features is available to add to pattern.rs.

General changes to multiple crates

  • Moved many shared package attributes from the various crates' Cargo.toml to workspace’s Cargo.toml for easier management of project details.

  • Moved all project dependency details to workspace’s Cargo.toml for easier management of project dependencies.

  • Implemented localisation traits for the error type(s) of the various crates.

  • Adjusted Cargo.toml, tests, and documentation to reflect the changes.

i18n crate

  • Added new crate features of included crates.

i18n_icu crate

  • Added new enum DataProvider to specify the supported data provider to use.

  • Reworked IcuDataProvider to use new DataProvider. Also included sanity check to ensure that there is a data provider.

  • Added Sqlite3 file for supported error language strings.

  • Added logging.

i18n_lexer crate

  • Changed Lexer struct to be public, moved tokenise() function to be method of Lexer, and created new method new() to initialise the lexer, by moving 2 parameters from tokenise() to new().

i18n_pattern crate

  • Changed Formatter::format() to use the new IcuDataProvider.

  • For CommandRegistry renamed get() to command().

  • Added 5 new helper functions to obtain the required ICU formatter instance. Allows for easier support for new data providers.

  • Updated .sqlite3: add missing language strings for NeverReach error, and languages strings for new error NoIcuProvider (separated from NeverReach error) for easier error distinction.

i18n_localiser crate

  • Renamed directory message to localiser.

  • Renamed message.rs to localiser.rs.

  • Changed Message to use new IcuDataProvider and new Lexer.

  • Added a default language field to Message and parameter for new().

  • Added new method for setting the defaults.

  • Added 3 new methods to obtain language strings: format_with_defaults, get, and get_with_defaults, and change the type of language_tag parameter of format to AsRef<&str>.

  • Added 3 new methods to get the shareable i18n components: language_tag_registry, command_registry, and icu_data_provider.

  • Moved contributors information into i18n_message.sqlite3 from .asciidoc file for easier combining of i18n translation directories.

i18n_provider crate

  • Renamed LStringProvider to LocalisationProviderTrait.

  • Updated existing methods signatures, split the identifier parameter into the component and identifier parameters.

  • Renamed get() to strings().

  • Renamed get_one() to string().

  • Added new method signatures to retrieve information on the data repository:

    • string_exact_match(),

    • identifier_details(),

    • component_details(),

    • repository_details().

  • Removed redundant struct and trait.

i18n_provider_sqlite3 crate

  • Almost complete rewrite of provider.rs, smaller code size and performance improvement with caching of information data.

  • Renamed LStringProviderSqlite3 to LocalisationProviderSqlite3.

  • Added implementations of the new methods to retrieve information on the data repository.

  • Added caching to information methods.

  • Moved contributors information into i18n_provider_sqlite3.sqlite3 from .asciidoc file for easier combining of l10n translation directories.

  • Added templates all_in_one.sqlite3 and application.sqlite3 to l10n, and unit tests still pass, indicating search progressing from all_in_one.sqlite3 to respective component Sqlite file.

  • Updated unit tests for changed methods, and adding new unit tests for information methods.

  • Removed redundant struct and trait.

i18n_utility crate

  • Added traits.rs containing two localisation traits: LocalisationTrait and ErrorReflectionTrait (additional methods for localising of errors).

  • tagged_string.rs:

    • Renamed lstring.rs to tagged_string.rs.

    • Renamed LString to TaggedString.

    • Renamed language_tag() to tag().

    • Implemented Display trait on TaggedString to obtain to_string() method, to create a string stripped of the tag.

  • registry.rs:

    • Changed method get_language_tag of LanguageTagRegistry to tag.

    • Changed method get_locale of LanguageTagRegistry to locale.

    • Changed method get of LanguageTagRegistry to tag_and_locale.

Dependencies changes:

  • bumped icu_provider to 1.3.2

  • bumped icu_provider_fs to 1.3.2

  • bumped icu_provider_blob to 1.3.2

  • bumped icu_properties to 1.3.2

  • bumped icu_locid to 1.3.2

  • bumped icu_plurals to 1.3.2

  • bumped icu_decimal to 1.3.2

  • bumped icu_calendar to 1.3.2

  • bumped icu_datetime to 1.3.2

  • bumped icu_segmenter to 1.3.2

  • bumped fixed_decimal to 0.5.4

  • bumped rusqlite to 0.29.0

  • added log 0.4.20

i18n 0.6.1 (2023-07-06)

  • Enabling publishing for all crates.

  • Fixed various links in the documentation, that was reported by rustdoc tool.

i18n 0.6.0 (2023-07-04)

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.

    • Added the Cargo.toml, license, and documentation.

  • Updated the i18n_provider crate:

    • Added LStringProviderWrapper.

    • Updated documentation.

  • Updated the i18n_provider_sqlite crate:

    • Added LStringProviderSqlite3, AsLStringProviderSqlite3, and its blanket implementation.

    • Removed the requirement of RefCell for language_tag_registry parameter and struct, as it was redundant.

    • Updated tests, examples and documentation.

  • Updated the i18n_lexer crate:

    • 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.

    • Updated Cargo.toml, tests, examples and documentation.

  • Updated the i18n_pattern crate:

    • Updated Formatter to use IcuDataProvider.

    • Added CommandRegistry and CommandError for the command patterns.

    • Added command callback function file_path.

    • Updated Cargo.toml, tests, examples and documentation.

  • Updated i18n_lstring crate to merge with i18n_registry crate:

    • Added Clone to #[Derive()] to allow cloning.

    • Renamed lib.rs to 'lstring.rs', and moved to i18n_registry crate.

    • Removed i18n_lstring crate

  • Added the i18n_message crate:

    • Added Message, MessageError.

    • Added tests.

    • Added the Cargo.toml, license, and documentation.

  • Updated i18n_registry crate:

    • Renamed crate to i18n_utility

    • Added lstring entries in lib.rs

    • Updated Cargo.toml, tests, examples and documentation.

i18n 0.5.0 (2023-03-16)

Warning
This update has many API breaking changes for all existing i18n crates.

Breaking change is the result of changing the implementation of handling error after reading Andrew Gallant’s blog post 14 May 2015.

  • Added the i18n_provider crate:

    • Added LStringProvider, ProviderError.

    • Added the Cargo.toml, license, and documentation.

  • Added the i18n_provider_sqlite3 crate:

    • Added implementation of LStringProvider using Sqlite3 backend.

    • Added tests directory.

    • Added Sqlite3 file for supported error language strings.

    • Added the Cargo.toml, license, and documentation.

  • Updated the i18n_utility crate:

    • Renamed crate i18n_utility to i18n_registry.

    • Renamed locale.rs to registry.rs, and updated to use RegistryError for error.

    • Added error.rs file containing RegistryError enum.

    • Updated lib.rs to include error.rs file.

    • Updated Cargo.toml and documentation.

  • Updated the i18n_lstring crate:

    • Minor documentation corrections, and made unit test independent of icu_locid crate, though left example using icu_locid crate.

  • Updated the i18n_lexer crate:

    • Renamed lib.rs to lexer.rs:

      • Updated to use LexerError for error.

      • Moved the test tokenise to its own file tokenise.rs in tests directory.

    • Added error.rs file containing LexerError enum.

    • Added new lib.rs to include both lexer.rs and error.rs.

    • Updated Cargo.toml and documentation.

    • Added Sqlite3 file for supported error language strings.

  • Added i18n_provider crate:

    • Added provider.rs file containing LStringProvider trait.

    • Added error.rs file containing ProviderError struct.

    • Added lib.rs to include both provider.rs and error.rs.

    • Updated Cargo.toml and documentation.

  • Added i18n_provider_sqlite3 crate:

    • Added provider.rs file containing ProviderSqlite3 struct implementing LStringProvider trait.

    • Added error.rs file containing Sqlite3Error struct.

    • Added lib.rs to include both provider.rs and error.rs.

    • Updated Cargo.toml and documentation.

  • Updated i18n_pattern crate:

    • Updated Cargo.toml and documentation.

    • Updated parser.rs, formatter.rs, and types.rs:

      • Updated to use ParserError and FormatterError for the errors.

      • Moved all tests to their own files parser.rs and formatter.rs in tests directory.

    • Added error.rs file containing ParserError and FormatterError enums.

    • Updated lib.rs to include error.rs file.

    • Updated Cargo.toml and documentation.

    • Added Sqlite3 file for supported error language strings.

  • Removed i18n_error crate as it is no longer needed after update of error handling.

i18n 0.4.0 (2023-02-24)

Warning
This update has many API breaking changes for all existing i18n crates.

Main feature of this update is the adding of the i18n_error crate to provide the ErrorMessage to replace all the String used for the Err() results.

  • Added the i18n_error crate:

    • Added ErrorMessage and ErrorPlaceholderValue.

  • Updated the i18n_lstring crate:

    • To facilitate the usage of ErrorMessage, it is required that the error messages should almost have no crate dependencies, especially at times when the message system will not be used to localise the error message. Thus replaced Rc<Locale> with Rc<String>, where String represents a BCP 47 Language Tag. This affects the LString struct, and methods: new, and locale replaced with language_tag.

    • Additional change to new() parameter string to Into<String> instead of String as there are types that do have methods for type conversions.

    • Updated unit tests, examples and documentation to reflect the changes.

  • Updated the i18n_utility crate:

    • Changed get():

      • To return ErrorMessage upon locale parsing error,

      • To use AsRef<str> instead of String for greater ease of use.

      • To return a tuple pair of language tag (Rc<String>) and locale (Rc<Locale>).

    • Added get_language_tag() to get only language tag.

    • Added get_locale() to get only the locale.

    • Updated unit tests, examples and documentation to reflect the changes.

  • Updated the i18n_lexer crate:

    • To make use of ErrorMessage for errors.

    • Change inputs of &str to AsRef<str> for greater ease of use.

    • Updated unit tests, examples and documentation to reflect the changes.

  • Updated the i18n_pattern crate:

    • Updated the parser module:

      • To make use of ErrorMessage for errors.

      • Removed redundant semantic analysis code as formatter does include the semantic analysis.

    • Updated the types module:

      • Changed PlaceholderValue to be an enum.

    • Updated the formatter module:

      • To make use of ErrorMessage for errors.

      • Change the pattern part structs to PatternPart enum.

    • Updated unit tests, examples and documentation to reflect the changes.

i18n 0.3.1 (2023-01-29)

  • Updated the i18n_pattern crate:

    • Split types from parser into own module types.

    • Added formatter module.

    • Removed semantic analysis from parser to formatter module.

  • Minor improvement changes to crates: i18n_lexer and i18n_lstring.

i18n 0.3.0 (2022-12-24)

  • Added the i18n_pattern crate:

    • Added parser module.

  • Added the i18n_lexer crate.

i18n 0.2.0 (2022-10-15)

  • Added the i18n_utility crate:

    • Added locale module:

      • Added LocaleRegistry

  • Fixed all the documentation of the project.

i18n 0.1.0 (2022-10-13)

  • Added the i18n_lstring crate.

i18n 0.0.0 (2022-10-12)

  • The i18n project’s Git repository initialised with:

    • .gitignore

    • LICENSE-BSD-3-Clause

    • README.asciidoc

    • CHANGELOG.asciidoc