Skip to content

Add built-in localization defaults for common languages#11

Merged
markets merged 10 commits intomasterfrom
copilot/fix-9
Jul 15, 2025
Merged

Add built-in localization defaults for common languages#11
markets merged 10 commits intomasterfrom
copilot/fix-9

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jul 14, 2025

This PR implements localization defaults YAML files for common languages, similar to what rails-i18n provides. Users can now easily load pre-configured localization settings for multiple languages without having to create their own locale files.

Bug Fix

Also fixed a bug in number localization where the decimal separator wasn't being handled correctly for different locales. The localization code was trying to split numbers using the target locale's separator instead of the standard "." separator.

Fixes #9.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Provide localization defaults YAML Add built-in localization defaults for common languages Jul 14, 2025
Copilot AI requested a review from markets July 14, 2025 22:01
Copy link
Copy Markdown
Owner

@markets markets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just automatically load localization files using the available_locales value. The currency and distance entries are only examples of what can be achieved, but no need to provide support, at least for now. Just keep them for testing. Btw, the sample file under the specs/* folder doesn't need to provide all the keys now, only the specific ones for testing custom scenarios (currency and distance).

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 14, 2025

I think we should just automatically load localization files using the available_locales value. The currency and distance entries are only examples of what can be achieved, but no need to provide supp...

I've implemented the changes as requested:

  1. Automatic loading: Localization files are now automatically loaded when available_locales is set - no need to manually call load_default_locales anymore
  2. Removed currency and distance: These entries have been removed from all built-in locale files but kept in the test fixture files for testing custom scenarios
  3. Simplified test fixtures: The fixture files now only contain the specific keys needed for testing currency and distance functionality

The changes are in commit 9502912. Users now just need to set available_locales and the appropriate locale files will be loaded automatically.

Copilot AI requested a review from markets July 14, 2025 22:21
@markets
Copy link
Copy Markdown
Owner

markets commented Jul 14, 2025

Add also support for the following locales: chinese and japanese.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 14, 2025

Add also support for the following locales: chinese and japanese.

I've added support for Chinese (:zh) and Japanese (:ja) locales. Both locale files include proper date/time formats, day and month names, and number formatting following each language's conventions. The README and all tests have been updated to include the new locales. Commit: 3a7e14f

@markets markets marked this pull request as ready for review July 15, 2025 09:26
@markets markets merged commit cb81525 into master Jul 15, 2025
7 checks passed
@markets markets deleted the copilot/fix-9 branch July 15, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide localization defaults YAML

2 participants