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

Support translation for segment anniversary filters #7228

Closed

Conversation

kuzmany
Copy link
Member

@kuzmany kuzmany commented Feb 8, 2019

Please be sure you are submitting this against the staging branch.

Q A
Bug fix?
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs)
BC breaks?
Deprecations?

Description:

This PR is related to already merged to #6993
We've added support for anniversary, but now need support for translated anniversary filter.

If you're using english language:

  • anniversary
  • anniversary -1 day

If you're using french language, you are able to use these format:

  • anniversary
  • anniversary -1 day
  • anniversaire
  • anniversaire -1 day

This PR bring new DateRelativeParser (tests include) https://github.com/mautic/mautic/pull/7228/files#diff-bbfe9f8aca314124ce61104c7207459b
That classes also use in another PR #6710
Class parse string based on own dictionary or related date start with +/-.

Steps to test this PR:

  1. Load up this PR
  2. Create custom contact date field
  3. Add two contacts. If today is 8. 2. 2019, then
  • first contact has custom date field set to 2019-02-08
  • second contact has custom date field set to 2019-02-07
  1. Create two segments with Custom date field equal
  • anniversary
  • anniversary -1 day
  1. Wait for segments rebuild and see If contacts was added to segments correctly
    Devs can also check logs on dev enviroment

I see for first segment

image

For second segment
image
6. Then remove segments and switch Mautic to french language
7. Create same two segments as above + create additional two segments with french language in filter:

  • anniversary
  • anniversary -1 day
  • anniversaire
  • anniversaire -1 day
  1. Wait to segments rebuild and see If contacts was assigned to all four segments what you created

@kuzmany kuzmany added ready-to-test PR's that are ready to test enhancement Any improvement to an existing feature or functionality labels Feb 8, 2019
@kuzmany kuzmany added this to the 2.16.0 milestone Feb 8, 2019
@kuzmany kuzmany mentioned this pull request Feb 11, 2019
kuzmany added a commit to kuzmany/mautic that referenced this pull request Feb 11, 2019
@npracht npracht added this to Ready to Test (first time) in Mautic 2 Aug 15, 2019
@npracht npracht modified the milestone: 2.16.0 Jan 23, 2020
@npracht npracht added needs-rebase PR's that need to be rebased and removed ready-to-test PR's that are ready to test labels Apr 6, 2020
@npracht npracht added this to the 3.0.0 milestone Apr 6, 2020
@npracht
Copy link
Member

npracht commented Apr 6, 2020

Hi there!
It has been decided to not create any extra Mautic 2 minor versions (which means no more features in M2) knowing that Mautic 3 is coming very soon.

We now want to integrate your contribution in the Mautic 3 roadmap as 3.1.0 candidate.

How to do?

  1. Check if your feature or enhancement is still missing and relevant in Mautic 3
  2. If Yes: rebase your PR against the 3.x branch
  3. If No: please consider closing your PR if you are absolutely sure that the feature has made it into Mautic 3 already

Please report results by commenting on your PR to make us administration easier.


You can more information on how to do all of that on this blog post "Getting you PR ready for Mautic 3".

@npracht npracht modified the milestones: 3.0.0, 3.0.1 Apr 6, 2020
@kuzmany kuzmany changed the base branch from staging to 3.x April 26, 2020 20:19
@npracht npracht changed the base branch from 3.x to staging June 17, 2020 07:43
@npracht npracht added ready-to-test PR's that are ready to test and removed needs-rebase PR's that need to be rebased labels Jun 17, 2020
@RCheesley RCheesley modified the milestones: 3.0.1, 3.1.0 Jun 17, 2020
@mautic mautic deleted a comment from TravisBuddy Jul 15, 2020
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #7228 (bb1021d) into 4.x (dc15208) will increase coverage by 0.91%.
The diff coverage is 60.86%.

❗ Current head bb1021d differs from pull request most recent head 869889d. Consider uploading reports for the commit 869889d to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##                4.x    #7228      +/-   ##
============================================
+ Coverage     44.60%   45.51%   +0.91%     
- Complexity    34877    38890    +4013     
============================================
  Files          2089     2082       -7     
  Lines        116938   126510    +9572     
============================================
+ Hits          52157    57584    +5427     
- Misses        64781    68926    +4145     
Impacted Files Coverage Δ
...p/bundles/CoreBundle/Helper/DateRelativeParser.php 50.00% <50.00%> (ø)
...les/LeadBundle/Segment/Decorator/DateDecorator.php 50.00% <58.33%> (+50.00%) ⬆️
...undle/Segment/Decorator/Date/DateOptionFactory.php 100.00% <100.00%> (ø)
...e/Segment/Decorator/Date/Other/DateAnniversary.php 36.00% <100.00%> (ø)
.../LeadBundle/Services/DateAnniversaryDictionary.php 100.00% <100.00%> (ø)
...s/InstallBundle/Configurator/Step/DoctrineStep.php 20.00% <0.00%> (-32.50%) ⬇️
...Bundle/Form/Type/FormSubmitActionUserEmailType.php 40.74% <0.00%> (-23.97%) ⬇️
...apesJsBuilderBundle/Model/GrapesJsBuilderModel.php 61.53% <0.00%> (-23.08%) ⬇️
...bundles/CoreBundle/Templating/Engine/PhpEngine.php 75.00% <0.00%> (-20.00%) ⬇️
...lugins/MauticFocusBundle/Form/Type/ContentType.php 64.58% <0.00%> (-19.21%) ⬇️
... and 170 more

@kuzmany kuzmany closed this Jul 15, 2020
@kuzmany kuzmany force-pushed the support-language-segment-anniversary-filter branch from 6f2c41b to d27414a Compare July 15, 2020 17:26
@kuzmany kuzmany reopened this Jul 15, 2020
@RCheesley RCheesley closed this Aug 16, 2020
@RCheesley RCheesley reopened this Aug 16, 2020
@RCheesley
Copy link
Sponsor Member

Bumping to 3.2 due to lack of testing

@npracht npracht changed the base branch from staging to features December 1, 2020 07:44
@npracht npracht added the segments Anything related to segments label Dec 1, 2020
@npracht
Copy link
Member

npracht commented Dec 1, 2020

Documentation already mentions that it is translatable. I'll remove the label saying it misses documentation.

From : https://github.com/mautic/mautic-documentation/blob/master/pages/09.contacts/03.manage-segments/docs.en.md

Beside this you can specify your date with text. These formulas are translatable, so make sure you use them in correct format.

@npracht npracht added translations Anything related to translations and removed needs-documentation PR's that need documentation before they can be merged labels Dec 1, 2020
@npracht npracht modified the milestones: 3.3.0, Mautic 4.0 Feb 15, 2021
@RCheesley RCheesley modified the milestones: 4.0-alpha, 4.0-beta Mar 29, 2021
@npracht npracht modified the milestones: 4.0-beta, 4.0-rc May 14, 2021
@RCheesley RCheesley modified the milestones: 4.0-rc, 4.0-ga Jun 28, 2021
Copy link
Sponsor Member

@RCheesley RCheesley left a comment

Choose a reason for hiding this comment

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

Tested the PR following the instructions and all of the steps worked great in the English and French versions.

Thanks for the PR @kuzmany just needs a test/code review to be merged!

@RCheesley RCheesley added T1 Low difficulty to fix (issue) or test (PR) code-review-needed PR's that require a code review before merging pending-test-confirmation PR's that require one test before they can be merged labels Jul 16, 2021
@npracht npracht removed the ready-to-test PR's that are ready to test label Aug 18, 2021
@RCheesley
Copy link
Sponsor Member

Bumping from the release due to lack of testing/code review.

@RCheesley RCheesley removed this from the 4.0-ga milestone Aug 23, 2021
@RCheesley RCheesley changed the base branch from features to 4.x September 7, 2021 13:26
@kuzmany
Copy link
Member Author

kuzmany commented Oct 19, 2021

Close favor to #10541

@kuzmany kuzmany closed this Oct 19, 2021
@kuzmany kuzmany reopened this Jan 3, 2022
@kuzmany kuzmany closed this Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The PR contributors have signed the contributors agreement code-review-needed PR's that require a code review before merging enhancement Any improvement to an existing feature or functionality pending-test-confirmation PR's that require one test before they can be merged segments Anything related to segments T1 Low difficulty to fix (issue) or test (PR) translations Anything related to translations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants