Skip to content

Pluralization#10

Draft
virolea wants to merge 2 commits intomainfrom
feature/pluralization
Draft

Pluralization#10
virolea wants to merge 2 commits intomainfrom
feature/pluralization

Conversation

@virolea
Copy link
Owner

@virolea virolea commented Sep 20, 2024

Closes #5

@virolea virolea changed the title Nest the key translation at the default key in the translation store Pluralization Sep 20, 2024
@virolea virolea mentioned this pull request Sep 23, 2024
1 task
@virolea virolea force-pushed the feature/pluralization branch 4 times, most recently from 8c7e7a9 to 06f9fe9 Compare September 25, 2024 13:19
@virolea virolea force-pushed the feature/pluralization branch 2 times, most recently from 1583197 to f6ffa29 Compare October 3, 2024 09:54
@virolea virolea force-pushed the feature/pluralization branch from f6ffa29 to 358010f Compare October 3, 2024 10:16
@virolea virolea assigned virolea and unassigned virolea Dec 3, 2024
@virolea virolea requested a review from Copilot March 3, 2025 08:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR introduces pluralization functionality for Rosetta by adding new operator classes, corresponding tests, and integrating pluralization rules into the model and schema.

  • Added operator classes (LessThan, LessThanOrEqualTo, EqualTo, GreaterThan, GreaterThanOrEqualTo) with a common BaseOperator interface
  • Introduced tests for each operator and updated the PluralizationRule model, migrations, and fixtures accordingly

Reviewed Changes

File Description
test/lib/rosetta/pluralization/operators/greater_than_or_equal_to.rb New test for GreaterThanOrEqualTo operator
test/lib/rosetta/pluralization/operators/greater_than_test.rb New test for GreaterThan operator
test/lib/rosetta/pluralization/operators/less_than_test.rb New test for LessThan operator
test/lib/rosetta/pluralization/operators/less_than_or_equal_to_test.rb New test for LessThanOrEqualTo operator
app/models/rosetta/pluralization_rule.rb Updated model with operator mapping and validation
lib/rosetta/pluralization/base_operator.rb Introduced common operator interface
lib/rosetta/pluralization/operators/* Implementations of each pluralization operator
lib/rosetta/pluralization.rb Aggregates pluralization functionality
test/fixtures/rosetta/pluralization_rules.yml Added fixture for pluralization rules
db/migrate/20240920134441_create_rosetta_pluralization_rules.rb Migration to create pluralization_rules table
app/models/rosetta/locale.rb Updated Locale model with pluralization_rules association
db/migrate/20240923100651_add_default_to_rosetta_locales.rb Updated migration for default locale flag
lib/rosetta-rails.rb Included pluralization module

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

@@ -1,4 +1,4 @@
class AddDefaultToRosettaLocales < ActiveRecord::Migration[7.2]
class AddDefaultToRosettaLocales < ActiveRecord::Migration[6.1]
Copy link

Copilot AI Mar 3, 2025

Choose a reason for hiding this comment

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

The migration version has been changed from 7.2 to 6.1, which may be inconsistent with the rest of the project. Please verify that this downgrade is intentional and aligns with the project's Rails version.

Suggested change
class AddDefaultToRosettaLocales < ActiveRecord::Migration[6.1]
class AddDefaultToRosettaLocales < ActiveRecord::Migration[7.2]

Copilot uses AI. Check for mistakes.
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.

Pluralization API

2 participants