Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for localization and internationalization #126

Merged
merged 21 commits into from
Jun 25, 2024

Conversation

gcotelli
Copy link
Member

  • Move LanguageRange and LanguageTag abstractions from Hyperspace to be used in the localization support
  • Add string escaping support to ease the creation of strings including control characters and Unicode code points
    • String>>unescaped transforms the escaping sequences into the target Unicode characters
    • String>>escaped is a kind of inverse but some sequences have several possible escaping options
  • Add CurrentLocale dynamic variable to control the localization options
  • Add string localization support for translating strings in several languages
    • String>>localized and String>>localizedWithAll: providing translation services dependent on the current locale for the process, placeholders between {} are interpolated with the provided arguments, and escaping sequences are automatically unescaped.
  • Add extensions to TestCase to ease the testing of locale-aware code

This is the first milestone, in the future we will be adding localized methods for Numbers, Chronology objects, and pluralization rules as needed.

@gcotelli gcotelli requested a review from mtabacman June 20, 2024 01:29
@gcotelli gcotelli self-assigned this Jun 20, 2024
@gcotelli gcotelli requested a review from ytsejam78 June 20, 2024 01:29
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4fea7c4) to head (ae6c6cc).

Additional details and impacted files
@@                 Coverage Diff                  @@
##           release-candidate      #126    +/-   ##
====================================================
  Coverage             100.00%   100.00%            
====================================================
  Files                     81        95    +14     
  Lines                   7383      8318   +935     
====================================================
+ Hits                    7383      8318   +935     
Flag Coverage Δ
unit 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

source/Buoy-Localization-Extensions/String.extension.st Outdated Show resolved Hide resolved
source/Buoy-Localization-Extensions/String.extension.st Outdated Show resolved Hide resolved
source/Buoy-Localization/LanguageRange.class.st Outdated Show resolved Hide resolved
source/Buoy-Localization/LanguageTag.class.st Outdated Show resolved Hide resolved
source/Buoy-Localization/LanguageTag.class.st Outdated Show resolved Hide resolved
source/Buoy-Localization/LanguageTag.class.st Outdated Show resolved Hide resolved
source/Buoy-Localization/StringEscapingRule.class.st Outdated Show resolved Hide resolved
@gcotelli gcotelli requested a review from mtabacman June 24, 2024 13:11
@gcotelli gcotelli merged commit 57e1b32 into release-candidate Jun 25, 2024
64 checks passed
@gcotelli gcotelli deleted the localization branch June 25, 2024 21:20
@gcotelli gcotelli added this to the v8.0.0 milestone Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants